
obj/net/ns:     file format elf32-i386


Disassembly of section .text:

00800020 <_start>:
// starts us running when we are initially loaded into a new environment.
.text
.globl _start
_start:
	// See if we were started with arguments on the stack
	cmpl $USTACKTOP, %esp
  800020:	81 fc 00 e0 bf ee    	cmp    $0xeebfe000,%esp
	jne args_exist
  800026:	75 04                	jne    80002c <args_exist>

	// If not, push dummy argc/argv arguments.
	// This happens when we are loaded by the kernel,
	// because the kernel does not know about passing arguments.
	pushl $0
  800028:	6a 00                	push   $0x0
	pushl $0
  80002a:	6a 00                	push   $0x0

0080002c <args_exist>:

args_exist:
	call libmain
  80002c:	e8 ff 08 00 00       	call   800930 <libmain>
1:	jmp 1b
  800031:	eb fe                	jmp    800031 <args_exist+0x5>
	...

00800040 <put_buffer>:

	return va;
}

static void
put_buffer(void *va) {
  800040:	55                   	push   %ebp
  800041:	89 e5                	mov    %esp,%ebp
	int i = ((uint32_t)va - REQVA) / PGSIZE;
	buse[i] = 0;
  800043:	2d 00 b0 fe 0f       	sub    $0xffeb000,%eax
  800048:	c1 e8 0c             	shr    $0xc,%eax
  80004b:	c7 04 85 c0 93 81 00 	movl   $0x0,0x8193c0(,%eax,4)
  800052:	00 00 00 00 
}
  800056:	5d                   	pop    %ebp
  800057:	c3                   	ret    

00800058 <umain>:
	serve();
}

void
umain(void)
{
  800058:	55                   	push   %ebp
  800059:	89 e5                	mov    %esp,%ebp
  80005b:	53                   	push   %ebx
  80005c:	83 ec 14             	sub    $0x14,%esp
	envid_t ns_envid = sys_getenvid();
  80005f:	e8 b5 18 00 00       	call   801919 <sys_getenvid>
  800064:	89 c3                	mov    %eax,%ebx

	binaryname = "ns";
  800066:	c7 05 00 90 81 00 03 	movl   $0x812e03,0x819000
  80006d:	2e 81 00 

	// fork off the timer thread which will send us periodic messages
	timer_envid = fork();
  800070:	e8 5d 19 00 00       	call   8019d2 <fork>
  800075:	a3 a4 93 81 00       	mov    %eax,0x8193a4
	if (timer_envid < 0)
  80007a:	85 c0                	test   %eax,%eax
  80007c:	79 1c                	jns    80009a <umain+0x42>
		panic("error forking");
  80007e:	c7 44 24 08 a0 24 81 	movl   $0x8124a0,0x8(%esp)
  800085:	00 
  800086:	c7 44 24 04 43 01 00 	movl   $0x143,0x4(%esp)
  80008d:	00 
  80008e:	c7 04 24 ae 24 81 00 	movl   $0x8124ae,(%esp)
  800095:	e8 02 09 00 00       	call   80099c <_panic>
	else if (timer_envid == 0) {
  80009a:	85 c0                	test   %eax,%eax
  80009c:	75 15                	jne    8000b3 <umain+0x5b>
		timer(ns_envid, TIMER_INTERVAL);
  80009e:	c7 44 24 04 fa 00 00 	movl   $0xfa,0x4(%esp)
  8000a5:	00 
  8000a6:	89 1c 24             	mov    %ebx,(%esp)
  8000a9:	e8 d2 06 00 00       	call   800780 <timer>
		return;
  8000ae:	e9 a3 00 00 00       	jmp    800156 <umain+0xfe>
	}

	// fork off the input thread which will poll the NIC driver for input
	// packets
	input_envid = fork();
  8000b3:	e8 1a 19 00 00       	call   8019d2 <fork>
  8000b8:	a3 a8 93 81 00       	mov    %eax,0x8193a8
	if (input_envid < 0)
  8000bd:	85 c0                	test   %eax,%eax
  8000bf:	79 1c                	jns    8000dd <umain+0x85>
		panic("error forking");
  8000c1:	c7 44 24 08 a0 24 81 	movl   $0x8124a0,0x8(%esp)
  8000c8:	00 
  8000c9:	c7 44 24 04 4d 01 00 	movl   $0x14d,0x4(%esp)
  8000d0:	00 
  8000d1:	c7 04 24 ae 24 81 00 	movl   $0x8124ae,(%esp)
  8000d8:	e8 bf 08 00 00       	call   80099c <_panic>
	else if (input_envid == 0) {
  8000dd:	85 c0                	test   %eax,%eax
  8000df:	75 0a                	jne    8000eb <umain+0x93>
		input(ns_envid);
  8000e1:	89 1c 24             	mov    %ebx,(%esp)
  8000e4:	e8 37 07 00 00       	call   800820 <input>
		return;
  8000e9:	eb 6b                	jmp    800156 <umain+0xfe>
	}

	// fork off the output thread that will send the packets to the NIC
	// driver
	output_envid = fork();
  8000eb:	90                   	nop
  8000ec:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  8000f0:	e8 dd 18 00 00       	call   8019d2 <fork>
  8000f5:	a3 ac 93 81 00       	mov    %eax,0x8193ac
	if (output_envid < 0)
  8000fa:	85 c0                	test   %eax,%eax
  8000fc:	79 1c                	jns    80011a <umain+0xc2>
		panic("error forking");
  8000fe:	c7 44 24 08 a0 24 81 	movl   $0x8124a0,0x8(%esp)
  800105:	00 
  800106:	c7 44 24 04 57 01 00 	movl   $0x157,0x4(%esp)
  80010d:	00 
  80010e:	c7 04 24 ae 24 81 00 	movl   $0x8124ae,(%esp)
  800115:	e8 82 08 00 00       	call   80099c <_panic>
	else if (output_envid == 0) {
  80011a:	85 c0                	test   %eax,%eax
  80011c:	75 0a                	jne    800128 <umain+0xd0>
		output(ns_envid);
  80011e:	89 1c 24             	mov    %ebx,(%esp)
  800121:	e8 a2 07 00 00       	call   8008c8 <output>
		return;
  800126:	eb 2e                	jmp    800156 <umain+0xfe>
	}

	// lwIP requires a user threading library; start the library and jump
	// into a thread to continue initialization. 
	thread_init();
  800128:	e8 83 dd 00 00       	call   80deb0 <thread_init>
	thread_create(0, "main", tmain, 0);
  80012d:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  800134:	00 
  800135:	c7 44 24 08 14 07 80 	movl   $0x800714,0x8(%esp)
  80013c:	00 
  80013d:	c7 44 24 04 b9 24 81 	movl   $0x8124b9,0x4(%esp)
  800144:	00 
  800145:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80014c:	e8 46 df 00 00       	call   80e097 <thread_create>
	thread_yield();
  800151:	e8 fa dd 00 00       	call   80df50 <thread_yield>
	// never coming here!
}
  800156:	83 c4 14             	add    $0x14,%esp
  800159:	5b                   	pop    %ebx
  80015a:	5d                   	pop    %ebp
  80015b:	c3                   	ret    

0080015c <serve>:
	sys_page_unmap(0, (void*) args->req);
	free(args);
}

void
serve(void) {
  80015c:	55                   	push   %ebp
  80015d:	89 e5                	mov    %esp,%ebp
  80015f:	57                   	push   %edi
  800160:	56                   	push   %esi
  800161:	53                   	push   %ebx
  800162:	83 ec 3c             	sub    $0x3c,%esp
  800165:	bb 00 00 00 00       	mov    $0x0,%ebx
		for (i = 0; thread_wakeups_pending() && i < 32; ++i)
			thread_yield();

		perm = 0;
		va = get_buffer();
		reqno = ipc_recv((int32_t *) &whom, (void *) va, &perm);
  80016a:	8d 7d e0             	lea    -0x20(%ebp),%edi
  80016d:	eb 08                	jmp    800177 <serve+0x1b>
	while (1) {
		// ipc_recv will block the entire process, so we flush
		// all pending work from other threads.  We limit the
		// number of yields in case there's a rogue thread.
		for (i = 0; thread_wakeups_pending() && i < 32; ++i)
			thread_yield();
  80016f:	e8 dc dd 00 00       	call   80df50 <thread_yield>
	
	while (1) {
		// ipc_recv will block the entire process, so we flush
		// all pending work from other threads.  We limit the
		// number of yields in case there's a rogue thread.
		for (i = 0; thread_wakeups_pending() && i < 32; ++i)
  800174:	83 c3 01             	add    $0x1,%ebx
  800177:	e8 85 dd 00 00       	call   80df01 <thread_wakeups_pending>
  80017c:	85 c0                	test   %eax,%eax
  80017e:	74 05                	je     800185 <serve+0x29>
  800180:	83 fb 1f             	cmp    $0x1f,%ebx
  800183:	7e ea                	jle    80016f <serve+0x13>
			thread_yield();

		perm = 0;
  800185:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
get_buffer(void) {
	void *va;

	int i;
	for (i = 0; i < QUEUE_SIZE; i++)
		if (!buse[i]) break;
  80018c:	83 3d c0 93 81 00 00 	cmpl   $0x0,0x8193c0
  800193:	74 3b                	je     8001d0 <serve+0x74>
  800195:	b8 01 00 00 00       	mov    $0x1,%eax
  80019a:	ba c0 93 81 00       	mov    $0x8193c0,%edx
  80019f:	83 3c 82 00          	cmpl   $0x0,(%edx,%eax,4)
  8001a3:	74 0a                	je     8001af <serve+0x53>
static void *
get_buffer(void) {
	void *va;

	int i;
	for (i = 0; i < QUEUE_SIZE; i++)
  8001a5:	83 c0 01             	add    $0x1,%eax
  8001a8:	83 f8 14             	cmp    $0x14,%eax
  8001ab:	75 f2                	jne    80019f <serve+0x43>
  8001ad:	eb 05                	jmp    8001b4 <serve+0x58>
		if (!buse[i]) break;

	if (i == QUEUE_SIZE) {
  8001af:	83 f8 14             	cmp    $0x14,%eax
  8001b2:	75 21                	jne    8001d5 <serve+0x79>
		panic("NS: buffer overflow");
  8001b4:	c7 44 24 08 be 24 81 	movl   $0x8124be,0x8(%esp)
  8001bb:	00 
  8001bc:	c7 44 24 04 3f 00 00 	movl   $0x3f,0x4(%esp)
  8001c3:	00 
  8001c4:	c7 04 24 ae 24 81 00 	movl   $0x8124ae,(%esp)
  8001cb:	e8 cc 07 00 00       	call   80099c <_panic>
  8001d0:	b8 00 00 00 00       	mov    $0x0,%eax
		return 0;
	}

	va = (void *)(REQVA + i * PGSIZE);
  8001d5:	8d 98 eb ff 00 00    	lea    0xffeb(%eax),%ebx
  8001db:	c1 e3 0c             	shl    $0xc,%ebx
	buse[i] = 1;
  8001de:	c7 04 85 c0 93 81 00 	movl   $0x1,0x8193c0(,%eax,4)
  8001e5:	01 00 00 00 
		for (i = 0; thread_wakeups_pending() && i < 32; ++i)
			thread_yield();

		perm = 0;
		va = get_buffer();
		reqno = ipc_recv((int32_t *) &whom, (void *) va, &perm);
  8001e9:	89 7c 24 08          	mov    %edi,0x8(%esp)
  8001ed:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  8001f1:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  8001f4:	89 04 24             	mov    %eax,(%esp)
  8001f7:	e8 26 1c 00 00       	call   801e22 <ipc_recv>
  8001fc:	89 c6                	mov    %eax,%esi
		if (debug) {
			cprintf("ns req %d from %08x\n", reqno, whom);
		}

		// first take care of requests that do not contain an argument page
		if (reqno == NSREQ_TIMER) {
  8001fe:	83 f8 0c             	cmp    $0xc,%eax
  800201:	75 67                	jne    80026a <serve+0x10e>
			process_timer(whom);
  800203:	8b 75 e4             	mov    -0x1c(%ebp),%esi

static void
process_timer(envid_t envid) {
	uint32_t start, now, to;

	if (envid != timer_envid) {
  800206:	3b 35 a4 93 81 00    	cmp    0x8193a4,%esi
  80020c:	74 12                	je     800220 <serve+0xc4>
		cprintf("NS: received timer interrupt from envid %x not timer env\n", envid);
  80020e:	89 74 24 04          	mov    %esi,0x4(%esp)
  800212:	c7 04 24 4c 25 81 00 	movl   $0x81254c,(%esp)
  800219:	e8 43 08 00 00       	call   800a61 <cprintf>
  80021e:	eb 39                	jmp    800259 <serve+0xfd>
		return;
	}

	start = sys_time_msec();
  800220:	e8 9a 13 00 00       	call   8015bf <sys_time_msec>
  800225:	89 45 d4             	mov    %eax,-0x2c(%ebp)
	thread_yield();
  800228:	e8 23 dd 00 00       	call   80df50 <thread_yield>
	now = sys_time_msec();
  80022d:	e8 8d 13 00 00       	call   8015bf <sys_time_msec>

	to = TIMER_INTERVAL - (now - start);
	ipc_send(envid, to, 0, 0);
  800232:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  800239:	00 
  80023a:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  800241:	00 
  800242:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  800245:	81 c2 fa 00 00 00    	add    $0xfa,%edx
  80024b:	29 c2                	sub    %eax,%edx
  80024d:	89 54 24 04          	mov    %edx,0x4(%esp)
  800251:	89 34 24             	mov    %esi,(%esp)
  800254:	e8 57 1b 00 00       	call   801db0 <ipc_send>
		}

		// first take care of requests that do not contain an argument page
		if (reqno == NSREQ_TIMER) {
			process_timer(whom);
			put_buffer(va);
  800259:	89 d8                	mov    %ebx,%eax
  80025b:	e8 e0 fd ff ff       	call   800040 <put_buffer>
  800260:	bb 00 00 00 00       	mov    $0x0,%ebx
			continue;
  800265:	e9 0d ff ff ff       	jmp    800177 <serve+0x1b>
		}

		// All remaining requests must contain an argument page
		if (!(perm & PTE_P)) {
  80026a:	f6 45 e0 01          	testb  $0x1,-0x20(%ebp)
  80026e:	66 90                	xchg   %ax,%ax
  800270:	75 1d                	jne    80028f <serve+0x133>
			cprintf("Invalid request from %08x: no argument page\n", whom);
  800272:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  800275:	89 44 24 04          	mov    %eax,0x4(%esp)
  800279:	c7 04 24 88 25 81 00 	movl   $0x812588,(%esp)
  800280:	e8 dc 07 00 00       	call   800a61 <cprintf>
  800285:	bb 00 00 00 00       	mov    $0x0,%ebx
			continue; // just leave it hanging...
  80028a:	e9 e8 fe ff ff       	jmp    800177 <serve+0x1b>
		}

		// Since some lwIP socket calls will block, create a thread and
		// process the rest of the request in the thread.
		struct st_args *args = malloc(sizeof(struct st_args));
  80028f:	c7 04 24 0c 00 00 00 	movl   $0xc,(%esp)
  800296:	e8 b8 2a 00 00       	call   802d53 <malloc>
		if (!args)
  80029b:	85 c0                	test   %eax,%eax
  80029d:	75 1c                	jne    8002bb <serve+0x15f>
			panic("could not allocate thread args structure");
  80029f:	c7 44 24 08 b8 25 81 	movl   $0x8125b8,0x8(%esp)
  8002a6:	00 
  8002a7:	c7 44 24 04 26 01 00 	movl   $0x126,0x4(%esp)
  8002ae:	00 
  8002af:	c7 04 24 ae 24 81 00 	movl   $0x8124ae,(%esp)
  8002b6:	e8 e1 06 00 00       	call   80099c <_panic>

		args->reqno = reqno;
  8002bb:	89 30                	mov    %esi,(%eax)
		args->whom = whom;
  8002bd:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  8002c0:	89 50 04             	mov    %edx,0x4(%eax)
		args->req = va;
  8002c3:	89 58 08             	mov    %ebx,0x8(%eax)

		thread_create(0, "serve_thread", serve_thread, (uint32_t)args);
  8002c6:	89 44 24 0c          	mov    %eax,0xc(%esp)
  8002ca:	c7 44 24 08 f5 02 80 	movl   $0x8002f5,0x8(%esp)
  8002d1:	00 
  8002d2:	c7 44 24 04 d2 24 81 	movl   $0x8124d2,0x4(%esp)
  8002d9:	00 
  8002da:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  8002e1:	e8 b1 dd 00 00       	call   80e097 <thread_create>
		thread_yield(); // let the thread created run
  8002e6:	e8 65 dc 00 00       	call   80df50 <thread_yield>
  8002eb:	bb 00 00 00 00       	mov    $0x0,%ebx
  8002f0:	e9 82 fe ff ff       	jmp    800177 <serve+0x1b>

008002f5 <serve_thread>:
	uint32_t whom;
	union Nsipc *req;
};

static void
serve_thread(uint32_t a) {
  8002f5:	55                   	push   %ebp
  8002f6:	89 e5                	mov    %esp,%ebp
  8002f8:	81 ec 98 00 00 00    	sub    $0x98,%esp
  8002fe:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  800301:	89 75 f8             	mov    %esi,-0x8(%ebp)
  800304:	89 7d fc             	mov    %edi,-0x4(%ebp)
	struct st_args *args = (struct st_args *)a;
  800307:	8b 5d 08             	mov    0x8(%ebp),%ebx
	union Nsipc *req = args->req;
  80030a:	8b 73 08             	mov    0x8(%ebx),%esi
	int r;

	switch (args->reqno) {
  80030d:	83 3b 0a             	cmpl   $0xa,(%ebx)
  800310:	0f 87 34 01 00 00    	ja     80044a <serve_thread+0x155>
  800316:	8b 03                	mov    (%ebx),%eax
  800318:	ff 24 85 84 26 81 00 	jmp    *0x812684(,%eax,4)
	case NSREQ_ACCEPT:
	{
		struct Nsret_accept ret;
		r = lwip_accept(req->accept.req_s, &ret.ret_addr,
  80031f:	8d 45 94             	lea    -0x6c(%ebp),%eax
  800322:	89 44 24 08          	mov    %eax,0x8(%esp)
  800326:	8d 45 84             	lea    -0x7c(%ebp),%eax
  800329:	89 44 24 04          	mov    %eax,0x4(%esp)
  80032d:	8b 06                	mov    (%esi),%eax
  80032f:	89 04 24             	mov    %eax,(%esp)
  800332:	e8 20 4a 00 00       	call   804d57 <lwip_accept>
  800337:	89 c7                	mov    %eax,%edi
				&ret.ret_addrlen);
		memmove(req, &ret, sizeof ret);
  800339:	c7 44 24 08 14 00 00 	movl   $0x14,0x8(%esp)
  800340:	00 
  800341:	8d 45 84             	lea    -0x7c(%ebp),%eax
  800344:	89 44 24 04          	mov    %eax,0x4(%esp)
  800348:	89 34 24             	mov    %esi,(%esp)
  80034b:	e8 95 0f 00 00       	call   8012e5 <memmove>
		break;
  800350:	e9 13 01 00 00       	jmp    800468 <serve_thread+0x173>
	}
	case NSREQ_BIND:
		r = lwip_bind(req->bind.req_s, &req->bind.req_name,
  800355:	8b 46 14             	mov    0x14(%esi),%eax
  800358:	89 44 24 08          	mov    %eax,0x8(%esp)
  80035c:	8d 46 04             	lea    0x4(%esi),%eax
  80035f:	89 44 24 04          	mov    %eax,0x4(%esp)
  800363:	8b 06                	mov    (%esi),%eax
  800365:	89 04 24             	mov    %eax,(%esp)
  800368:	e8 31 49 00 00       	call   804c9e <lwip_bind>
  80036d:	89 c7                	mov    %eax,%edi
			      req->bind.req_namelen);
		break;
  80036f:	e9 f4 00 00 00       	jmp    800468 <serve_thread+0x173>
	case NSREQ_SHUTDOWN:
		r = lwip_shutdown(req->shutdown.req_s, req->shutdown.req_how);
  800374:	8b 46 04             	mov    0x4(%esi),%eax
  800377:	89 44 24 04          	mov    %eax,0x4(%esp)
  80037b:	8b 06                	mov    (%esi),%eax
  80037d:	89 04 24             	mov    %eax,(%esp)
  800380:	e8 bf 47 00 00       	call   804b44 <lwip_shutdown>
  800385:	89 c7                	mov    %eax,%edi
		break;
  800387:	e9 dc 00 00 00       	jmp    800468 <serve_thread+0x173>
	case NSREQ_CLOSE:
		r = lwip_close(req->close.req_s);
  80038c:	8b 06                	mov    (%esi),%eax
  80038e:	89 04 24             	mov    %eax,(%esp)
  800391:	e8 32 47 00 00       	call   804ac8 <lwip_close>
  800396:	89 c7                	mov    %eax,%edi
		break;
  800398:	e9 cb 00 00 00       	jmp    800468 <serve_thread+0x173>
	case NSREQ_CONNECT:
		r = lwip_connect(req->connect.req_s, &req->connect.req_name,
  80039d:	8b 46 14             	mov    0x14(%esi),%eax
  8003a0:	89 44 24 08          	mov    %eax,0x8(%esp)
  8003a4:	8d 46 04             	lea    0x4(%esi),%eax
  8003a7:	89 44 24 04          	mov    %eax,0x4(%esp)
  8003ab:	8b 06                	mov    (%esi),%eax
  8003ad:	89 04 24             	mov    %eax,(%esp)
  8003b0:	e8 30 48 00 00       	call   804be5 <lwip_connect>
  8003b5:	89 c7                	mov    %eax,%edi
				 req->connect.req_namelen);
		break;
  8003b7:	e9 ac 00 00 00       	jmp    800468 <serve_thread+0x173>
	case NSREQ_LISTEN:
		r = lwip_listen(req->listen.req_s, req->listen.req_backlog);
  8003bc:	8b 46 04             	mov    0x4(%esi),%eax
  8003bf:	89 44 24 04          	mov    %eax,0x4(%esp)
  8003c3:	8b 06                	mov    (%esi),%eax
  8003c5:	89 04 24             	mov    %eax,(%esp)
  8003c8:	e8 8a 47 00 00       	call   804b57 <lwip_listen>
  8003cd:	89 c7                	mov    %eax,%edi
		break;
  8003cf:	e9 94 00 00 00       	jmp    800468 <serve_thread+0x173>
	case NSREQ_RECV:
		// Note that we read the request fields before we
		// overwrite it with the response data.
		r = lwip_recv(req->recv.req_s, req->recvRet.ret_buf,
  8003d4:	8b 46 08             	mov    0x8(%esi),%eax
  8003d7:	89 44 24 0c          	mov    %eax,0xc(%esp)
  8003db:	8b 46 04             	mov    0x4(%esi),%eax
  8003de:	89 44 24 08          	mov    %eax,0x8(%esp)
  8003e2:	89 74 24 04          	mov    %esi,0x4(%esp)
  8003e6:	8b 06                	mov    (%esi),%eax
  8003e8:	89 04 24             	mov    %eax,(%esp)
  8003eb:	e8 67 46 00 00       	call   804a57 <lwip_recv>
  8003f0:	89 c7                	mov    %eax,%edi
			      req->recv.req_len, req->recv.req_flags);
		break;
  8003f2:	eb 74                	jmp    800468 <serve_thread+0x173>
	case NSREQ_SEND:
		r = lwip_send(req->send.req_s, &req->send.req_buf,
  8003f4:	8b 46 08             	mov    0x8(%esi),%eax
  8003f7:	89 44 24 0c          	mov    %eax,0xc(%esp)
  8003fb:	8b 46 04             	mov    0x4(%esi),%eax
  8003fe:	89 44 24 08          	mov    %eax,0x8(%esp)
  800402:	8d 46 0c             	lea    0xc(%esi),%eax
  800405:	89 44 24 04          	mov    %eax,0x4(%esp)
  800409:	8b 06                	mov    (%esi),%eax
  80040b:	89 04 24             	mov    %eax,(%esp)
  80040e:	e8 c7 41 00 00       	call   8045da <lwip_send>
  800413:	89 c7                	mov    %eax,%edi
			      req->send.req_size, req->send.req_flags);
		break;
  800415:	eb 51                	jmp    800468 <serve_thread+0x173>
	case NSREQ_SOCKET:
		r = lwip_socket(req->socket.req_domain, req->socket.req_type,
  800417:	8b 46 08             	mov    0x8(%esi),%eax
  80041a:	89 44 24 08          	mov    %eax,0x8(%esp)
  80041e:	8b 46 04             	mov    0x4(%esi),%eax
  800421:	89 44 24 04          	mov    %eax,0x4(%esp)
  800425:	8b 06                	mov    (%esi),%eax
  800427:	89 04 24             	mov    %eax,(%esp)
  80042a:	e8 c0 40 00 00       	call   8044ef <lwip_socket>
  80042f:	89 c7                	mov    %eax,%edi
				req->socket.req_protocol);
		break;
  800431:	eb 35                	jmp    800468 <serve_thread+0x173>
	case NSREQ_INPUT:
		jif_input(&nif, (void *)&req->pkt);
  800433:	89 74 24 04          	mov    %esi,0x4(%esp)
  800437:	c7 04 24 c0 f5 b3 00 	movl   $0xb3f5c0,(%esp)
  80043e:	e8 97 e0 00 00       	call   80e4da <jif_input>
  800443:	bf 00 00 00 00       	mov    $0x0,%edi
		r = 0;
		break;
  800448:	eb 4c                	jmp    800496 <serve_thread+0x1a1>
	default:
		cprintf("Invalid request code %d from %08x\n", args->whom, args->req);
  80044a:	89 74 24 08          	mov    %esi,0x8(%esp)
  80044e:	8b 43 04             	mov    0x4(%ebx),%eax
  800451:	89 44 24 04          	mov    %eax,0x4(%esp)
  800455:	c7 04 24 e4 25 81 00 	movl   $0x8125e4,(%esp)
  80045c:	e8 00 06 00 00       	call   800a61 <cprintf>
  800461:	bf fd ff ff ff       	mov    $0xfffffffd,%edi
  800466:	eb 2e                	jmp    800496 <serve_thread+0x1a1>
		r = -E_INVAL;
		break;
	}

	if (r == -1) {
  800468:	83 ff ff             	cmp    $0xffffffff,%edi
  80046b:	75 29                	jne    800496 <serve_thread+0x1a1>
		char buf[100];
		snprintf(buf, sizeof buf, "ns req type %d", args->reqno);
  80046d:	8b 03                	mov    (%ebx),%eax
  80046f:	89 44 24 0c          	mov    %eax,0xc(%esp)
  800473:	c7 44 24 08 df 24 81 	movl   $0x8124df,0x8(%esp)
  80047a:	00 
  80047b:	c7 44 24 04 64 00 00 	movl   $0x64,0x4(%esp)
  800482:	00 
  800483:	8d 75 84             	lea    -0x7c(%ebp),%esi
  800486:	89 34 24             	mov    %esi,(%esp)
  800489:	e8 fb 0b 00 00       	call   801089 <snprintf>
		perror(buf);
  80048e:	89 34 24             	mov    %esi,(%esp)
  800491:	e8 11 de 00 00       	call   80e2a7 <perror>
	}

	if (args->reqno != NSREQ_INPUT)
  800496:	83 3b 0a             	cmpl   $0xa,(%ebx)
  800499:	74 1f                	je     8004ba <serve_thread+0x1c5>
		ipc_send(args->whom, r, 0, 0);
  80049b:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  8004a2:	00 
  8004a3:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  8004aa:	00 
  8004ab:	89 7c 24 04          	mov    %edi,0x4(%esp)
  8004af:	8b 43 04             	mov    0x4(%ebx),%eax
  8004b2:	89 04 24             	mov    %eax,(%esp)
  8004b5:	e8 f6 18 00 00       	call   801db0 <ipc_send>

	put_buffer(args->req);
  8004ba:	8b 43 08             	mov    0x8(%ebx),%eax
  8004bd:	e8 7e fb ff ff       	call   800040 <put_buffer>
	sys_page_unmap(0, (void*) args->req);
  8004c2:	8b 43 08             	mov    0x8(%ebx),%eax
  8004c5:	89 44 24 04          	mov    %eax,0x4(%esp)
  8004c9:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  8004d0:	e8 f5 12 00 00       	call   8017ca <sys_page_unmap>
	free(args);
  8004d5:	89 1c 24             	mov    %ebx,(%esp)
  8004d8:	e8 a3 27 00 00       	call   802c80 <free>
}
  8004dd:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  8004e0:	8b 75 f8             	mov    -0x8(%ebp),%esi
  8004e3:	8b 7d fc             	mov    -0x4(%ebp),%edi
  8004e6:	89 ec                	mov    %ebp,%esp
  8004e8:	5d                   	pop    %ebp
  8004e9:	c3                   	ret    

008004ea <net_timer>:
	netif_set_up(nif);
}

static void __attribute__((noreturn))
net_timer(uint32_t arg)
{
  8004ea:	55                   	push   %ebp
  8004eb:	89 e5                	mov    %esp,%ebp
  8004ed:	56                   	push   %esi
  8004ee:	53                   	push   %ebx
  8004ef:	83 ec 10             	sub    $0x10,%esp
	struct timer_thread *t = (struct timer_thread *) arg;
  8004f2:	8b 5d 08             	mov    0x8(%ebp),%ebx

	for (;;) {
		uint32_t cur = sys_time_msec();
  8004f5:	e8 c5 10 00 00       	call   8015bf <sys_time_msec>
  8004fa:	89 c6                	mov    %eax,%esi

		lwip_core_lock();
  8004fc:	e8 78 d0 00 00       	call   80d579 <lwip_core_lock>
		t->func();
  800501:	ff 53 04             	call   *0x4(%ebx)
		lwip_core_unlock();
  800504:	e8 75 d0 00 00       	call   80d57e <lwip_core_unlock>

		thread_wait(0, 0, cur + t->msec);
  800509:	03 33                	add    (%ebx),%esi
  80050b:	89 74 24 08          	mov    %esi,0x8(%esp)
  80050f:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  800516:	00 
  800517:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80051e:	e8 bc dc 00 00       	call   80e1df <thread_wait>
  800523:	eb d0                	jmp    8004f5 <net_timer+0xb>

00800525 <start_timer>:
	}
}

static void
start_timer(struct timer_thread *t, void (*func)(void), const char *name, int msec)
{
  800525:	55                   	push   %ebp
  800526:	89 e5                	mov    %esp,%ebp
  800528:	53                   	push   %ebx
  800529:	83 ec 14             	sub    $0x14,%esp
	t->msec = msec;
  80052c:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80052f:	89 18                	mov    %ebx,(%eax)
	t->func = func;
  800531:	89 50 04             	mov    %edx,0x4(%eax)
	t->name = name;
  800534:	89 48 08             	mov    %ecx,0x8(%eax)
	int r = thread_create(0, name, &net_timer, (uint32_t)t);
  800537:	89 44 24 0c          	mov    %eax,0xc(%esp)
  80053b:	c7 44 24 08 ea 04 80 	movl   $0x8004ea,0x8(%esp)
  800542:	00 
  800543:	89 4c 24 04          	mov    %ecx,0x4(%esp)
  800547:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80054e:	e8 44 db 00 00       	call   80e097 <thread_create>
	if (r < 0)
  800553:	85 c0                	test   %eax,%eax
  800555:	79 28                	jns    80057f <start_timer+0x5a>
		panic("cannot create timer thread: %s", e2s(r));
  800557:	89 04 24             	mov    %eax,(%esp)
  80055a:	e8 39 dd 00 00       	call   80e298 <e2s>
  80055f:	89 44 24 0c          	mov    %eax,0xc(%esp)
  800563:	c7 44 24 08 08 26 81 	movl   $0x812608,0x8(%esp)
  80056a:	00 
  80056b:	c7 44 24 04 7a 00 00 	movl   $0x7a,0x4(%esp)
  800572:	00 
  800573:	c7 04 24 ae 24 81 00 	movl   $0x8124ae,(%esp)
  80057a:	e8 1d 04 00 00       	call   80099c <_panic>
}
  80057f:	83 c4 14             	add    $0x14,%esp
  800582:	5b                   	pop    %ebx
  800583:	5d                   	pop    %ebp
  800584:	c3                   	ret    

00800585 <serve_init>:
	thread_wakeup(done);
}

void
serve_init(uint32_t ipaddr, uint32_t netmask, uint32_t gw)
{
  800585:	55                   	push   %ebp
  800586:	89 e5                	mov    %esp,%ebp
  800588:	56                   	push   %esi
  800589:	53                   	push   %ebx
  80058a:	83 ec 30             	sub    $0x30,%esp
  80058d:	8b 75 08             	mov    0x8(%ebp),%esi
	int r;
	lwip_core_lock();
  800590:	e8 e4 cf 00 00       	call   80d579 <lwip_core_lock>

	uint32_t done = 0;
  800595:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
	tcpip_init(&tcpip_init_done, &done);
  80059c:	8d 5d f4             	lea    -0xc(%ebp),%ebx
  80059f:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  8005a3:	c7 04 24 67 07 80 00 	movl   $0x800767,(%esp)
  8005aa:	e8 94 49 00 00       	call   804f43 <tcpip_init>
	lwip_core_unlock();
  8005af:	e8 ca cf 00 00       	call   80d57e <lwip_core_unlock>
	thread_wait(&done, 0, (uint32_t)~0);
  8005b4:	c7 44 24 08 ff ff ff 	movl   $0xffffffff,0x8(%esp)
  8005bb:	ff 
  8005bc:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  8005c3:	00 
  8005c4:	89 1c 24             	mov    %ebx,(%esp)
  8005c7:	e8 13 dc 00 00       	call   80e1df <thread_wait>
	lwip_core_lock();
  8005cc:	e8 a8 cf 00 00       	call   80d579 <lwip_core_lock>
static void
lwip_init(struct netif *nif, void *if_state,
	  uint32_t init_addr, uint32_t init_mask, uint32_t init_gw)
{
	struct ip_addr ipaddr, netmask, gateway;
	ipaddr.addr  = init_addr;
  8005d1:	89 75 f0             	mov    %esi,-0x10(%ebp)
	netmask.addr = init_mask;
  8005d4:	8b 45 0c             	mov    0xc(%ebp),%eax
  8005d7:	89 45 ec             	mov    %eax,-0x14(%ebp)
	gateway.addr = init_gw;
  8005da:	8b 45 10             	mov    0x10(%ebp),%eax
  8005dd:	89 45 e8             	mov    %eax,-0x18(%ebp)

	if (0 == netif_add(nif, &ipaddr, &netmask, &gateway,
  8005e0:	c7 44 24 18 b4 9b 80 	movl   $0x809bb4,0x18(%esp)
  8005e7:	00 
  8005e8:	c7 44 24 14 e0 e2 80 	movl   $0x80e2e0,0x14(%esp)
  8005ef:	00 
  8005f0:	c7 44 24 10 ac 93 81 	movl   $0x8193ac,0x10(%esp)
  8005f7:	00 
  8005f8:	8d 45 e8             	lea    -0x18(%ebp),%eax
  8005fb:	89 44 24 0c          	mov    %eax,0xc(%esp)
  8005ff:	8d 45 ec             	lea    -0x14(%ebp),%eax
  800602:	89 44 24 08          	mov    %eax,0x8(%esp)
  800606:	8d 45 f0             	lea    -0x10(%ebp),%eax
  800609:	89 44 24 04          	mov    %eax,0x4(%esp)
  80060d:	c7 04 24 c0 f5 b3 00 	movl   $0xb3f5c0,(%esp)
  800614:	e8 f8 73 00 00       	call   807a11 <netif_add>
  800619:	85 c0                	test   %eax,%eax
  80061b:	75 1c                	jne    800639 <serve_init+0xb4>
			   if_state,
			   jif_init,
			   ip_input))
		panic("lwip_init: error in netif_add\n");
  80061d:	c7 44 24 08 28 26 81 	movl   $0x812628,0x8(%esp)
  800624:	00 
  800625:	c7 44 24 04 5c 00 00 	movl   $0x5c,0x4(%esp)
  80062c:	00 
  80062d:	c7 04 24 ae 24 81 00 	movl   $0x8124ae,(%esp)
  800634:	e8 63 03 00 00       	call   80099c <_panic>

	netif_set_default(nif);
  800639:	c7 04 24 c0 f5 b3 00 	movl   $0xb3f5c0,(%esp)
  800640:	e8 4c 72 00 00       	call   807891 <netif_set_default>
	netif_set_up(nif);
  800645:	c7 04 24 c0 f5 b3 00 	movl   $0xb3f5c0,(%esp)
  80064c:	e8 cd 72 00 00       	call   80791e <netif_set_up>
	thread_wait(&done, 0, (uint32_t)~0);
	lwip_core_lock();

	lwip_init(&nif, &output_envid, ipaddr, netmask, gw);

	start_timer(&t_arp, &etharp_tmr, "arp timer", ARP_TMR_INTERVAL);
  800651:	c7 04 24 88 13 00 00 	movl   $0x1388,(%esp)
  800658:	b9 ee 24 81 00       	mov    $0x8124ee,%ecx
  80065d:	ba 19 d0 80 00       	mov    $0x80d019,%edx
  800662:	b8 80 93 81 00       	mov    $0x819380,%eax
  800667:	e8 b9 fe ff ff       	call   800525 <start_timer>
	start_timer(&t_tcpf, &tcp_fasttmr, "tcp f timer", TCP_FAST_INTERVAL);
  80066c:	c7 04 24 fa 00 00 00 	movl   $0xfa,(%esp)
  800673:	b9 f8 24 81 00       	mov    $0x8124f8,%ecx
  800678:	ba ac 89 80 00       	mov    $0x8089ac,%edx
  80067d:	b8 8c 93 81 00       	mov    $0x81938c,%eax
  800682:	e8 9e fe ff ff       	call   800525 <start_timer>
	start_timer(&t_tcps, &tcp_slowtmr, "tcp s timer", TCP_SLOW_INTERVAL);
  800687:	c7 04 24 f4 01 00 00 	movl   $0x1f4,(%esp)
  80068e:	b9 04 25 81 00       	mov    $0x812504,%ecx
  800693:	ba de 92 80 00       	mov    $0x8092de,%edx
  800698:	b8 98 93 81 00       	mov    $0x819398,%eax
  80069d:	e8 83 fe ff ff       	call   800525 <start_timer>

	struct in_addr ia = {ipaddr};
	cprintf("ns: %02x:%02x:%02x:%02x:%02x:%02x" 
  8006a2:	89 34 24             	mov    %esi,(%esp)
  8006a5:	e8 76 a5 00 00       	call   80ac20 <inet_ntoa>
  8006aa:	89 44 24 1c          	mov    %eax,0x1c(%esp)
  8006ae:	0f b6 05 ea f5 b3 00 	movzbl 0xb3f5ea,%eax
  8006b5:	89 44 24 18          	mov    %eax,0x18(%esp)
  8006b9:	0f b6 05 e9 f5 b3 00 	movzbl 0xb3f5e9,%eax
  8006c0:	89 44 24 14          	mov    %eax,0x14(%esp)
  8006c4:	0f b6 05 e8 f5 b3 00 	movzbl 0xb3f5e8,%eax
  8006cb:	89 44 24 10          	mov    %eax,0x10(%esp)
  8006cf:	0f b6 05 e7 f5 b3 00 	movzbl 0xb3f5e7,%eax
  8006d6:	89 44 24 0c          	mov    %eax,0xc(%esp)
  8006da:	0f b6 05 e6 f5 b3 00 	movzbl 0xb3f5e6,%eax
  8006e1:	89 44 24 08          	mov    %eax,0x8(%esp)
  8006e5:	0f b6 05 e5 f5 b3 00 	movzbl 0xb3f5e5,%eax
  8006ec:	89 44 24 04          	mov    %eax,0x4(%esp)
  8006f0:	c7 04 24 48 26 81 00 	movl   $0x812648,(%esp)
  8006f7:	e8 65 03 00 00       	call   800a61 <cprintf>
		" bound to static IP %s\n", 
		nif.hwaddr[0], nif.hwaddr[1], nif.hwaddr[2],
		nif.hwaddr[3], nif.hwaddr[4], nif.hwaddr[5],
		inet_ntoa(ia));

	lwip_core_unlock();
  8006fc:	e8 7d ce 00 00       	call   80d57e <lwip_core_unlock>

	cprintf("NS: TCP/IP initialized.\n");
  800701:	c7 04 24 10 25 81 00 	movl   $0x812510,(%esp)
  800708:	e8 54 03 00 00       	call   800a61 <cprintf>
}
  80070d:	83 c4 30             	add    $0x30,%esp
  800710:	5b                   	pop    %ebx
  800711:	5e                   	pop    %esi
  800712:	5d                   	pop    %ebp
  800713:	c3                   	ret    

00800714 <tmain>:
		thread_yield(); // let the thread created run
	}
}

static void
tmain(uint32_t arg) {
  800714:	55                   	push   %ebp
  800715:	89 e5                	mov    %esp,%ebp
  800717:	83 ec 18             	sub    $0x18,%esp
  80071a:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  80071d:	89 75 fc             	mov    %esi,-0x4(%ebp)
	serve_init(inet_addr(IP),
  800720:	c7 04 24 29 25 81 00 	movl   $0x812529,(%esp)
  800727:	e8 e4 a7 00 00       	call   80af10 <inet_addr>
  80072c:	89 c3                	mov    %eax,%ebx
  80072e:	c7 04 24 32 25 81 00 	movl   $0x812532,(%esp)
  800735:	e8 d6 a7 00 00       	call   80af10 <inet_addr>
  80073a:	89 c6                	mov    %eax,%esi
  80073c:	c7 04 24 40 25 81 00 	movl   $0x812540,(%esp)
  800743:	e8 c8 a7 00 00       	call   80af10 <inet_addr>
  800748:	89 5c 24 08          	mov    %ebx,0x8(%esp)
  80074c:	89 74 24 04          	mov    %esi,0x4(%esp)
  800750:	89 04 24             	mov    %eax,(%esp)
  800753:	e8 2d fe ff ff       	call   800585 <serve_init>
		   inet_addr(MASK),
		   inet_addr(DEFAULT));
	serve();
  800758:	e8 ff f9 ff ff       	call   80015c <serve>
}
  80075d:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  800760:	8b 75 fc             	mov    -0x4(%ebp),%esi
  800763:	89 ec                	mov    %ebp,%esp
  800765:	5d                   	pop    %ebp
  800766:	c3                   	ret    

00800767 <tcpip_init_done>:
		panic("cannot create timer thread: %s", e2s(r));
}

static void
tcpip_init_done(void *arg)
{
  800767:	55                   	push   %ebp
  800768:	89 e5                	mov    %esp,%ebp
  80076a:	83 ec 18             	sub    $0x18,%esp
  80076d:	8b 45 08             	mov    0x8(%ebp),%eax
	uint32_t *done = arg;
	*done = 1;
  800770:	c7 00 01 00 00 00    	movl   $0x1,(%eax)
	thread_wakeup(done);
  800776:	89 04 24             	mov    %eax,(%esp)
  800779:	e8 61 d7 00 00       	call   80dedf <thread_wakeup>
}
  80077e:	c9                   	leave  
  80077f:	c3                   	ret    

00800780 <timer>:
#include "ns.h"

void
timer(envid_t ns_envid, uint32_t initial_to) {
  800780:	55                   	push   %ebp
  800781:	89 e5                	mov    %esp,%ebp
  800783:	57                   	push   %edi
  800784:	56                   	push   %esi
  800785:	53                   	push   %ebx
  800786:	83 ec 2c             	sub    $0x2c,%esp
  800789:	8b 75 08             	mov    0x8(%ebp),%esi
	uint32_t stop = sys_time_msec() + initial_to;
  80078c:	e8 2e 0e 00 00       	call   8015bf <sys_time_msec>
  800791:	89 c3                	mov    %eax,%ebx
  800793:	03 5d 0c             	add    0xc(%ebp),%ebx

	binaryname = "ns_timer";
  800796:	c7 05 00 90 81 00 b0 	movl   $0x8126b0,0x819000
  80079d:	26 81 00 

		ipc_send(ns_envid, NSREQ_TIMER, 0, 0);

		while (1) {
			uint32_t to, whom;
			to = ipc_recv((int32_t *) &whom, 0, 0);
  8007a0:	8d 7d e4             	lea    -0x1c(%ebp),%edi
  8007a3:	eb 05                	jmp    8007aa <timer+0x2a>

	binaryname = "ns_timer";

	while (1) {
		while(sys_time_msec() < stop) {
			sys_yield();
  8007a5:	e8 3b 11 00 00       	call   8018e5 <sys_yield>
	uint32_t stop = sys_time_msec() + initial_to;

	binaryname = "ns_timer";

	while (1) {
		while(sys_time_msec() < stop) {
  8007aa:	e8 10 0e 00 00       	call   8015bf <sys_time_msec>
  8007af:	39 c3                	cmp    %eax,%ebx
  8007b1:	77 f2                	ja     8007a5 <timer+0x25>
			sys_yield();
		}

		ipc_send(ns_envid, NSREQ_TIMER, 0, 0);
  8007b3:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  8007ba:	00 
  8007bb:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  8007c2:	00 
  8007c3:	c7 44 24 04 0c 00 00 	movl   $0xc,0x4(%esp)
  8007ca:	00 
  8007cb:	89 34 24             	mov    %esi,(%esp)
  8007ce:	e8 dd 15 00 00       	call   801db0 <ipc_send>

		while (1) {
			uint32_t to, whom;
			to = ipc_recv((int32_t *) &whom, 0, 0);
  8007d3:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  8007da:	00 
  8007db:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  8007e2:	00 
  8007e3:	89 3c 24             	mov    %edi,(%esp)
  8007e6:	e8 37 16 00 00       	call   801e22 <ipc_recv>
  8007eb:	89 c3                	mov    %eax,%ebx

			if (whom != ns_envid) {
  8007ed:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  8007f0:	39 c6                	cmp    %eax,%esi
  8007f2:	74 12                	je     800806 <timer+0x86>
				cprintf("NS TIMER: timer thread got IPC message from env %x not NS\n", whom);
  8007f4:	89 44 24 04          	mov    %eax,0x4(%esp)
  8007f8:	c7 04 24 bc 26 81 00 	movl   $0x8126bc,(%esp)
  8007ff:	e8 5d 02 00 00       	call   800a61 <cprintf>
				continue;
			}

			stop = sys_time_msec() + to;
			break;
		}
  800804:	eb cd                	jmp    8007d3 <timer+0x53>
			if (whom != ns_envid) {
				cprintf("NS TIMER: timer thread got IPC message from env %x not NS\n", whom);
				continue;
			}

			stop = sys_time_msec() + to;
  800806:	e8 b4 0d 00 00       	call   8015bf <sys_time_msec>
  80080b:	8d 1c 18             	lea    (%eax,%ebx,1),%ebx
  80080e:	66 90                	xchg   %ax,%ax
  800810:	eb 98                	jmp    8007aa <timer+0x2a>
	...

00800820 <input>:

extern union Nsipc nsipcbuf;

void
input(envid_t ns_envid)
{
  800820:	55                   	push   %ebp
  800821:	89 e5                	mov    %esp,%ebp
  800823:	56                   	push   %esi
  800824:	53                   	push   %ebx
  800825:	83 ec 10             	sub    $0x10,%esp
  800828:	8b 75 08             	mov    0x8(%ebp),%esi
    int r=0;
    int n=0;
	struct jif_pkt *pkt = (struct jif_pkt *)0x00100000;
    envid_t envid   = sys_getenvid();
  80082b:	e8 e9 10 00 00       	call   801919 <sys_getenvid>
	binaryname = "ns_input";
  800830:	c7 05 00 90 81 00 f7 	movl   $0x8126f7,0x819000
  800837:	26 81 00 
	// 	- read a packet from the device driver
	//	- send it to the network server
	// Hint: When you IPC a page to the network server, it will be
	// reading from it for a while, so don't immediately receive
	// another packet in to the same physical page.
    if((r=sys_page_alloc(0, (void *)pkt, PTE_P|PTE_W|PTE_U))<0)
  80083a:	c7 44 24 08 07 00 00 	movl   $0x7,0x8(%esp)
  800841:	00 
  800842:	c7 44 24 04 00 00 10 	movl   $0x100000,0x4(%esp)
  800849:	00 
  80084a:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  800851:	e8 30 10 00 00       	call   801886 <sys_page_alloc>
        panic("sys_page_map: error: %x\n", r);

    while (1) {
        if((n=sys_ns_recv(pkt->jp_data, PGSIZE-sizeof(struct jif_pkt)))>0) {
            if (n != 11) {
            pkt->jp_len = n;
  800856:	bb 00 00 10 00       	mov    $0x100000,%ebx
	// 	- read a packet from the device driver
	//	- send it to the network server
	// Hint: When you IPC a page to the network server, it will be
	// reading from it for a while, so don't immediately receive
	// another packet in to the same physical page.
    if((r=sys_page_alloc(0, (void *)pkt, PTE_P|PTE_W|PTE_U))<0)
  80085b:	85 c0                	test   %eax,%eax
  80085d:	79 20                	jns    80087f <input+0x5f>
        panic("sys_page_map: error: %x\n", r);
  80085f:	89 44 24 0c          	mov    %eax,0xc(%esp)
  800863:	c7 44 24 08 00 27 81 	movl   $0x812700,0x8(%esp)
  80086a:	00 
  80086b:	c7 44 24 04 15 00 00 	movl   $0x15,0x4(%esp)
  800872:	00 
  800873:	c7 04 24 19 27 81 00 	movl   $0x812719,(%esp)
  80087a:	e8 1d 01 00 00       	call   80099c <_panic>

    while (1) {
        if((n=sys_ns_recv(pkt->jp_data, PGSIZE-sizeof(struct jif_pkt)))>0) {
  80087f:	c7 44 24 04 fc 0f 00 	movl   $0xffc,0x4(%esp)
  800886:	00 
  800887:	c7 04 24 04 00 10 00 	movl   $0x100004,(%esp)
  80088e:	e8 c0 0c 00 00       	call   801553 <sys_ns_recv>
  800893:	85 c0                	test   %eax,%eax
  800895:	7e 28                	jle    8008bf <input+0x9f>
            if (n != 11) {
  800897:	83 f8 0b             	cmp    $0xb,%eax
  80089a:	74 1e                	je     8008ba <input+0x9a>
            pkt->jp_len = n;
  80089c:	89 03                	mov    %eax,(%ebx)
            ipc_send(ns_envid, NSREQ_INPUT, (void *)pkt, PTE_P|PTE_W|PTE_U);
  80089e:	c7 44 24 0c 07 00 00 	movl   $0x7,0xc(%esp)
  8008a5:	00 
  8008a6:	89 5c 24 08          	mov    %ebx,0x8(%esp)
  8008aa:	c7 44 24 04 0a 00 00 	movl   $0xa,0x4(%esp)
  8008b1:	00 
  8008b2:	89 34 24             	mov    %esi,(%esp)
  8008b5:	e8 f6 14 00 00       	call   801db0 <ipc_send>
            }
            sys_yield();
  8008ba:	e8 26 10 00 00       	call   8018e5 <sys_yield>
        } 
        sys_yield();
  8008bf:	e8 21 10 00 00       	call   8018e5 <sys_yield>
    }
  8008c4:	eb b9                	jmp    80087f <input+0x5f>
	...

008008c8 <output>:

extern union Nsipc nsipcbuf;

void
output(envid_t ns_envid)
{
  8008c8:	55                   	push   %ebp
  8008c9:	89 e5                	mov    %esp,%ebp
  8008cb:	53                   	push   %ebx
  8008cc:	83 ec 24             	sub    $0x24,%esp
    int r=0;
    envid_t from=0;
  8008cf:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
	binaryname = "ns_output";
  8008d6:	c7 05 00 90 81 00 25 	movl   $0x812725,0x819000
  8008dd:	27 81 00 

	// LAB 6: Your code here:
	// 	- read a packet from the network server
	//	- send the packet to the device driver
    while(1) {
        if((r=ipc_recv(&from, &nsipcbuf.pkt, NULL))==NSREQ_OUTPUT) {
  8008e0:	8d 5d f4             	lea    -0xc(%ebp),%ebx
  8008e3:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  8008ea:	00 
  8008eb:	c7 44 24 04 00 80 81 	movl   $0x818000,0x4(%esp)
  8008f2:	00 
  8008f3:	89 1c 24             	mov    %ebx,(%esp)
  8008f6:	e8 27 15 00 00       	call   801e22 <ipc_recv>
  8008fb:	83 f8 0b             	cmp    $0xb,%eax
  8008fe:	75 17                	jne    800917 <output+0x4f>
            //cprintf("\nBuffer: %s Len: %d From: %x nsid: %x", &nsipcbuf.pkt.jp_data, nsipcbuf.pkt.jp_len, from, ns_envid);
            //cprintf("\nSending to driver");
            r   = sys_ns_send(&nsipcbuf.pkt.jp_data, nsipcbuf.pkt.jp_len);
  800900:	a1 00 80 81 00       	mov    0x818000,%eax
  800905:	89 44 24 04          	mov    %eax,0x4(%esp)
  800909:	c7 04 24 04 80 81 00 	movl   $0x818004,(%esp)
  800910:	e8 74 0c 00 00       	call   801589 <sys_ns_send>
  800915:	eb cc                	jmp    8008e3 <output+0x1b>
        } else {
            cprintf("output: error %x\n", r);
  800917:	89 44 24 04          	mov    %eax,0x4(%esp)
  80091b:	c7 04 24 2f 27 81 00 	movl   $0x81272f,(%esp)
  800922:	e8 3a 01 00 00       	call   800a61 <cprintf>
            sys_yield();
  800927:	e8 b9 0f 00 00       	call   8018e5 <sys_yield>
  80092c:	eb b5                	jmp    8008e3 <output+0x1b>
	...

00800930 <libmain>:
volatile struct Env *env;
char *binaryname = "(PROGRAM NAME UNKNOWN)";

void
libmain(int argc, char **argv)
{
  800930:	55                   	push   %ebp
  800931:	89 e5                	mov    %esp,%ebp
  800933:	83 ec 18             	sub    $0x18,%esp
  800936:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  800939:	89 75 fc             	mov    %esi,-0x4(%ebp)
  80093c:	8b 75 08             	mov    0x8(%ebp),%esi
  80093f:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	// set env to point at our env structure in envs[].
	// LAB 3: Your code here.
  envid_t envid   = sys_getenvid();
  800942:	e8 d2 0f 00 00       	call   801919 <sys_getenvid>
	env = &envs [ENVX(envid)];
  800947:	25 ff 03 00 00       	and    $0x3ff,%eax
  80094c:	6b c0 7c             	imul   $0x7c,%eax,%eax
  80094f:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  800954:	a3 f4 f5 b3 00       	mov    %eax,0xb3f5f4

	// save the name of the program so that panic() can use it
	if (argc > 0)
  800959:	85 f6                	test   %esi,%esi
  80095b:	7e 07                	jle    800964 <libmain+0x34>
		binaryname = argv[0];
  80095d:	8b 03                	mov    (%ebx),%eax
  80095f:	a3 00 90 81 00       	mov    %eax,0x819000

	// call user main routine
	umain(argc, argv);
  800964:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  800968:	89 34 24             	mov    %esi,(%esp)
  80096b:	e8 e8 f6 ff ff       	call   800058 <umain>

	// exit gracefully
	exit();
  800970:	e8 0b 00 00 00       	call   800980 <exit>
}
  800975:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  800978:	8b 75 fc             	mov    -0x4(%ebp),%esi
  80097b:	89 ec                	mov    %ebp,%esp
  80097d:	5d                   	pop    %ebp
  80097e:	c3                   	ret    
	...

00800980 <exit>:

#include <inc/lib.h>

void
exit(void)
{
  800980:	55                   	push   %ebp
  800981:	89 e5                	mov    %esp,%ebp
  800983:	83 ec 18             	sub    $0x18,%esp
	close_all();
  800986:	e8 2e 1a 00 00       	call   8023b9 <close_all>
	sys_env_destroy(0);
  80098b:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  800992:	e8 b6 0f 00 00       	call   80194d <sys_env_destroy>
}
  800997:	c9                   	leave  
  800998:	c3                   	ret    
  800999:	00 00                	add    %al,(%eax)
	...

0080099c <_panic>:
 * It prints "panic: <message>", then causes a breakpoint exception,
 * which causes JOS to enter the JOS kernel monitor.
 */
void
_panic(const char *file, int line, const char *fmt,...)
{
  80099c:	55                   	push   %ebp
  80099d:	89 e5                	mov    %esp,%ebp
  80099f:	53                   	push   %ebx
  8009a0:	83 ec 14             	sub    $0x14,%esp
 * Panic is called on unresolvable fatal errors.
 * It prints "panic: <message>", then causes a breakpoint exception,
 * which causes JOS to enter the JOS kernel monitor.
 */
void
_panic(const char *file, int line, const char *fmt,...)
  8009a3:	8d 5d 14             	lea    0x14(%ebp),%ebx
	va_list ap;

	va_start(ap, fmt);

	// Print the panic message
	if (argv0)
  8009a6:	a1 f8 f5 b3 00       	mov    0xb3f5f8,%eax
  8009ab:	85 c0                	test   %eax,%eax
  8009ad:	74 10                	je     8009bf <_panic+0x23>
		cprintf("%s: ", argv0);
  8009af:	89 44 24 04          	mov    %eax,0x4(%esp)
  8009b3:	c7 04 24 58 27 81 00 	movl   $0x812758,(%esp)
  8009ba:	e8 a2 00 00 00       	call   800a61 <cprintf>
	cprintf("user panic in %s at %s:%d: ", binaryname, file, line);
  8009bf:	8b 45 0c             	mov    0xc(%ebp),%eax
  8009c2:	89 44 24 0c          	mov    %eax,0xc(%esp)
  8009c6:	8b 45 08             	mov    0x8(%ebp),%eax
  8009c9:	89 44 24 08          	mov    %eax,0x8(%esp)
  8009cd:	a1 00 90 81 00       	mov    0x819000,%eax
  8009d2:	89 44 24 04          	mov    %eax,0x4(%esp)
  8009d6:	c7 04 24 5d 27 81 00 	movl   $0x81275d,(%esp)
  8009dd:	e8 7f 00 00 00       	call   800a61 <cprintf>
	vcprintf(fmt, ap);
  8009e2:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  8009e6:	8b 45 10             	mov    0x10(%ebp),%eax
  8009e9:	89 04 24             	mov    %eax,(%esp)
  8009ec:	e8 0f 00 00 00       	call   800a00 <vcprintf>
	cprintf("\n");
  8009f1:	c7 04 24 27 25 81 00 	movl   $0x812527,(%esp)
  8009f8:	e8 64 00 00 00       	call   800a61 <cprintf>

	// Cause a breakpoint exception
	while (1)
		asm volatile("int3");
  8009fd:	cc                   	int3   
  8009fe:	eb fd                	jmp    8009fd <_panic+0x61>

00800a00 <vcprintf>:
	b->cnt++;
}

int
vcprintf(const char *fmt, va_list ap)
{
  800a00:	55                   	push   %ebp
  800a01:	89 e5                	mov    %esp,%ebp
  800a03:	81 ec 28 01 00 00    	sub    $0x128,%esp
	struct printbuf b;

	b.idx = 0;
  800a09:	c7 85 f0 fe ff ff 00 	movl   $0x0,-0x110(%ebp)
  800a10:	00 00 00 
	b.cnt = 0;
  800a13:	c7 85 f4 fe ff ff 00 	movl   $0x0,-0x10c(%ebp)
  800a1a:	00 00 00 
	vprintfmt((void*)putch, &b, fmt, ap);
  800a1d:	8b 45 0c             	mov    0xc(%ebp),%eax
  800a20:	89 44 24 0c          	mov    %eax,0xc(%esp)
  800a24:	8b 45 08             	mov    0x8(%ebp),%eax
  800a27:	89 44 24 08          	mov    %eax,0x8(%esp)
  800a2b:	8d 85 f0 fe ff ff    	lea    -0x110(%ebp),%eax
  800a31:	89 44 24 04          	mov    %eax,0x4(%esp)
  800a35:	c7 04 24 7b 0a 80 00 	movl   $0x800a7b,(%esp)
  800a3c:	e8 cc 01 00 00       	call   800c0d <vprintfmt>
	sys_cputs(b.buf, b.idx);
  800a41:	8b 85 f0 fe ff ff    	mov    -0x110(%ebp),%eax
  800a47:	89 44 24 04          	mov    %eax,0x4(%esp)
  800a4b:	8d 85 f8 fe ff ff    	lea    -0x108(%ebp),%eax
  800a51:	89 04 24             	mov    %eax,(%esp)
  800a54:	e8 c7 0a 00 00       	call   801520 <sys_cputs>

	return b.cnt;
}
  800a59:	8b 85 f4 fe ff ff    	mov    -0x10c(%ebp),%eax
  800a5f:	c9                   	leave  
  800a60:	c3                   	ret    

00800a61 <cprintf>:

int
cprintf(const char *fmt, ...)
{
  800a61:	55                   	push   %ebp
  800a62:	89 e5                	mov    %esp,%ebp
  800a64:	83 ec 18             	sub    $0x18,%esp

	return b.cnt;
}

int
cprintf(const char *fmt, ...)
  800a67:	8d 45 0c             	lea    0xc(%ebp),%eax
{
	va_list ap;
	int cnt;

	va_start(ap, fmt);
	cnt = vcprintf(fmt, ap);
  800a6a:	89 44 24 04          	mov    %eax,0x4(%esp)
  800a6e:	8b 45 08             	mov    0x8(%ebp),%eax
  800a71:	89 04 24             	mov    %eax,(%esp)
  800a74:	e8 87 ff ff ff       	call   800a00 <vcprintf>
	va_end(ap);

	return cnt;
}
  800a79:	c9                   	leave  
  800a7a:	c3                   	ret    

00800a7b <putch>:
};


static void
putch(int ch, struct printbuf *b)
{
  800a7b:	55                   	push   %ebp
  800a7c:	89 e5                	mov    %esp,%ebp
  800a7e:	53                   	push   %ebx
  800a7f:	83 ec 14             	sub    $0x14,%esp
  800a82:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	b->buf[b->idx++] = ch;
  800a85:	8b 03                	mov    (%ebx),%eax
  800a87:	8b 55 08             	mov    0x8(%ebp),%edx
  800a8a:	88 54 03 08          	mov    %dl,0x8(%ebx,%eax,1)
  800a8e:	83 c0 01             	add    $0x1,%eax
  800a91:	89 03                	mov    %eax,(%ebx)
	if (b->idx == 256-1) {
  800a93:	3d ff 00 00 00       	cmp    $0xff,%eax
  800a98:	75 19                	jne    800ab3 <putch+0x38>
		sys_cputs(b->buf, b->idx);
  800a9a:	c7 44 24 04 ff 00 00 	movl   $0xff,0x4(%esp)
  800aa1:	00 
  800aa2:	8d 43 08             	lea    0x8(%ebx),%eax
  800aa5:	89 04 24             	mov    %eax,(%esp)
  800aa8:	e8 73 0a 00 00       	call   801520 <sys_cputs>
		b->idx = 0;
  800aad:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
	}
	b->cnt++;
  800ab3:	83 43 04 01          	addl   $0x1,0x4(%ebx)
}
  800ab7:	83 c4 14             	add    $0x14,%esp
  800aba:	5b                   	pop    %ebx
  800abb:	5d                   	pop    %ebp
  800abc:	c3                   	ret    
  800abd:	00 00                	add    %al,(%eax)
	...

00800ac0 <printnum>:
 * using specified putch function and associated pointer putdat.
 */
static void
printnum(void (*putch)(int, void*), void *putdat,
	 unsigned long long num, unsigned base, int width, int padc)
{
  800ac0:	55                   	push   %ebp
  800ac1:	89 e5                	mov    %esp,%ebp
  800ac3:	57                   	push   %edi
  800ac4:	56                   	push   %esi
  800ac5:	53                   	push   %ebx
  800ac6:	83 ec 4c             	sub    $0x4c,%esp
  800ac9:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  800acc:	89 d6                	mov    %edx,%esi
  800ace:	8b 45 08             	mov    0x8(%ebp),%eax
  800ad1:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800ad4:	8b 55 0c             	mov    0xc(%ebp),%edx
  800ad7:	89 55 e0             	mov    %edx,-0x20(%ebp)
  800ada:	8b 45 10             	mov    0x10(%ebp),%eax
  800add:	8b 5d 14             	mov    0x14(%ebp),%ebx
  800ae0:	8b 7d 18             	mov    0x18(%ebp),%edi
	// first recursively print all preceding (more significant) digits
	if (num >= base) {
  800ae3:	89 45 dc             	mov    %eax,-0x24(%ebp)
  800ae6:	b9 00 00 00 00       	mov    $0x0,%ecx
  800aeb:	39 d1                	cmp    %edx,%ecx
  800aed:	72 15                	jb     800b04 <printnum+0x44>
  800aef:	77 07                	ja     800af8 <printnum+0x38>
  800af1:	8b 55 d8             	mov    -0x28(%ebp),%edx
  800af4:	39 d0                	cmp    %edx,%eax
  800af6:	76 0c                	jbe    800b04 <printnum+0x44>
		printnum(putch, putdat, num / base, base, width - 1, padc);
	} else {
		// print any needed pad characters before first digit
		while (--width > 0)
  800af8:	83 eb 01             	sub    $0x1,%ebx
  800afb:	85 db                	test   %ebx,%ebx
  800afd:	8d 76 00             	lea    0x0(%esi),%esi
  800b00:	7f 61                	jg     800b63 <printnum+0xa3>
  800b02:	eb 70                	jmp    800b74 <printnum+0xb4>
printnum(void (*putch)(int, void*), void *putdat,
	 unsigned long long num, unsigned base, int width, int padc)
{
	// first recursively print all preceding (more significant) digits
	if (num >= base) {
		printnum(putch, putdat, num / base, base, width - 1, padc);
  800b04:	89 7c 24 10          	mov    %edi,0x10(%esp)
  800b08:	83 eb 01             	sub    $0x1,%ebx
  800b0b:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  800b0f:	89 44 24 08          	mov    %eax,0x8(%esp)
  800b13:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  800b17:	8b 5c 24 0c          	mov    0xc(%esp),%ebx
  800b1b:	89 4d d0             	mov    %ecx,-0x30(%ebp)
  800b1e:	89 5d d4             	mov    %ebx,-0x2c(%ebp)
  800b21:	8b 5d dc             	mov    -0x24(%ebp),%ebx
  800b24:	89 5c 24 08          	mov    %ebx,0x8(%esp)
  800b28:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  800b2f:	00 
  800b30:	8b 45 d8             	mov    -0x28(%ebp),%eax
  800b33:	89 04 24             	mov    %eax,(%esp)
  800b36:	8b 55 e0             	mov    -0x20(%ebp),%edx
  800b39:	89 54 24 04          	mov    %edx,0x4(%esp)
  800b3d:	e8 de 16 01 00       	call   812220 <__udivdi3>
  800b42:	8b 4d d0             	mov    -0x30(%ebp),%ecx
  800b45:	8b 5d d4             	mov    -0x2c(%ebp),%ebx
  800b48:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  800b4c:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  800b50:	89 04 24             	mov    %eax,(%esp)
  800b53:	89 54 24 04          	mov    %edx,0x4(%esp)
  800b57:	89 f2                	mov    %esi,%edx
  800b59:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  800b5c:	e8 5f ff ff ff       	call   800ac0 <printnum>
  800b61:	eb 11                	jmp    800b74 <printnum+0xb4>
	} else {
		// print any needed pad characters before first digit
		while (--width > 0)
			putch(padc, putdat);
  800b63:	89 74 24 04          	mov    %esi,0x4(%esp)
  800b67:	89 3c 24             	mov    %edi,(%esp)
  800b6a:	ff 55 e4             	call   *-0x1c(%ebp)
	// first recursively print all preceding (more significant) digits
	if (num >= base) {
		printnum(putch, putdat, num / base, base, width - 1, padc);
	} else {
		// print any needed pad characters before first digit
		while (--width > 0)
  800b6d:	83 eb 01             	sub    $0x1,%ebx
  800b70:	85 db                	test   %ebx,%ebx
  800b72:	7f ef                	jg     800b63 <printnum+0xa3>
			putch(padc, putdat);
	}

	// then print this (the least significant) digit
	putch("0123456789abcdef"[num % base], putdat);
  800b74:	89 74 24 04          	mov    %esi,0x4(%esp)
  800b78:	8b 74 24 04          	mov    0x4(%esp),%esi
  800b7c:	8b 45 dc             	mov    -0x24(%ebp),%eax
  800b7f:	89 44 24 08          	mov    %eax,0x8(%esp)
  800b83:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  800b8a:	00 
  800b8b:	8b 55 d8             	mov    -0x28(%ebp),%edx
  800b8e:	89 14 24             	mov    %edx,(%esp)
  800b91:	8b 4d e0             	mov    -0x20(%ebp),%ecx
  800b94:	89 4c 24 04          	mov    %ecx,0x4(%esp)
  800b98:	e8 b3 17 01 00       	call   812350 <__umoddi3>
  800b9d:	89 74 24 04          	mov    %esi,0x4(%esp)
  800ba1:	0f be 80 79 27 81 00 	movsbl 0x812779(%eax),%eax
  800ba8:	89 04 24             	mov    %eax,(%esp)
  800bab:	ff 55 e4             	call   *-0x1c(%ebp)
}
  800bae:	83 c4 4c             	add    $0x4c,%esp
  800bb1:	5b                   	pop    %ebx
  800bb2:	5e                   	pop    %esi
  800bb3:	5f                   	pop    %edi
  800bb4:	5d                   	pop    %ebp
  800bb5:	c3                   	ret    

00800bb6 <getuint>:

// Get an unsigned int of various possible sizes from a varargs list,
// depending on the lflag parameter.
static unsigned long long
getuint(va_list *ap, int lflag)
{
  800bb6:	55                   	push   %ebp
  800bb7:	89 e5                	mov    %esp,%ebp
	if (lflag >= 2)
  800bb9:	83 fa 01             	cmp    $0x1,%edx
  800bbc:	7e 0e                	jle    800bcc <getuint+0x16>
		return va_arg(*ap, unsigned long long);
  800bbe:	8b 10                	mov    (%eax),%edx
  800bc0:	8d 4a 08             	lea    0x8(%edx),%ecx
  800bc3:	89 08                	mov    %ecx,(%eax)
  800bc5:	8b 02                	mov    (%edx),%eax
  800bc7:	8b 52 04             	mov    0x4(%edx),%edx
  800bca:	eb 22                	jmp    800bee <getuint+0x38>
	else if (lflag)
  800bcc:	85 d2                	test   %edx,%edx
  800bce:	74 10                	je     800be0 <getuint+0x2a>
		return va_arg(*ap, unsigned long);
  800bd0:	8b 10                	mov    (%eax),%edx
  800bd2:	8d 4a 04             	lea    0x4(%edx),%ecx
  800bd5:	89 08                	mov    %ecx,(%eax)
  800bd7:	8b 02                	mov    (%edx),%eax
  800bd9:	ba 00 00 00 00       	mov    $0x0,%edx
  800bde:	eb 0e                	jmp    800bee <getuint+0x38>
	else
		return va_arg(*ap, unsigned int);
  800be0:	8b 10                	mov    (%eax),%edx
  800be2:	8d 4a 04             	lea    0x4(%edx),%ecx
  800be5:	89 08                	mov    %ecx,(%eax)
  800be7:	8b 02                	mov    (%edx),%eax
  800be9:	ba 00 00 00 00       	mov    $0x0,%edx
}
  800bee:	5d                   	pop    %ebp
  800bef:	c3                   	ret    

00800bf0 <sprintputch>:
	int cnt;
};

static void
sprintputch(int ch, struct sprintbuf *b)
{
  800bf0:	55                   	push   %ebp
  800bf1:	89 e5                	mov    %esp,%ebp
  800bf3:	8b 45 0c             	mov    0xc(%ebp),%eax
	b->cnt++;
  800bf6:	83 40 08 01          	addl   $0x1,0x8(%eax)
	if (b->buf < b->ebuf)
  800bfa:	8b 10                	mov    (%eax),%edx
  800bfc:	3b 50 04             	cmp    0x4(%eax),%edx
  800bff:	73 0a                	jae    800c0b <sprintputch+0x1b>
		*b->buf++ = ch;
  800c01:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800c04:	88 0a                	mov    %cl,(%edx)
  800c06:	83 c2 01             	add    $0x1,%edx
  800c09:	89 10                	mov    %edx,(%eax)
}
  800c0b:	5d                   	pop    %ebp
  800c0c:	c3                   	ret    

00800c0d <vprintfmt>:
// Main function to format and print a string.
void printfmt(void (*putch)(int, void*), void *putdat, const char *fmt, ...);

void
vprintfmt(void (*putch)(int, void*), void *putdat, const char *fmt, va_list ap)
{
  800c0d:	55                   	push   %ebp
  800c0e:	89 e5                	mov    %esp,%ebp
  800c10:	57                   	push   %edi
  800c11:	56                   	push   %esi
  800c12:	53                   	push   %ebx
  800c13:	83 ec 5c             	sub    $0x5c,%esp
  800c16:	8b 7d 08             	mov    0x8(%ebp),%edi
  800c19:	8b 75 0c             	mov    0xc(%ebp),%esi
  800c1c:	8b 5d 10             	mov    0x10(%ebp),%ebx
		case '#':
			altflag = 1;
			goto reswitch;

		process_precision:
			if (width < 0)
  800c1f:	c7 45 c8 ff ff ff ff 	movl   $0xffffffff,-0x38(%ebp)
  800c26:	eb 11                	jmp    800c39 <vprintfmt+0x2c>
	int base, lflag, width, precision, altflag;
	char padc;

	while (1) {
		while ((ch = *(unsigned char *) fmt++) != '%') {
			if (ch == '\0')
  800c28:	85 c0                	test   %eax,%eax
  800c2a:	0f 84 f9 03 00 00    	je     801029 <vprintfmt+0x41c>
				return;
			putch(ch, putdat);
  800c30:	89 74 24 04          	mov    %esi,0x4(%esp)
  800c34:	89 04 24             	mov    %eax,(%esp)
  800c37:	ff d7                	call   *%edi
	unsigned long long num;
	int base, lflag, width, precision, altflag;
	char padc;

	while (1) {
		while ((ch = *(unsigned char *) fmt++) != '%') {
  800c39:	0f b6 03             	movzbl (%ebx),%eax
  800c3c:	83 c3 01             	add    $0x1,%ebx
  800c3f:	83 f8 25             	cmp    $0x25,%eax
  800c42:	75 e4                	jne    800c28 <vprintfmt+0x1b>
  800c44:	c6 45 d4 20          	movb   $0x20,-0x2c(%ebp)
  800c48:	c7 45 d8 00 00 00 00 	movl   $0x0,-0x28(%ebp)
  800c4f:	c7 45 d0 ff ff ff ff 	movl   $0xffffffff,-0x30(%ebp)
  800c56:	c7 45 e4 ff ff ff ff 	movl   $0xffffffff,-0x1c(%ebp)
  800c5d:	b9 00 00 00 00       	mov    $0x0,%ecx
  800c62:	eb 06                	jmp    800c6a <vprintfmt+0x5d>
  800c64:	c6 45 d4 2d          	movb   $0x2d,-0x2c(%ebp)
  800c68:	89 c3                	mov    %eax,%ebx
		width = -1;
		precision = -1;
		lflag = 0;
		altflag = 0;
	reswitch:
		switch (ch = *(unsigned char *) fmt++) {
  800c6a:	0f b6 13             	movzbl (%ebx),%edx
  800c6d:	0f b6 c2             	movzbl %dl,%eax
  800c70:	89 45 e0             	mov    %eax,-0x20(%ebp)
  800c73:	8d 43 01             	lea    0x1(%ebx),%eax
  800c76:	83 ea 23             	sub    $0x23,%edx
  800c79:	80 fa 55             	cmp    $0x55,%dl
  800c7c:	0f 87 8a 03 00 00    	ja     80100c <vprintfmt+0x3ff>
  800c82:	0f b6 d2             	movzbl %dl,%edx
  800c85:	ff 24 95 c0 28 81 00 	jmp    *0x8128c0(,%edx,4)
  800c8c:	c6 45 d4 30          	movb   $0x30,-0x2c(%ebp)
  800c90:	eb d6                	jmp    800c68 <vprintfmt+0x5b>
		case '6':
		case '7':
		case '8':
		case '9':
			for (precision = 0; ; ++fmt) {
				precision = precision * 10 + ch - '0';
  800c92:	8b 55 e0             	mov    -0x20(%ebp),%edx
  800c95:	83 ea 30             	sub    $0x30,%edx
  800c98:	89 55 d0             	mov    %edx,-0x30(%ebp)
				ch = *fmt;
  800c9b:	0f be 10             	movsbl (%eax),%edx
				if (ch < '0' || ch > '9')
  800c9e:	8d 5a d0             	lea    -0x30(%edx),%ebx
  800ca1:	83 fb 09             	cmp    $0x9,%ebx
  800ca4:	77 54                	ja     800cfa <vprintfmt+0xed>
  800ca6:	89 4d e0             	mov    %ecx,-0x20(%ebp)
  800ca9:	8b 4d d0             	mov    -0x30(%ebp),%ecx
		case '5':
		case '6':
		case '7':
		case '8':
		case '9':
			for (precision = 0; ; ++fmt) {
  800cac:	83 c0 01             	add    $0x1,%eax
				precision = precision * 10 + ch - '0';
  800caf:	8d 0c 89             	lea    (%ecx,%ecx,4),%ecx
  800cb2:	8d 4c 4a d0          	lea    -0x30(%edx,%ecx,2),%ecx
				ch = *fmt;
  800cb6:	0f be 10             	movsbl (%eax),%edx
				if (ch < '0' || ch > '9')
  800cb9:	8d 5a d0             	lea    -0x30(%edx),%ebx
  800cbc:	83 fb 09             	cmp    $0x9,%ebx
  800cbf:	76 eb                	jbe    800cac <vprintfmt+0x9f>
  800cc1:	89 4d d0             	mov    %ecx,-0x30(%ebp)
  800cc4:	8b 4d e0             	mov    -0x20(%ebp),%ecx
  800cc7:	eb 31                	jmp    800cfa <vprintfmt+0xed>
					break;
			}
			goto process_precision;

		case '*':
			precision = va_arg(ap, int);
  800cc9:	8b 55 14             	mov    0x14(%ebp),%edx
  800ccc:	8d 5a 04             	lea    0x4(%edx),%ebx
  800ccf:	89 5d 14             	mov    %ebx,0x14(%ebp)
  800cd2:	8b 12                	mov    (%edx),%edx
  800cd4:	89 55 d0             	mov    %edx,-0x30(%ebp)
			goto process_precision;
  800cd7:	eb 21                	jmp    800cfa <vprintfmt+0xed>

		case '.':
			if (width < 0)
  800cd9:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  800cdd:	ba 00 00 00 00       	mov    $0x0,%edx
  800ce2:	0f 49 55 e4          	cmovns -0x1c(%ebp),%edx
  800ce6:	89 55 e4             	mov    %edx,-0x1c(%ebp)
  800ce9:	e9 7a ff ff ff       	jmp    800c68 <vprintfmt+0x5b>
  800cee:	c7 45 d8 01 00 00 00 	movl   $0x1,-0x28(%ebp)
				width = 0;
			goto reswitch;

		case '#':
			altflag = 1;
			goto reswitch;
  800cf5:	e9 6e ff ff ff       	jmp    800c68 <vprintfmt+0x5b>

		process_precision:
			if (width < 0)
  800cfa:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  800cfe:	0f 89 64 ff ff ff    	jns    800c68 <vprintfmt+0x5b>
  800d04:	8b 55 d0             	mov    -0x30(%ebp),%edx
  800d07:	89 55 e4             	mov    %edx,-0x1c(%ebp)
  800d0a:	8b 55 c8             	mov    -0x38(%ebp),%edx
  800d0d:	89 55 d0             	mov    %edx,-0x30(%ebp)
  800d10:	e9 53 ff ff ff       	jmp    800c68 <vprintfmt+0x5b>
				width = precision, precision = -1;
			goto reswitch;

		// long flag (doubled for long long)
		case 'l':
			lflag++;
  800d15:	83 c1 01             	add    $0x1,%ecx
			goto reswitch;
  800d18:	e9 4b ff ff ff       	jmp    800c68 <vprintfmt+0x5b>
  800d1d:	89 45 cc             	mov    %eax,-0x34(%ebp)

		// character
		case 'c':
			putch(va_arg(ap, int), putdat);
  800d20:	8b 45 14             	mov    0x14(%ebp),%eax
  800d23:	8d 50 04             	lea    0x4(%eax),%edx
  800d26:	89 55 14             	mov    %edx,0x14(%ebp)
  800d29:	89 74 24 04          	mov    %esi,0x4(%esp)
  800d2d:	8b 00                	mov    (%eax),%eax
  800d2f:	89 04 24             	mov    %eax,(%esp)
  800d32:	ff d7                	call   *%edi
  800d34:	8b 5d cc             	mov    -0x34(%ebp),%ebx
			break;
  800d37:	e9 fd fe ff ff       	jmp    800c39 <vprintfmt+0x2c>
  800d3c:	89 45 cc             	mov    %eax,-0x34(%ebp)

		// error message
		case 'e':
			err = va_arg(ap, int);
  800d3f:	8b 45 14             	mov    0x14(%ebp),%eax
  800d42:	8d 50 04             	lea    0x4(%eax),%edx
  800d45:	89 55 14             	mov    %edx,0x14(%ebp)
  800d48:	8b 00                	mov    (%eax),%eax
  800d4a:	89 c2                	mov    %eax,%edx
  800d4c:	c1 fa 1f             	sar    $0x1f,%edx
  800d4f:	31 d0                	xor    %edx,%eax
  800d51:	29 d0                	sub    %edx,%eax
			if (err < 0)
				err = -err;
			if (err > MAXERROR || (p = error_string[err]) == NULL)
  800d53:	83 f8 12             	cmp    $0x12,%eax
  800d56:	7f 0b                	jg     800d63 <vprintfmt+0x156>
  800d58:	8b 14 85 20 2a 81 00 	mov    0x812a20(,%eax,4),%edx
  800d5f:	85 d2                	test   %edx,%edx
  800d61:	75 20                	jne    800d83 <vprintfmt+0x176>
				printfmt(putch, putdat, "error %d", err);
  800d63:	89 44 24 0c          	mov    %eax,0xc(%esp)
  800d67:	c7 44 24 08 8a 27 81 	movl   $0x81278a,0x8(%esp)
  800d6e:	00 
  800d6f:	89 74 24 04          	mov    %esi,0x4(%esp)
  800d73:	89 3c 24             	mov    %edi,(%esp)
  800d76:	e8 36 03 00 00       	call   8010b1 <printfmt>
  800d7b:	8b 5d cc             	mov    -0x34(%ebp),%ebx
		// error message
		case 'e':
			err = va_arg(ap, int);
			if (err < 0)
				err = -err;
			if (err > MAXERROR || (p = error_string[err]) == NULL)
  800d7e:	e9 b6 fe ff ff       	jmp    800c39 <vprintfmt+0x2c>
				printfmt(putch, putdat, "error %d", err);
			else
				printfmt(putch, putdat, "%s", p);
  800d83:	89 54 24 0c          	mov    %edx,0xc(%esp)
  800d87:	c7 44 24 08 62 2d 81 	movl   $0x812d62,0x8(%esp)
  800d8e:	00 
  800d8f:	89 74 24 04          	mov    %esi,0x4(%esp)
  800d93:	89 3c 24             	mov    %edi,(%esp)
  800d96:	e8 16 03 00 00       	call   8010b1 <printfmt>
  800d9b:	8b 5d cc             	mov    -0x34(%ebp),%ebx
  800d9e:	e9 96 fe ff ff       	jmp    800c39 <vprintfmt+0x2c>
  800da3:	89 45 cc             	mov    %eax,-0x34(%ebp)
  800da6:	89 c3                	mov    %eax,%ebx
  800da8:	8b 4d d0             	mov    -0x30(%ebp),%ecx
  800dab:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  800dae:	89 45 c4             	mov    %eax,-0x3c(%ebp)
			break;

		// string
		case 's':
			if ((p = va_arg(ap, char *)) == NULL)
  800db1:	8b 45 14             	mov    0x14(%ebp),%eax
  800db4:	8d 50 04             	lea    0x4(%eax),%edx
  800db7:	89 55 14             	mov    %edx,0x14(%ebp)
  800dba:	8b 00                	mov    (%eax),%eax
  800dbc:	89 45 e0             	mov    %eax,-0x20(%ebp)
  800dbf:	85 c0                	test   %eax,%eax
  800dc1:	b8 93 27 81 00       	mov    $0x812793,%eax
  800dc6:	0f 45 45 e0          	cmovne -0x20(%ebp),%eax
  800dca:	89 45 e0             	mov    %eax,-0x20(%ebp)
				p = "(null)";
			if (width > 0 && padc != '-')
  800dcd:	83 7d c4 00          	cmpl   $0x0,-0x3c(%ebp)
  800dd1:	7e 06                	jle    800dd9 <vprintfmt+0x1cc>
  800dd3:	80 7d d4 2d          	cmpb   $0x2d,-0x2c(%ebp)
  800dd7:	75 13                	jne    800dec <vprintfmt+0x1df>
				for (width -= strnlen(p, precision); width > 0; width--)
					putch(padc, putdat);
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
  800dd9:	8b 55 e0             	mov    -0x20(%ebp),%edx
  800ddc:	0f be 02             	movsbl (%edx),%eax
  800ddf:	85 c0                	test   %eax,%eax
  800de1:	0f 85 9b 00 00 00    	jne    800e82 <vprintfmt+0x275>
  800de7:	e9 88 00 00 00       	jmp    800e74 <vprintfmt+0x267>
		// string
		case 's':
			if ((p = va_arg(ap, char *)) == NULL)
				p = "(null)";
			if (width > 0 && padc != '-')
				for (width -= strnlen(p, precision); width > 0; width--)
  800dec:	89 4c 24 04          	mov    %ecx,0x4(%esp)
  800df0:	8b 4d e0             	mov    -0x20(%ebp),%ecx
  800df3:	89 0c 24             	mov    %ecx,(%esp)
  800df6:	e8 00 03 00 00       	call   8010fb <strnlen>
  800dfb:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  800dfe:	29 c2                	sub    %eax,%edx
  800e00:	89 55 e4             	mov    %edx,-0x1c(%ebp)
  800e03:	85 d2                	test   %edx,%edx
  800e05:	7e d2                	jle    800dd9 <vprintfmt+0x1cc>
					putch(padc, putdat);
  800e07:	0f be 4d d4          	movsbl -0x2c(%ebp),%ecx
  800e0b:	89 4d d4             	mov    %ecx,-0x2c(%ebp)
  800e0e:	89 5d c4             	mov    %ebx,-0x3c(%ebp)
  800e11:	89 d3                	mov    %edx,%ebx
  800e13:	89 74 24 04          	mov    %esi,0x4(%esp)
  800e17:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  800e1a:	89 04 24             	mov    %eax,(%esp)
  800e1d:	ff d7                	call   *%edi
		// string
		case 's':
			if ((p = va_arg(ap, char *)) == NULL)
				p = "(null)";
			if (width > 0 && padc != '-')
				for (width -= strnlen(p, precision); width > 0; width--)
  800e1f:	83 eb 01             	sub    $0x1,%ebx
  800e22:	85 db                	test   %ebx,%ebx
  800e24:	7f ed                	jg     800e13 <vprintfmt+0x206>
  800e26:	8b 5d c4             	mov    -0x3c(%ebp),%ebx
  800e29:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  800e30:	eb a7                	jmp    800dd9 <vprintfmt+0x1cc>
					putch(padc, putdat);
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
				if (altflag && (ch < ' ' || ch > '~'))
  800e32:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  800e36:	74 1a                	je     800e52 <vprintfmt+0x245>
  800e38:	8d 50 e0             	lea    -0x20(%eax),%edx
  800e3b:	83 fa 5e             	cmp    $0x5e,%edx
  800e3e:	76 12                	jbe    800e52 <vprintfmt+0x245>
					putch('?', putdat);
  800e40:	89 7c 24 04          	mov    %edi,0x4(%esp)
  800e44:	c7 04 24 3f 00 00 00 	movl   $0x3f,(%esp)
  800e4b:	ff 55 e0             	call   *-0x20(%ebp)
				p = "(null)";
			if (width > 0 && padc != '-')
				for (width -= strnlen(p, precision); width > 0; width--)
					putch(padc, putdat);
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
				if (altflag && (ch < ' ' || ch > '~'))
  800e4e:	66 90                	xchg   %ax,%ax
  800e50:	eb 0a                	jmp    800e5c <vprintfmt+0x24f>
					putch('?', putdat);
				else
					putch(ch, putdat);
  800e52:	89 7c 24 04          	mov    %edi,0x4(%esp)
  800e56:	89 04 24             	mov    %eax,(%esp)
  800e59:	ff 55 e0             	call   *-0x20(%ebp)
			if ((p = va_arg(ap, char *)) == NULL)
				p = "(null)";
			if (width > 0 && padc != '-')
				for (width -= strnlen(p, precision); width > 0; width--)
					putch(padc, putdat);
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
  800e5c:	83 6d e4 01          	subl   $0x1,-0x1c(%ebp)
  800e60:	0f be 03             	movsbl (%ebx),%eax
  800e63:	85 c0                	test   %eax,%eax
  800e65:	74 05                	je     800e6c <vprintfmt+0x25f>
  800e67:	83 c3 01             	add    $0x1,%ebx
  800e6a:	eb 29                	jmp    800e95 <vprintfmt+0x288>
  800e6c:	89 fe                	mov    %edi,%esi
  800e6e:	8b 7d e0             	mov    -0x20(%ebp),%edi
  800e71:	8b 5d d0             	mov    -0x30(%ebp),%ebx
				if (altflag && (ch < ' ' || ch > '~'))
					putch('?', putdat);
				else
					putch(ch, putdat);
			for (; width > 0; width--)
  800e74:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  800e78:	7f 2e                	jg     800ea8 <vprintfmt+0x29b>
  800e7a:	8b 5d cc             	mov    -0x34(%ebp),%ebx
  800e7d:	e9 b7 fd ff ff       	jmp    800c39 <vprintfmt+0x2c>
			if ((p = va_arg(ap, char *)) == NULL)
				p = "(null)";
			if (width > 0 && padc != '-')
				for (width -= strnlen(p, precision); width > 0; width--)
					putch(padc, putdat);
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
  800e82:	8b 55 e0             	mov    -0x20(%ebp),%edx
  800e85:	83 c2 01             	add    $0x1,%edx
  800e88:	89 7d e0             	mov    %edi,-0x20(%ebp)
  800e8b:	89 f7                	mov    %esi,%edi
  800e8d:	8b 75 d0             	mov    -0x30(%ebp),%esi
  800e90:	89 5d d0             	mov    %ebx,-0x30(%ebp)
  800e93:	89 d3                	mov    %edx,%ebx
  800e95:	85 f6                	test   %esi,%esi
  800e97:	78 99                	js     800e32 <vprintfmt+0x225>
  800e99:	83 ee 01             	sub    $0x1,%esi
  800e9c:	79 94                	jns    800e32 <vprintfmt+0x225>
  800e9e:	89 fe                	mov    %edi,%esi
  800ea0:	8b 7d e0             	mov    -0x20(%ebp),%edi
  800ea3:	8b 5d d0             	mov    -0x30(%ebp),%ebx
  800ea6:	eb cc                	jmp    800e74 <vprintfmt+0x267>
  800ea8:	89 5d d8             	mov    %ebx,-0x28(%ebp)
  800eab:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
				if (altflag && (ch < ' ' || ch > '~'))
					putch('?', putdat);
				else
					putch(ch, putdat);
			for (; width > 0; width--)
				putch(' ', putdat);
  800eae:	89 74 24 04          	mov    %esi,0x4(%esp)
  800eb2:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
  800eb9:	ff d7                	call   *%edi
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
				if (altflag && (ch < ' ' || ch > '~'))
					putch('?', putdat);
				else
					putch(ch, putdat);
			for (; width > 0; width--)
  800ebb:	83 eb 01             	sub    $0x1,%ebx
  800ebe:	85 db                	test   %ebx,%ebx
  800ec0:	7f ec                	jg     800eae <vprintfmt+0x2a1>
  800ec2:	8b 5d d8             	mov    -0x28(%ebp),%ebx
  800ec5:	e9 6f fd ff ff       	jmp    800c39 <vprintfmt+0x2c>
  800eca:	89 45 cc             	mov    %eax,-0x34(%ebp)
// Same as getuint but signed - can't use getuint
// because of sign extension
static long long
getint(va_list *ap, int lflag)
{
	if (lflag >= 2)
  800ecd:	83 f9 01             	cmp    $0x1,%ecx
  800ed0:	7e 16                	jle    800ee8 <vprintfmt+0x2db>
		return va_arg(*ap, long long);
  800ed2:	8b 45 14             	mov    0x14(%ebp),%eax
  800ed5:	8d 50 08             	lea    0x8(%eax),%edx
  800ed8:	89 55 14             	mov    %edx,0x14(%ebp)
  800edb:	8b 10                	mov    (%eax),%edx
  800edd:	8b 48 04             	mov    0x4(%eax),%ecx
  800ee0:	89 55 d8             	mov    %edx,-0x28(%ebp)
  800ee3:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  800ee6:	eb 32                	jmp    800f1a <vprintfmt+0x30d>
	else if (lflag)
  800ee8:	85 c9                	test   %ecx,%ecx
  800eea:	74 18                	je     800f04 <vprintfmt+0x2f7>
		return va_arg(*ap, long);
  800eec:	8b 45 14             	mov    0x14(%ebp),%eax
  800eef:	8d 50 04             	lea    0x4(%eax),%edx
  800ef2:	89 55 14             	mov    %edx,0x14(%ebp)
  800ef5:	8b 00                	mov    (%eax),%eax
  800ef7:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800efa:	89 c1                	mov    %eax,%ecx
  800efc:	c1 f9 1f             	sar    $0x1f,%ecx
  800eff:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  800f02:	eb 16                	jmp    800f1a <vprintfmt+0x30d>
	else
		return va_arg(*ap, int);
  800f04:	8b 45 14             	mov    0x14(%ebp),%eax
  800f07:	8d 50 04             	lea    0x4(%eax),%edx
  800f0a:	89 55 14             	mov    %edx,0x14(%ebp)
  800f0d:	8b 00                	mov    (%eax),%eax
  800f0f:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800f12:	89 c2                	mov    %eax,%edx
  800f14:	c1 fa 1f             	sar    $0x1f,%edx
  800f17:	89 55 dc             	mov    %edx,-0x24(%ebp)
				putch(' ', putdat);
			break;

		// (signed) decimal
		case 'd':
			num = getint(&ap, lflag);
  800f1a:	8b 4d d8             	mov    -0x28(%ebp),%ecx
  800f1d:	8b 5d dc             	mov    -0x24(%ebp),%ebx
  800f20:	b8 0a 00 00 00       	mov    $0xa,%eax
			if ((long long) num < 0) {
  800f25:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
  800f29:	0f 89 9b 00 00 00    	jns    800fca <vprintfmt+0x3bd>
				putch('-', putdat);
  800f2f:	89 74 24 04          	mov    %esi,0x4(%esp)
  800f33:	c7 04 24 2d 00 00 00 	movl   $0x2d,(%esp)
  800f3a:	ff d7                	call   *%edi
				num = -(long long) num;
  800f3c:	8b 4d d8             	mov    -0x28(%ebp),%ecx
  800f3f:	8b 5d dc             	mov    -0x24(%ebp),%ebx
  800f42:	f7 d9                	neg    %ecx
  800f44:	83 d3 00             	adc    $0x0,%ebx
  800f47:	f7 db                	neg    %ebx
  800f49:	b8 0a 00 00 00       	mov    $0xa,%eax
  800f4e:	eb 7a                	jmp    800fca <vprintfmt+0x3bd>
  800f50:	89 45 cc             	mov    %eax,-0x34(%ebp)
			base = 10;
			goto number;

		// unsigned decimal
		case 'u':
			num = getuint(&ap, lflag);
  800f53:	89 ca                	mov    %ecx,%edx
  800f55:	8d 45 14             	lea    0x14(%ebp),%eax
  800f58:	e8 59 fc ff ff       	call   800bb6 <getuint>
  800f5d:	89 c1                	mov    %eax,%ecx
  800f5f:	89 d3                	mov    %edx,%ebx
  800f61:	b8 0a 00 00 00       	mov    $0xa,%eax
			base = 10;
			goto number;
  800f66:	eb 62                	jmp    800fca <vprintfmt+0x3bd>
  800f68:	89 45 cc             	mov    %eax,-0x34(%ebp)

		// (unsigned) octal
		case 'o':
			num = getuint(&ap, lflag);
  800f6b:	89 ca                	mov    %ecx,%edx
  800f6d:	8d 45 14             	lea    0x14(%ebp),%eax
  800f70:	e8 41 fc ff ff       	call   800bb6 <getuint>
  800f75:	89 c1                	mov    %eax,%ecx
  800f77:	89 d3                	mov    %edx,%ebx
  800f79:	b8 08 00 00 00       	mov    $0x8,%eax
			base = 8;
			goto number;
  800f7e:	eb 4a                	jmp    800fca <vprintfmt+0x3bd>
  800f80:	89 45 cc             	mov    %eax,-0x34(%ebp)
			break;
			**/

		// pointer
		case 'p':
			putch('0', putdat);
  800f83:	89 74 24 04          	mov    %esi,0x4(%esp)
  800f87:	c7 04 24 30 00 00 00 	movl   $0x30,(%esp)
  800f8e:	ff d7                	call   *%edi
			putch('x', putdat);
  800f90:	89 74 24 04          	mov    %esi,0x4(%esp)
  800f94:	c7 04 24 78 00 00 00 	movl   $0x78,(%esp)
  800f9b:	ff d7                	call   *%edi
			num = (unsigned long long)
  800f9d:	8b 45 14             	mov    0x14(%ebp),%eax
  800fa0:	8d 50 04             	lea    0x4(%eax),%edx
  800fa3:	89 55 14             	mov    %edx,0x14(%ebp)
  800fa6:	8b 08                	mov    (%eax),%ecx
  800fa8:	bb 00 00 00 00       	mov    $0x0,%ebx
  800fad:	b8 10 00 00 00       	mov    $0x10,%eax
				(uintptr_t) va_arg(ap, void *);
			base = 16;
			goto number;
  800fb2:	eb 16                	jmp    800fca <vprintfmt+0x3bd>
  800fb4:	89 45 cc             	mov    %eax,-0x34(%ebp)

		// (unsigned) hexadecimal
		case 'x':
			num = getuint(&ap, lflag);
  800fb7:	89 ca                	mov    %ecx,%edx
  800fb9:	8d 45 14             	lea    0x14(%ebp),%eax
  800fbc:	e8 f5 fb ff ff       	call   800bb6 <getuint>
  800fc1:	89 c1                	mov    %eax,%ecx
  800fc3:	89 d3                	mov    %edx,%ebx
  800fc5:	b8 10 00 00 00       	mov    $0x10,%eax
			base = 16;
		number:
			printnum(putch, putdat, num, base, width, padc);
  800fca:	0f be 55 d4          	movsbl -0x2c(%ebp),%edx
  800fce:	89 54 24 10          	mov    %edx,0x10(%esp)
  800fd2:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  800fd5:	89 54 24 0c          	mov    %edx,0xc(%esp)
  800fd9:	89 44 24 08          	mov    %eax,0x8(%esp)
  800fdd:	89 0c 24             	mov    %ecx,(%esp)
  800fe0:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  800fe4:	89 f2                	mov    %esi,%edx
  800fe6:	89 f8                	mov    %edi,%eax
  800fe8:	e8 d3 fa ff ff       	call   800ac0 <printnum>
  800fed:	8b 5d cc             	mov    -0x34(%ebp),%ebx
			break;
  800ff0:	e9 44 fc ff ff       	jmp    800c39 <vprintfmt+0x2c>
  800ff5:	89 45 cc             	mov    %eax,-0x34(%ebp)
  800ff8:	8b 55 e0             	mov    -0x20(%ebp),%edx

		// escaped '%' character
		case '%':
			putch(ch, putdat);
  800ffb:	89 74 24 04          	mov    %esi,0x4(%esp)
  800fff:	89 14 24             	mov    %edx,(%esp)
  801002:	ff d7                	call   *%edi
  801004:	8b 5d cc             	mov    -0x34(%ebp),%ebx
			break;
  801007:	e9 2d fc ff ff       	jmp    800c39 <vprintfmt+0x2c>
			
		// unrecognized escape sequence - just print it literally
		default:
			putch('%', putdat);
  80100c:	89 74 24 04          	mov    %esi,0x4(%esp)
  801010:	c7 04 24 25 00 00 00 	movl   $0x25,(%esp)
  801017:	ff d7                	call   *%edi
			for (fmt--; fmt[-1] != '%'; fmt--)
  801019:	8d 43 ff             	lea    -0x1(%ebx),%eax
  80101c:	80 38 25             	cmpb   $0x25,(%eax)
  80101f:	0f 84 14 fc ff ff    	je     800c39 <vprintfmt+0x2c>
  801025:	89 c3                	mov    %eax,%ebx
  801027:	eb f0                	jmp    801019 <vprintfmt+0x40c>
				/* do nothing */;
			break;
		}
	}
}
  801029:	83 c4 5c             	add    $0x5c,%esp
  80102c:	5b                   	pop    %ebx
  80102d:	5e                   	pop    %esi
  80102e:	5f                   	pop    %edi
  80102f:	5d                   	pop    %ebp
  801030:	c3                   	ret    

00801031 <vsnprintf>:
		*b->buf++ = ch;
}

int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
  801031:	55                   	push   %ebp
  801032:	89 e5                	mov    %esp,%ebp
  801034:	83 ec 28             	sub    $0x28,%esp
  801037:	8b 45 08             	mov    0x8(%ebp),%eax
  80103a:	8b 55 0c             	mov    0xc(%ebp),%edx
	struct sprintbuf b = {buf, buf+n-1, 0};

	if (buf == NULL || n < 1)
  80103d:	85 c0                	test   %eax,%eax
  80103f:	74 04                	je     801045 <vsnprintf+0x14>
  801041:	85 d2                	test   %edx,%edx
  801043:	7f 07                	jg     80104c <vsnprintf+0x1b>
  801045:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  80104a:	eb 3b                	jmp    801087 <vsnprintf+0x56>
}

int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
	struct sprintbuf b = {buf, buf+n-1, 0};
  80104c:	89 45 ec             	mov    %eax,-0x14(%ebp)
  80104f:	8d 44 10 ff          	lea    -0x1(%eax,%edx,1),%eax
  801053:	89 45 f0             	mov    %eax,-0x10(%ebp)
  801056:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

	if (buf == NULL || n < 1)
		return -E_INVAL;

	// print the string to the buffer
	vprintfmt((void*)sprintputch, &b, fmt, ap);
  80105d:	8b 45 14             	mov    0x14(%ebp),%eax
  801060:	89 44 24 0c          	mov    %eax,0xc(%esp)
  801064:	8b 45 10             	mov    0x10(%ebp),%eax
  801067:	89 44 24 08          	mov    %eax,0x8(%esp)
  80106b:	8d 45 ec             	lea    -0x14(%ebp),%eax
  80106e:	89 44 24 04          	mov    %eax,0x4(%esp)
  801072:	c7 04 24 f0 0b 80 00 	movl   $0x800bf0,(%esp)
  801079:	e8 8f fb ff ff       	call   800c0d <vprintfmt>

	// null terminate the buffer
	*b.buf = '\0';
  80107e:	8b 45 ec             	mov    -0x14(%ebp),%eax
  801081:	c6 00 00             	movb   $0x0,(%eax)

	return b.cnt;
  801084:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  801087:	c9                   	leave  
  801088:	c3                   	ret    

00801089 <snprintf>:

int
snprintf(char *buf, int n, const char *fmt, ...)
{
  801089:	55                   	push   %ebp
  80108a:	89 e5                	mov    %esp,%ebp
  80108c:	83 ec 18             	sub    $0x18,%esp

	return b.cnt;
}

int
snprintf(char *buf, int n, const char *fmt, ...)
  80108f:	8d 45 14             	lea    0x14(%ebp),%eax
{
	va_list ap;
	int rc;

	va_start(ap, fmt);
	rc = vsnprintf(buf, n, fmt, ap);
  801092:	89 44 24 0c          	mov    %eax,0xc(%esp)
  801096:	8b 45 10             	mov    0x10(%ebp),%eax
  801099:	89 44 24 08          	mov    %eax,0x8(%esp)
  80109d:	8b 45 0c             	mov    0xc(%ebp),%eax
  8010a0:	89 44 24 04          	mov    %eax,0x4(%esp)
  8010a4:	8b 45 08             	mov    0x8(%ebp),%eax
  8010a7:	89 04 24             	mov    %eax,(%esp)
  8010aa:	e8 82 ff ff ff       	call   801031 <vsnprintf>
	va_end(ap);

	return rc;
}
  8010af:	c9                   	leave  
  8010b0:	c3                   	ret    

008010b1 <printfmt>:
	}
}

void
printfmt(void (*putch)(int, void*), void *putdat, const char *fmt, ...)
{
  8010b1:	55                   	push   %ebp
  8010b2:	89 e5                	mov    %esp,%ebp
  8010b4:	83 ec 18             	sub    $0x18,%esp
		}
	}
}

void
printfmt(void (*putch)(int, void*), void *putdat, const char *fmt, ...)
  8010b7:	8d 45 14             	lea    0x14(%ebp),%eax
{
	va_list ap;

	va_start(ap, fmt);
	vprintfmt(putch, putdat, fmt, ap);
  8010ba:	89 44 24 0c          	mov    %eax,0xc(%esp)
  8010be:	8b 45 10             	mov    0x10(%ebp),%eax
  8010c1:	89 44 24 08          	mov    %eax,0x8(%esp)
  8010c5:	8b 45 0c             	mov    0xc(%ebp),%eax
  8010c8:	89 44 24 04          	mov    %eax,0x4(%esp)
  8010cc:	8b 45 08             	mov    0x8(%ebp),%eax
  8010cf:	89 04 24             	mov    %eax,(%esp)
  8010d2:	e8 36 fb ff ff       	call   800c0d <vprintfmt>
	va_end(ap);
}
  8010d7:	c9                   	leave  
  8010d8:	c3                   	ret    
  8010d9:	00 00                	add    %al,(%eax)
  8010db:	00 00                	add    %al,(%eax)
  8010dd:	00 00                	add    %al,(%eax)
	...

008010e0 <strlen>:
// Primespipe runs 3x faster this way.
#define ASM 1

int
strlen(const char *s)
{
  8010e0:	55                   	push   %ebp
  8010e1:	89 e5                	mov    %esp,%ebp
  8010e3:	8b 55 08             	mov    0x8(%ebp),%edx
	int n;

	for (n = 0; *s != '\0'; s++)
  8010e6:	b8 00 00 00 00       	mov    $0x0,%eax
  8010eb:	80 3a 00             	cmpb   $0x0,(%edx)
  8010ee:	74 09                	je     8010f9 <strlen+0x19>
		n++;
  8010f0:	83 c0 01             	add    $0x1,%eax
int
strlen(const char *s)
{
	int n;

	for (n = 0; *s != '\0'; s++)
  8010f3:	80 3c 02 00          	cmpb   $0x0,(%edx,%eax,1)
  8010f7:	75 f7                	jne    8010f0 <strlen+0x10>
		n++;
	return n;
}
  8010f9:	5d                   	pop    %ebp
  8010fa:	c3                   	ret    

008010fb <strnlen>:

int
strnlen(const char *s, size_t size)
{
  8010fb:	55                   	push   %ebp
  8010fc:	89 e5                	mov    %esp,%ebp
  8010fe:	53                   	push   %ebx
  8010ff:	8b 5d 08             	mov    0x8(%ebp),%ebx
  801102:	8b 4d 0c             	mov    0xc(%ebp),%ecx
	int n;

	for (n = 0; size > 0 && *s != '\0'; s++, size--)
  801105:	85 c9                	test   %ecx,%ecx
  801107:	74 19                	je     801122 <strnlen+0x27>
  801109:	80 3b 00             	cmpb   $0x0,(%ebx)
  80110c:	74 14                	je     801122 <strnlen+0x27>
  80110e:	b8 00 00 00 00       	mov    $0x0,%eax
		n++;
  801113:	83 c0 01             	add    $0x1,%eax
int
strnlen(const char *s, size_t size)
{
	int n;

	for (n = 0; size > 0 && *s != '\0'; s++, size--)
  801116:	39 c8                	cmp    %ecx,%eax
  801118:	74 0d                	je     801127 <strnlen+0x2c>
  80111a:	80 3c 03 00          	cmpb   $0x0,(%ebx,%eax,1)
  80111e:	75 f3                	jne    801113 <strnlen+0x18>
  801120:	eb 05                	jmp    801127 <strnlen+0x2c>
  801122:	b8 00 00 00 00       	mov    $0x0,%eax
		n++;
	return n;
}
  801127:	5b                   	pop    %ebx
  801128:	5d                   	pop    %ebp
  801129:	c3                   	ret    

0080112a <strcpy>:

char *
strcpy(char *dst, const char *src)
{
  80112a:	55                   	push   %ebp
  80112b:	89 e5                	mov    %esp,%ebp
  80112d:	53                   	push   %ebx
  80112e:	8b 45 08             	mov    0x8(%ebp),%eax
  801131:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  801134:	ba 00 00 00 00       	mov    $0x0,%edx
	char *ret;

	ret = dst;
	while ((*dst++ = *src++) != '\0')
  801139:	0f b6 0c 13          	movzbl (%ebx,%edx,1),%ecx
  80113d:	88 0c 10             	mov    %cl,(%eax,%edx,1)
  801140:	83 c2 01             	add    $0x1,%edx
  801143:	84 c9                	test   %cl,%cl
  801145:	75 f2                	jne    801139 <strcpy+0xf>
		/* do nothing */;
	return ret;
}
  801147:	5b                   	pop    %ebx
  801148:	5d                   	pop    %ebp
  801149:	c3                   	ret    

0080114a <strncpy>:

char *
strncpy(char *dst, const char *src, size_t size) {
  80114a:	55                   	push   %ebp
  80114b:	89 e5                	mov    %esp,%ebp
  80114d:	56                   	push   %esi
  80114e:	53                   	push   %ebx
  80114f:	8b 45 08             	mov    0x8(%ebp),%eax
  801152:	8b 55 0c             	mov    0xc(%ebp),%edx
  801155:	8b 75 10             	mov    0x10(%ebp),%esi
	size_t i;
	char *ret;

	ret = dst;
	for (i = 0; i < size; i++) {
  801158:	85 f6                	test   %esi,%esi
  80115a:	74 18                	je     801174 <strncpy+0x2a>
  80115c:	b9 00 00 00 00       	mov    $0x0,%ecx
		*dst++ = *src;
  801161:	0f b6 1a             	movzbl (%edx),%ebx
  801164:	88 1c 08             	mov    %bl,(%eax,%ecx,1)
		// If strlen(src) < size, null-pad 'dst' out to 'size' chars
		if (*src != '\0')
			src++;
  801167:	80 3a 01             	cmpb   $0x1,(%edx)
  80116a:	83 da ff             	sbb    $0xffffffff,%edx
strncpy(char *dst, const char *src, size_t size) {
	size_t i;
	char *ret;

	ret = dst;
	for (i = 0; i < size; i++) {
  80116d:	83 c1 01             	add    $0x1,%ecx
  801170:	39 ce                	cmp    %ecx,%esi
  801172:	77 ed                	ja     801161 <strncpy+0x17>
		// If strlen(src) < size, null-pad 'dst' out to 'size' chars
		if (*src != '\0')
			src++;
	}
	return ret;
}
  801174:	5b                   	pop    %ebx
  801175:	5e                   	pop    %esi
  801176:	5d                   	pop    %ebp
  801177:	c3                   	ret    

00801178 <strlcpy>:

size_t
strlcpy(char *dst, const char *src, size_t size)
{
  801178:	55                   	push   %ebp
  801179:	89 e5                	mov    %esp,%ebp
  80117b:	56                   	push   %esi
  80117c:	53                   	push   %ebx
  80117d:	8b 75 08             	mov    0x8(%ebp),%esi
  801180:	8b 55 0c             	mov    0xc(%ebp),%edx
  801183:	8b 4d 10             	mov    0x10(%ebp),%ecx
	char *dst_in;

	dst_in = dst;
	if (size > 0) {
  801186:	89 f0                	mov    %esi,%eax
  801188:	85 c9                	test   %ecx,%ecx
  80118a:	74 27                	je     8011b3 <strlcpy+0x3b>
		while (--size > 0 && *src != '\0')
  80118c:	83 e9 01             	sub    $0x1,%ecx
  80118f:	74 1d                	je     8011ae <strlcpy+0x36>
  801191:	0f b6 1a             	movzbl (%edx),%ebx
  801194:	84 db                	test   %bl,%bl
  801196:	74 16                	je     8011ae <strlcpy+0x36>
			*dst++ = *src++;
  801198:	88 18                	mov    %bl,(%eax)
  80119a:	83 c0 01             	add    $0x1,%eax
{
	char *dst_in;

	dst_in = dst;
	if (size > 0) {
		while (--size > 0 && *src != '\0')
  80119d:	83 e9 01             	sub    $0x1,%ecx
  8011a0:	74 0e                	je     8011b0 <strlcpy+0x38>
			*dst++ = *src++;
  8011a2:	83 c2 01             	add    $0x1,%edx
{
	char *dst_in;

	dst_in = dst;
	if (size > 0) {
		while (--size > 0 && *src != '\0')
  8011a5:	0f b6 1a             	movzbl (%edx),%ebx
  8011a8:	84 db                	test   %bl,%bl
  8011aa:	75 ec                	jne    801198 <strlcpy+0x20>
  8011ac:	eb 02                	jmp    8011b0 <strlcpy+0x38>
  8011ae:	89 f0                	mov    %esi,%eax
			*dst++ = *src++;
		*dst = '\0';
  8011b0:	c6 00 00             	movb   $0x0,(%eax)
  8011b3:	29 f0                	sub    %esi,%eax
	}
	return dst - dst_in;
}
  8011b5:	5b                   	pop    %ebx
  8011b6:	5e                   	pop    %esi
  8011b7:	5d                   	pop    %ebp
  8011b8:	c3                   	ret    

008011b9 <strcmp>:

int
strcmp(const char *p, const char *q)
{
  8011b9:	55                   	push   %ebp
  8011ba:	89 e5                	mov    %esp,%ebp
  8011bc:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8011bf:	8b 55 0c             	mov    0xc(%ebp),%edx
	while (*p && *p == *q)
  8011c2:	0f b6 01             	movzbl (%ecx),%eax
  8011c5:	84 c0                	test   %al,%al
  8011c7:	74 15                	je     8011de <strcmp+0x25>
  8011c9:	3a 02                	cmp    (%edx),%al
  8011cb:	75 11                	jne    8011de <strcmp+0x25>
		p++, q++;
  8011cd:	83 c1 01             	add    $0x1,%ecx
  8011d0:	83 c2 01             	add    $0x1,%edx
}

int
strcmp(const char *p, const char *q)
{
	while (*p && *p == *q)
  8011d3:	0f b6 01             	movzbl (%ecx),%eax
  8011d6:	84 c0                	test   %al,%al
  8011d8:	74 04                	je     8011de <strcmp+0x25>
  8011da:	3a 02                	cmp    (%edx),%al
  8011dc:	74 ef                	je     8011cd <strcmp+0x14>
  8011de:	0f b6 c0             	movzbl %al,%eax
  8011e1:	0f b6 12             	movzbl (%edx),%edx
  8011e4:	29 d0                	sub    %edx,%eax
		p++, q++;
	return (int) ((unsigned char) *p - (unsigned char) *q);
}
  8011e6:	5d                   	pop    %ebp
  8011e7:	c3                   	ret    

008011e8 <strncmp>:

int
strncmp(const char *p, const char *q, size_t n)
{
  8011e8:	55                   	push   %ebp
  8011e9:	89 e5                	mov    %esp,%ebp
  8011eb:	53                   	push   %ebx
  8011ec:	8b 55 08             	mov    0x8(%ebp),%edx
  8011ef:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8011f2:	8b 45 10             	mov    0x10(%ebp),%eax
	while (n > 0 && *p && *p == *q)
  8011f5:	85 c0                	test   %eax,%eax
  8011f7:	74 23                	je     80121c <strncmp+0x34>
  8011f9:	0f b6 1a             	movzbl (%edx),%ebx
  8011fc:	84 db                	test   %bl,%bl
  8011fe:	74 24                	je     801224 <strncmp+0x3c>
  801200:	3a 19                	cmp    (%ecx),%bl
  801202:	75 20                	jne    801224 <strncmp+0x3c>
  801204:	83 e8 01             	sub    $0x1,%eax
  801207:	74 13                	je     80121c <strncmp+0x34>
		n--, p++, q++;
  801209:	83 c2 01             	add    $0x1,%edx
  80120c:	83 c1 01             	add    $0x1,%ecx
}

int
strncmp(const char *p, const char *q, size_t n)
{
	while (n > 0 && *p && *p == *q)
  80120f:	0f b6 1a             	movzbl (%edx),%ebx
  801212:	84 db                	test   %bl,%bl
  801214:	74 0e                	je     801224 <strncmp+0x3c>
  801216:	3a 19                	cmp    (%ecx),%bl
  801218:	74 ea                	je     801204 <strncmp+0x1c>
  80121a:	eb 08                	jmp    801224 <strncmp+0x3c>
  80121c:	b8 00 00 00 00       	mov    $0x0,%eax
		n--, p++, q++;
	if (n == 0)
		return 0;
	else
		return (int) ((unsigned char) *p - (unsigned char) *q);
}
  801221:	5b                   	pop    %ebx
  801222:	5d                   	pop    %ebp
  801223:	c3                   	ret    
	while (n > 0 && *p && *p == *q)
		n--, p++, q++;
	if (n == 0)
		return 0;
	else
		return (int) ((unsigned char) *p - (unsigned char) *q);
  801224:	0f b6 02             	movzbl (%edx),%eax
  801227:	0f b6 11             	movzbl (%ecx),%edx
  80122a:	29 d0                	sub    %edx,%eax
  80122c:	eb f3                	jmp    801221 <strncmp+0x39>

0080122e <strchr>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a null pointer if the string has no 'c'.
char *
strchr(const char *s, char c)
{
  80122e:	55                   	push   %ebp
  80122f:	89 e5                	mov    %esp,%ebp
  801231:	8b 45 08             	mov    0x8(%ebp),%eax
  801234:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  801238:	0f b6 10             	movzbl (%eax),%edx
  80123b:	84 d2                	test   %dl,%dl
  80123d:	74 15                	je     801254 <strchr+0x26>
		if (*s == c)
  80123f:	38 ca                	cmp    %cl,%dl
  801241:	75 07                	jne    80124a <strchr+0x1c>
  801243:	eb 14                	jmp    801259 <strchr+0x2b>
  801245:	38 ca                	cmp    %cl,%dl
  801247:	90                   	nop
  801248:	74 0f                	je     801259 <strchr+0x2b>
// Return a pointer to the first occurrence of 'c' in 's',
// or a null pointer if the string has no 'c'.
char *
strchr(const char *s, char c)
{
	for (; *s; s++)
  80124a:	83 c0 01             	add    $0x1,%eax
  80124d:	0f b6 10             	movzbl (%eax),%edx
  801250:	84 d2                	test   %dl,%dl
  801252:	75 f1                	jne    801245 <strchr+0x17>
  801254:	b8 00 00 00 00       	mov    $0x0,%eax
		if (*s == c)
			return (char *) s;
	return 0;
}
  801259:	5d                   	pop    %ebp
  80125a:	c3                   	ret    

0080125b <strfind>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a pointer to the string-ending null character if the string has no 'c'.
char *
strfind(const char *s, char c)
{
  80125b:	55                   	push   %ebp
  80125c:	89 e5                	mov    %esp,%ebp
  80125e:	8b 45 08             	mov    0x8(%ebp),%eax
  801261:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  801265:	0f b6 10             	movzbl (%eax),%edx
  801268:	84 d2                	test   %dl,%dl
  80126a:	74 18                	je     801284 <strfind+0x29>
		if (*s == c)
  80126c:	38 ca                	cmp    %cl,%dl
  80126e:	75 0a                	jne    80127a <strfind+0x1f>
  801270:	eb 12                	jmp    801284 <strfind+0x29>
  801272:	38 ca                	cmp    %cl,%dl
  801274:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  801278:	74 0a                	je     801284 <strfind+0x29>
// Return a pointer to the first occurrence of 'c' in 's',
// or a pointer to the string-ending null character if the string has no 'c'.
char *
strfind(const char *s, char c)
{
	for (; *s; s++)
  80127a:	83 c0 01             	add    $0x1,%eax
  80127d:	0f b6 10             	movzbl (%eax),%edx
  801280:	84 d2                	test   %dl,%dl
  801282:	75 ee                	jne    801272 <strfind+0x17>
		if (*s == c)
			break;
	return (char *) s;
}
  801284:	5d                   	pop    %ebp
  801285:	c3                   	ret    

00801286 <memset>:

#if ASM
void *
memset(void *v, int c, size_t n)
{
  801286:	55                   	push   %ebp
  801287:	89 e5                	mov    %esp,%ebp
  801289:	83 ec 0c             	sub    $0xc,%esp
  80128c:	89 1c 24             	mov    %ebx,(%esp)
  80128f:	89 74 24 04          	mov    %esi,0x4(%esp)
  801293:	89 7c 24 08          	mov    %edi,0x8(%esp)
  801297:	8b 7d 08             	mov    0x8(%ebp),%edi
  80129a:	8b 45 0c             	mov    0xc(%ebp),%eax
  80129d:	8b 4d 10             	mov    0x10(%ebp),%ecx
	char *p;

	if (n == 0)
  8012a0:	85 c9                	test   %ecx,%ecx
  8012a2:	74 30                	je     8012d4 <memset+0x4e>
		return v;
	if ((int)v%4 == 0 && n%4 == 0) {
  8012a4:	f7 c7 03 00 00 00    	test   $0x3,%edi
  8012aa:	75 25                	jne    8012d1 <memset+0x4b>
  8012ac:	f6 c1 03             	test   $0x3,%cl
  8012af:	75 20                	jne    8012d1 <memset+0x4b>
		c &= 0xFF;
  8012b1:	0f b6 d0             	movzbl %al,%edx
		c = (c<<24)|(c<<16)|(c<<8)|c;
  8012b4:	89 d3                	mov    %edx,%ebx
  8012b6:	c1 e3 08             	shl    $0x8,%ebx
  8012b9:	89 d6                	mov    %edx,%esi
  8012bb:	c1 e6 18             	shl    $0x18,%esi
  8012be:	89 d0                	mov    %edx,%eax
  8012c0:	c1 e0 10             	shl    $0x10,%eax
  8012c3:	09 f0                	or     %esi,%eax
  8012c5:	09 d0                	or     %edx,%eax
		asm volatile("cld; rep stosl\n"
  8012c7:	09 d8                	or     %ebx,%eax
  8012c9:	c1 e9 02             	shr    $0x2,%ecx
  8012cc:	fc                   	cld    
  8012cd:	f3 ab                	rep stos %eax,%es:(%edi)
{
	char *p;

	if (n == 0)
		return v;
	if ((int)v%4 == 0 && n%4 == 0) {
  8012cf:	eb 03                	jmp    8012d4 <memset+0x4e>
		c = (c<<24)|(c<<16)|(c<<8)|c;
		asm volatile("cld; rep stosl\n"
			:: "D" (v), "a" (c), "c" (n/4)
			: "cc", "memory");
	} else
		asm volatile("cld; rep stosb\n"
  8012d1:	fc                   	cld    
  8012d2:	f3 aa                	rep stos %al,%es:(%edi)
			:: "D" (v), "a" (c), "c" (n)
			: "cc", "memory");
	return v;
}
  8012d4:	89 f8                	mov    %edi,%eax
  8012d6:	8b 1c 24             	mov    (%esp),%ebx
  8012d9:	8b 74 24 04          	mov    0x4(%esp),%esi
  8012dd:	8b 7c 24 08          	mov    0x8(%esp),%edi
  8012e1:	89 ec                	mov    %ebp,%esp
  8012e3:	5d                   	pop    %ebp
  8012e4:	c3                   	ret    

008012e5 <memmove>:

void *
memmove(void *dst, const void *src, size_t n)
{
  8012e5:	55                   	push   %ebp
  8012e6:	89 e5                	mov    %esp,%ebp
  8012e8:	83 ec 08             	sub    $0x8,%esp
  8012eb:	89 34 24             	mov    %esi,(%esp)
  8012ee:	89 7c 24 04          	mov    %edi,0x4(%esp)
  8012f2:	8b 45 08             	mov    0x8(%ebp),%eax
  8012f5:	8b 4d 10             	mov    0x10(%ebp),%ecx
	const char *s;
	char *d;
	
	s = src;
  8012f8:	8b 75 0c             	mov    0xc(%ebp),%esi
	d = dst;
  8012fb:	89 c7                	mov    %eax,%edi
	if (s < d && s + n > d) {
  8012fd:	39 c6                	cmp    %eax,%esi
  8012ff:	73 35                	jae    801336 <memmove+0x51>
  801301:	8d 14 0e             	lea    (%esi,%ecx,1),%edx
  801304:	39 d0                	cmp    %edx,%eax
  801306:	73 2e                	jae    801336 <memmove+0x51>
		s += n;
		d += n;
  801308:	01 cf                	add    %ecx,%edi
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  80130a:	f6 c2 03             	test   $0x3,%dl
  80130d:	75 1b                	jne    80132a <memmove+0x45>
  80130f:	f7 c7 03 00 00 00    	test   $0x3,%edi
  801315:	75 13                	jne    80132a <memmove+0x45>
  801317:	f6 c1 03             	test   $0x3,%cl
  80131a:	75 0e                	jne    80132a <memmove+0x45>
			asm volatile("std; rep movsl\n"
  80131c:	83 ef 04             	sub    $0x4,%edi
  80131f:	8d 72 fc             	lea    -0x4(%edx),%esi
  801322:	c1 e9 02             	shr    $0x2,%ecx
  801325:	fd                   	std    
  801326:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
	s = src;
	d = dst;
	if (s < d && s + n > d) {
		s += n;
		d += n;
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  801328:	eb 09                	jmp    801333 <memmove+0x4e>
			asm volatile("std; rep movsl\n"
				:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
		else
			asm volatile("std; rep movsb\n"
  80132a:	83 ef 01             	sub    $0x1,%edi
  80132d:	8d 72 ff             	lea    -0x1(%edx),%esi
  801330:	fd                   	std    
  801331:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
				:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
		// Some versions of GCC rely on DF being clear
		asm volatile("cld" ::: "cc");
  801333:	fc                   	cld    
	const char *s;
	char *d;
	
	s = src;
	d = dst;
	if (s < d && s + n > d) {
  801334:	eb 20                	jmp    801356 <memmove+0x71>
			asm volatile("std; rep movsb\n"
				:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
		// Some versions of GCC rely on DF being clear
		asm volatile("cld" ::: "cc");
	} else {
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  801336:	f7 c6 03 00 00 00    	test   $0x3,%esi
  80133c:	75 15                	jne    801353 <memmove+0x6e>
  80133e:	f7 c7 03 00 00 00    	test   $0x3,%edi
  801344:	75 0d                	jne    801353 <memmove+0x6e>
  801346:	f6 c1 03             	test   $0x3,%cl
  801349:	75 08                	jne    801353 <memmove+0x6e>
			asm volatile("cld; rep movsl\n"
  80134b:	c1 e9 02             	shr    $0x2,%ecx
  80134e:	fc                   	cld    
  80134f:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
			asm volatile("std; rep movsb\n"
				:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
		// Some versions of GCC rely on DF being clear
		asm volatile("cld" ::: "cc");
	} else {
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  801351:	eb 03                	jmp    801356 <memmove+0x71>
			asm volatile("cld; rep movsl\n"
				:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
		else
			asm volatile("cld; rep movsb\n"
  801353:	fc                   	cld    
  801354:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
				:: "D" (d), "S" (s), "c" (n) : "cc", "memory");
	}
	return dst;
}
  801356:	8b 34 24             	mov    (%esp),%esi
  801359:	8b 7c 24 04          	mov    0x4(%esp),%edi
  80135d:	89 ec                	mov    %ebp,%esp
  80135f:	5d                   	pop    %ebp
  801360:	c3                   	ret    

00801361 <memcpy>:

/* sigh - gcc emits references to this for structure assignments! */
/* it is *not* prototyped in inc/string.h - do not use directly. */
void *
memcpy(void *dst, void *src, size_t n)
{
  801361:	55                   	push   %ebp
  801362:	89 e5                	mov    %esp,%ebp
  801364:	83 ec 0c             	sub    $0xc,%esp
	return memmove(dst, src, n);
  801367:	8b 45 10             	mov    0x10(%ebp),%eax
  80136a:	89 44 24 08          	mov    %eax,0x8(%esp)
  80136e:	8b 45 0c             	mov    0xc(%ebp),%eax
  801371:	89 44 24 04          	mov    %eax,0x4(%esp)
  801375:	8b 45 08             	mov    0x8(%ebp),%eax
  801378:	89 04 24             	mov    %eax,(%esp)
  80137b:	e8 65 ff ff ff       	call   8012e5 <memmove>
}
  801380:	c9                   	leave  
  801381:	c3                   	ret    

00801382 <memcmp>:

int
memcmp(const void *v1, const void *v2, size_t n)
{
  801382:	55                   	push   %ebp
  801383:	89 e5                	mov    %esp,%ebp
  801385:	57                   	push   %edi
  801386:	56                   	push   %esi
  801387:	53                   	push   %ebx
  801388:	8b 75 08             	mov    0x8(%ebp),%esi
  80138b:	8b 7d 0c             	mov    0xc(%ebp),%edi
  80138e:	8b 4d 10             	mov    0x10(%ebp),%ecx
	const uint8_t *s1 = (const uint8_t *) v1;
	const uint8_t *s2 = (const uint8_t *) v2;

	while (n-- > 0) {
  801391:	85 c9                	test   %ecx,%ecx
  801393:	74 36                	je     8013cb <memcmp+0x49>
		if (*s1 != *s2)
  801395:	0f b6 06             	movzbl (%esi),%eax
  801398:	0f b6 1f             	movzbl (%edi),%ebx
  80139b:	38 d8                	cmp    %bl,%al
  80139d:	74 20                	je     8013bf <memcmp+0x3d>
  80139f:	eb 14                	jmp    8013b5 <memcmp+0x33>
  8013a1:	0f b6 44 16 01       	movzbl 0x1(%esi,%edx,1),%eax
  8013a6:	0f b6 5c 17 01       	movzbl 0x1(%edi,%edx,1),%ebx
  8013ab:	83 c2 01             	add    $0x1,%edx
  8013ae:	83 e9 01             	sub    $0x1,%ecx
  8013b1:	38 d8                	cmp    %bl,%al
  8013b3:	74 12                	je     8013c7 <memcmp+0x45>
			return (int) *s1 - (int) *s2;
  8013b5:	0f b6 c0             	movzbl %al,%eax
  8013b8:	0f b6 db             	movzbl %bl,%ebx
  8013bb:	29 d8                	sub    %ebx,%eax
  8013bd:	eb 11                	jmp    8013d0 <memcmp+0x4e>
memcmp(const void *v1, const void *v2, size_t n)
{
	const uint8_t *s1 = (const uint8_t *) v1;
	const uint8_t *s2 = (const uint8_t *) v2;

	while (n-- > 0) {
  8013bf:	83 e9 01             	sub    $0x1,%ecx
  8013c2:	ba 00 00 00 00       	mov    $0x0,%edx
  8013c7:	85 c9                	test   %ecx,%ecx
  8013c9:	75 d6                	jne    8013a1 <memcmp+0x1f>
  8013cb:	b8 00 00 00 00       	mov    $0x0,%eax
			return (int) *s1 - (int) *s2;
		s1++, s2++;
	}

	return 0;
}
  8013d0:	5b                   	pop    %ebx
  8013d1:	5e                   	pop    %esi
  8013d2:	5f                   	pop    %edi
  8013d3:	5d                   	pop    %ebp
  8013d4:	c3                   	ret    

008013d5 <memfind>:

void *
memfind(const void *s, int c, size_t n)
{
  8013d5:	55                   	push   %ebp
  8013d6:	89 e5                	mov    %esp,%ebp
  8013d8:	8b 45 08             	mov    0x8(%ebp),%eax
	const void *ends = (const char *) s + n;
  8013db:	89 c2                	mov    %eax,%edx
  8013dd:	03 55 10             	add    0x10(%ebp),%edx
	for (; s < ends; s++)
  8013e0:	39 d0                	cmp    %edx,%eax
  8013e2:	73 15                	jae    8013f9 <memfind+0x24>
		if (*(const unsigned char *) s == (unsigned char) c)
  8013e4:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
  8013e8:	38 08                	cmp    %cl,(%eax)
  8013ea:	75 06                	jne    8013f2 <memfind+0x1d>
  8013ec:	eb 0b                	jmp    8013f9 <memfind+0x24>
  8013ee:	38 08                	cmp    %cl,(%eax)
  8013f0:	74 07                	je     8013f9 <memfind+0x24>

void *
memfind(const void *s, int c, size_t n)
{
	const void *ends = (const char *) s + n;
	for (; s < ends; s++)
  8013f2:	83 c0 01             	add    $0x1,%eax
  8013f5:	39 c2                	cmp    %eax,%edx
  8013f7:	77 f5                	ja     8013ee <memfind+0x19>
		if (*(const unsigned char *) s == (unsigned char) c)
			break;
	return (void *) s;
}
  8013f9:	5d                   	pop    %ebp
  8013fa:	c3                   	ret    

008013fb <strtol>:

long
strtol(const char *s, char **endptr, int base)
{
  8013fb:	55                   	push   %ebp
  8013fc:	89 e5                	mov    %esp,%ebp
  8013fe:	57                   	push   %edi
  8013ff:	56                   	push   %esi
  801400:	53                   	push   %ebx
  801401:	83 ec 04             	sub    $0x4,%esp
  801404:	8b 55 08             	mov    0x8(%ebp),%edx
  801407:	8b 5d 10             	mov    0x10(%ebp),%ebx
	int neg = 0;
	long val = 0;

	// gobble initial whitespace
	while (*s == ' ' || *s == '\t')
  80140a:	0f b6 02             	movzbl (%edx),%eax
  80140d:	3c 20                	cmp    $0x20,%al
  80140f:	74 04                	je     801415 <strtol+0x1a>
  801411:	3c 09                	cmp    $0x9,%al
  801413:	75 0e                	jne    801423 <strtol+0x28>
		s++;
  801415:	83 c2 01             	add    $0x1,%edx
{
	int neg = 0;
	long val = 0;

	// gobble initial whitespace
	while (*s == ' ' || *s == '\t')
  801418:	0f b6 02             	movzbl (%edx),%eax
  80141b:	3c 20                	cmp    $0x20,%al
  80141d:	74 f6                	je     801415 <strtol+0x1a>
  80141f:	3c 09                	cmp    $0x9,%al
  801421:	74 f2                	je     801415 <strtol+0x1a>
		s++;

	// plus/minus sign
	if (*s == '+')
  801423:	3c 2b                	cmp    $0x2b,%al
  801425:	75 0c                	jne    801433 <strtol+0x38>
		s++;
  801427:	83 c2 01             	add    $0x1,%edx
  80142a:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
  801431:	eb 15                	jmp    801448 <strtol+0x4d>
	else if (*s == '-')
  801433:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
  80143a:	3c 2d                	cmp    $0x2d,%al
  80143c:	75 0a                	jne    801448 <strtol+0x4d>
		s++, neg = 1;
  80143e:	83 c2 01             	add    $0x1,%edx
  801441:	c7 45 f0 01 00 00 00 	movl   $0x1,-0x10(%ebp)

	// hex or octal base prefix
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  801448:	85 db                	test   %ebx,%ebx
  80144a:	0f 94 c0             	sete   %al
  80144d:	74 05                	je     801454 <strtol+0x59>
  80144f:	83 fb 10             	cmp    $0x10,%ebx
  801452:	75 18                	jne    80146c <strtol+0x71>
  801454:	80 3a 30             	cmpb   $0x30,(%edx)
  801457:	75 13                	jne    80146c <strtol+0x71>
  801459:	80 7a 01 78          	cmpb   $0x78,0x1(%edx)
  80145d:	8d 76 00             	lea    0x0(%esi),%esi
  801460:	75 0a                	jne    80146c <strtol+0x71>
		s += 2, base = 16;
  801462:	83 c2 02             	add    $0x2,%edx
  801465:	bb 10 00 00 00       	mov    $0x10,%ebx
		s++;
	else if (*s == '-')
		s++, neg = 1;

	// hex or octal base prefix
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  80146a:	eb 15                	jmp    801481 <strtol+0x86>
		s += 2, base = 16;
	else if (base == 0 && s[0] == '0')
  80146c:	84 c0                	test   %al,%al
  80146e:	66 90                	xchg   %ax,%ax
  801470:	74 0f                	je     801481 <strtol+0x86>
  801472:	bb 0a 00 00 00       	mov    $0xa,%ebx
  801477:	80 3a 30             	cmpb   $0x30,(%edx)
  80147a:	75 05                	jne    801481 <strtol+0x86>
		s++, base = 8;
  80147c:	83 c2 01             	add    $0x1,%edx
  80147f:	b3 08                	mov    $0x8,%bl
		s++, neg = 1;

	// hex or octal base prefix
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
		s += 2, base = 16;
	else if (base == 0 && s[0] == '0')
  801481:	b8 00 00 00 00       	mov    $0x0,%eax
  801486:	89 de                	mov    %ebx,%esi

	// digits
	while (1) {
		int dig;

		if (*s >= '0' && *s <= '9')
  801488:	0f b6 0a             	movzbl (%edx),%ecx
  80148b:	89 cf                	mov    %ecx,%edi
  80148d:	8d 59 d0             	lea    -0x30(%ecx),%ebx
  801490:	80 fb 09             	cmp    $0x9,%bl
  801493:	77 08                	ja     80149d <strtol+0xa2>
			dig = *s - '0';
  801495:	0f be c9             	movsbl %cl,%ecx
  801498:	83 e9 30             	sub    $0x30,%ecx
  80149b:	eb 1e                	jmp    8014bb <strtol+0xc0>
		else if (*s >= 'a' && *s <= 'z')
  80149d:	8d 5f 9f             	lea    -0x61(%edi),%ebx
  8014a0:	80 fb 19             	cmp    $0x19,%bl
  8014a3:	77 08                	ja     8014ad <strtol+0xb2>
			dig = *s - 'a' + 10;
  8014a5:	0f be c9             	movsbl %cl,%ecx
  8014a8:	83 e9 57             	sub    $0x57,%ecx
  8014ab:	eb 0e                	jmp    8014bb <strtol+0xc0>
		else if (*s >= 'A' && *s <= 'Z')
  8014ad:	8d 5f bf             	lea    -0x41(%edi),%ebx
  8014b0:	80 fb 19             	cmp    $0x19,%bl
  8014b3:	77 15                	ja     8014ca <strtol+0xcf>
			dig = *s - 'A' + 10;
  8014b5:	0f be c9             	movsbl %cl,%ecx
  8014b8:	83 e9 37             	sub    $0x37,%ecx
		else
			break;
		if (dig >= base)
  8014bb:	39 f1                	cmp    %esi,%ecx
  8014bd:	7d 0b                	jge    8014ca <strtol+0xcf>
			break;
		s++, val = (val * base) + dig;
  8014bf:	83 c2 01             	add    $0x1,%edx
  8014c2:	0f af c6             	imul   %esi,%eax
  8014c5:	8d 04 01             	lea    (%ecx,%eax,1),%eax
		// we don't properly detect overflow!
	}
  8014c8:	eb be                	jmp    801488 <strtol+0x8d>
  8014ca:	89 c1                	mov    %eax,%ecx

	if (endptr)
  8014cc:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  8014d0:	74 05                	je     8014d7 <strtol+0xdc>
		*endptr = (char *) s;
  8014d2:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  8014d5:	89 13                	mov    %edx,(%ebx)
	return (neg ? -val : val);
  8014d7:	89 ca                	mov    %ecx,%edx
  8014d9:	f7 da                	neg    %edx
  8014db:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  8014df:	0f 45 c2             	cmovne %edx,%eax
}
  8014e2:	83 c4 04             	add    $0x4,%esp
  8014e5:	5b                   	pop    %ebx
  8014e6:	5e                   	pop    %esi
  8014e7:	5f                   	pop    %edi
  8014e8:	5d                   	pop    %ebp
  8014e9:	c3                   	ret    
	...

008014ec <sys_cgetc>:
	syscall(SYS_cputs, 0, (uint32_t)s, len, 0, 0, 0);
}

int
sys_cgetc(void)
{
  8014ec:	55                   	push   %ebp
  8014ed:	89 e5                	mov    %esp,%ebp
  8014ef:	83 ec 0c             	sub    $0xc,%esp
  8014f2:	89 1c 24             	mov    %ebx,(%esp)
  8014f5:	89 74 24 04          	mov    %esi,0x4(%esp)
  8014f9:	89 7c 24 08          	mov    %edi,0x8(%esp)
	// 
	// The last clause tells the assembler that this can
	// potentially change the condition codes and arbitrary
	// memory locations.

	asm volatile("int %1\n"
  8014fd:	ba 00 00 00 00       	mov    $0x0,%edx
  801502:	b8 01 00 00 00       	mov    $0x1,%eax
  801507:	89 d1                	mov    %edx,%ecx
  801509:	89 d3                	mov    %edx,%ebx
  80150b:	89 d7                	mov    %edx,%edi
  80150d:	89 d6                	mov    %edx,%esi
  80150f:	cd 30                	int    $0x30

int
sys_cgetc(void)
{
	return syscall(SYS_cgetc, 0, 0, 0, 0, 0, 0);
}
  801511:	8b 1c 24             	mov    (%esp),%ebx
  801514:	8b 74 24 04          	mov    0x4(%esp),%esi
  801518:	8b 7c 24 08          	mov    0x8(%esp),%edi
  80151c:	89 ec                	mov    %ebp,%esp
  80151e:	5d                   	pop    %ebp
  80151f:	c3                   	ret    

00801520 <sys_cputs>:
	return ret;
}

void
sys_cputs(const char *s, size_t len)
{
  801520:	55                   	push   %ebp
  801521:	89 e5                	mov    %esp,%ebp
  801523:	83 ec 0c             	sub    $0xc,%esp
  801526:	89 1c 24             	mov    %ebx,(%esp)
  801529:	89 74 24 04          	mov    %esi,0x4(%esp)
  80152d:	89 7c 24 08          	mov    %edi,0x8(%esp)
	// 
	// The last clause tells the assembler that this can
	// potentially change the condition codes and arbitrary
	// memory locations.

	asm volatile("int %1\n"
  801531:	b8 00 00 00 00       	mov    $0x0,%eax
  801536:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801539:	8b 55 08             	mov    0x8(%ebp),%edx
  80153c:	89 c3                	mov    %eax,%ebx
  80153e:	89 c7                	mov    %eax,%edi
  801540:	89 c6                	mov    %eax,%esi
  801542:	cd 30                	int    $0x30

void
sys_cputs(const char *s, size_t len)
{
	syscall(SYS_cputs, 0, (uint32_t)s, len, 0, 0, 0);
}
  801544:	8b 1c 24             	mov    (%esp),%ebx
  801547:	8b 74 24 04          	mov    0x4(%esp),%esi
  80154b:	8b 7c 24 08          	mov    0x8(%esp),%edi
  80154f:	89 ec                	mov    %ebp,%esp
  801551:	5d                   	pop    %ebp
  801552:	c3                   	ret    

00801553 <sys_ns_recv>:
  return syscall(SYS_ns_send, 0, (uint32_t)pkt, len, 0, 0, 0);
}

int
sys_ns_recv(void *pkt, uint32_t len)
{
  801553:	55                   	push   %ebp
  801554:	89 e5                	mov    %esp,%ebp
  801556:	83 ec 0c             	sub    $0xc,%esp
  801559:	89 1c 24             	mov    %ebx,(%esp)
  80155c:	89 74 24 04          	mov    %esi,0x4(%esp)
  801560:	89 7c 24 08          	mov    %edi,0x8(%esp)
	// 
	// The last clause tells the assembler that this can
	// potentially change the condition codes and arbitrary
	// memory locations.

	asm volatile("int %1\n"
  801564:	bb 00 00 00 00       	mov    $0x0,%ebx
  801569:	b8 10 00 00 00       	mov    $0x10,%eax
  80156e:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801571:	8b 55 08             	mov    0x8(%ebp),%edx
  801574:	89 df                	mov    %ebx,%edi
  801576:	89 de                	mov    %ebx,%esi
  801578:	cd 30                	int    $0x30

int
sys_ns_recv(void *pkt, uint32_t len)
{
  return syscall(SYS_ns_recv, 0, (uint32_t)pkt, len, 0, 0, 0);
}
  80157a:	8b 1c 24             	mov    (%esp),%ebx
  80157d:	8b 74 24 04          	mov    0x4(%esp),%esi
  801581:	8b 7c 24 08          	mov    0x8(%esp),%edi
  801585:	89 ec                	mov    %ebp,%esp
  801587:	5d                   	pop    %ebp
  801588:	c3                   	ret    

00801589 <sys_ns_send>:
	return (unsigned int) syscall(SYS_time_msec, 0, 0, 0, 0, 0, 0);
}

int
sys_ns_send(void *pkt, uint32_t len)
{
  801589:	55                   	push   %ebp
  80158a:	89 e5                	mov    %esp,%ebp
  80158c:	83 ec 0c             	sub    $0xc,%esp
  80158f:	89 1c 24             	mov    %ebx,(%esp)
  801592:	89 74 24 04          	mov    %esi,0x4(%esp)
  801596:	89 7c 24 08          	mov    %edi,0x8(%esp)
	// 
	// The last clause tells the assembler that this can
	// potentially change the condition codes and arbitrary
	// memory locations.

	asm volatile("int %1\n"
  80159a:	bb 00 00 00 00       	mov    $0x0,%ebx
  80159f:	b8 0f 00 00 00       	mov    $0xf,%eax
  8015a4:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8015a7:	8b 55 08             	mov    0x8(%ebp),%edx
  8015aa:	89 df                	mov    %ebx,%edi
  8015ac:	89 de                	mov    %ebx,%esi
  8015ae:	cd 30                	int    $0x30

int
sys_ns_send(void *pkt, uint32_t len)
{
  return syscall(SYS_ns_send, 0, (uint32_t)pkt, len, 0, 0, 0);
}
  8015b0:	8b 1c 24             	mov    (%esp),%ebx
  8015b3:	8b 74 24 04          	mov    0x4(%esp),%esi
  8015b7:	8b 7c 24 08          	mov    0x8(%esp),%edi
  8015bb:	89 ec                	mov    %ebp,%esp
  8015bd:	5d                   	pop    %ebp
  8015be:	c3                   	ret    

008015bf <sys_time_msec>:
	return syscall(SYS_ipc_recv, 1, (uint32_t)dstva, 0, 0, 0, 0);
}

unsigned int
sys_time_msec(void)
{
  8015bf:	55                   	push   %ebp
  8015c0:	89 e5                	mov    %esp,%ebp
  8015c2:	83 ec 0c             	sub    $0xc,%esp
  8015c5:	89 1c 24             	mov    %ebx,(%esp)
  8015c8:	89 74 24 04          	mov    %esi,0x4(%esp)
  8015cc:	89 7c 24 08          	mov    %edi,0x8(%esp)
	// 
	// The last clause tells the assembler that this can
	// potentially change the condition codes and arbitrary
	// memory locations.

	asm volatile("int %1\n"
  8015d0:	ba 00 00 00 00       	mov    $0x0,%edx
  8015d5:	b8 0e 00 00 00       	mov    $0xe,%eax
  8015da:	89 d1                	mov    %edx,%ecx
  8015dc:	89 d3                	mov    %edx,%ebx
  8015de:	89 d7                	mov    %edx,%edi
  8015e0:	89 d6                	mov    %edx,%esi
  8015e2:	cd 30                	int    $0x30

unsigned int
sys_time_msec(void)
{
	return (unsigned int) syscall(SYS_time_msec, 0, 0, 0, 0, 0, 0);
}
  8015e4:	8b 1c 24             	mov    (%esp),%ebx
  8015e7:	8b 74 24 04          	mov    0x4(%esp),%esi
  8015eb:	8b 7c 24 08          	mov    0x8(%esp),%edi
  8015ef:	89 ec                	mov    %ebp,%esp
  8015f1:	5d                   	pop    %ebp
  8015f2:	c3                   	ret    

008015f3 <sys_ipc_recv>:
	return syscall(SYS_ipc_try_send, 1, envid, value, (uint32_t) srcva, perm, 0);
}

int
sys_ipc_recv(void *dstva)
{
  8015f3:	55                   	push   %ebp
  8015f4:	89 e5                	mov    %esp,%ebp
  8015f6:	83 ec 38             	sub    $0x38,%esp
  8015f9:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  8015fc:	89 75 f8             	mov    %esi,-0x8(%ebp)
  8015ff:	89 7d fc             	mov    %edi,-0x4(%ebp)
	// 
	// The last clause tells the assembler that this can
	// potentially change the condition codes and arbitrary
	// memory locations.

	asm volatile("int %1\n"
  801602:	b9 00 00 00 00       	mov    $0x0,%ecx
  801607:	b8 0d 00 00 00       	mov    $0xd,%eax
  80160c:	8b 55 08             	mov    0x8(%ebp),%edx
  80160f:	89 cb                	mov    %ecx,%ebx
  801611:	89 cf                	mov    %ecx,%edi
  801613:	89 ce                	mov    %ecx,%esi
  801615:	cd 30                	int    $0x30
		  "b" (a3),
		  "D" (a4),
		  "S" (a5)
		: "cc", "memory");
	
	if(check && ret > 0)
  801617:	85 c0                	test   %eax,%eax
  801619:	7e 28                	jle    801643 <sys_ipc_recv+0x50>
		panic("syscall %d returned %d (> 0)", num, ret);
  80161b:	89 44 24 10          	mov    %eax,0x10(%esp)
  80161f:	c7 44 24 0c 0d 00 00 	movl   $0xd,0xc(%esp)
  801626:	00 
  801627:	c7 44 24 08 8b 2a 81 	movl   $0x812a8b,0x8(%esp)
  80162e:	00 
  80162f:	c7 44 24 04 23 00 00 	movl   $0x23,0x4(%esp)
  801636:	00 
  801637:	c7 04 24 a8 2a 81 00 	movl   $0x812aa8,(%esp)
  80163e:	e8 59 f3 ff ff       	call   80099c <_panic>

int
sys_ipc_recv(void *dstva)
{
	return syscall(SYS_ipc_recv, 1, (uint32_t)dstva, 0, 0, 0, 0);
}
  801643:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  801646:	8b 75 f8             	mov    -0x8(%ebp),%esi
  801649:	8b 7d fc             	mov    -0x4(%ebp),%edi
  80164c:	89 ec                	mov    %ebp,%esp
  80164e:	5d                   	pop    %ebp
  80164f:	c3                   	ret    

00801650 <sys_ipc_try_send>:
	return syscall(SYS_env_set_pgfault_upcall, 1, envid, (uint32_t) upcall, 0, 0, 0);
}

int
sys_ipc_try_send(envid_t envid, uint32_t value, void *srcva, int perm)
{
  801650:	55                   	push   %ebp
  801651:	89 e5                	mov    %esp,%ebp
  801653:	83 ec 38             	sub    $0x38,%esp
  801656:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  801659:	89 75 f8             	mov    %esi,-0x8(%ebp)
  80165c:	89 7d fc             	mov    %edi,-0x4(%ebp)
	// 
	// The last clause tells the assembler that this can
	// potentially change the condition codes and arbitrary
	// memory locations.

	asm volatile("int %1\n"
  80165f:	be 00 00 00 00       	mov    $0x0,%esi
  801664:	b8 0c 00 00 00       	mov    $0xc,%eax
  801669:	8b 7d 14             	mov    0x14(%ebp),%edi
  80166c:	8b 5d 10             	mov    0x10(%ebp),%ebx
  80166f:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801672:	8b 55 08             	mov    0x8(%ebp),%edx
  801675:	cd 30                	int    $0x30
		  "b" (a3),
		  "D" (a4),
		  "S" (a5)
		: "cc", "memory");
	
	if(check && ret > 0)
  801677:	85 c0                	test   %eax,%eax
  801679:	7e 28                	jle    8016a3 <sys_ipc_try_send+0x53>
		panic("syscall %d returned %d (> 0)", num, ret);
  80167b:	89 44 24 10          	mov    %eax,0x10(%esp)
  80167f:	c7 44 24 0c 0c 00 00 	movl   $0xc,0xc(%esp)
  801686:	00 
  801687:	c7 44 24 08 8b 2a 81 	movl   $0x812a8b,0x8(%esp)
  80168e:	00 
  80168f:	c7 44 24 04 23 00 00 	movl   $0x23,0x4(%esp)
  801696:	00 
  801697:	c7 04 24 a8 2a 81 00 	movl   $0x812aa8,(%esp)
  80169e:	e8 f9 f2 ff ff       	call   80099c <_panic>

int
sys_ipc_try_send(envid_t envid, uint32_t value, void *srcva, int perm)
{
	return syscall(SYS_ipc_try_send, 1, envid, value, (uint32_t) srcva, perm, 0);
}
  8016a3:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  8016a6:	8b 75 f8             	mov    -0x8(%ebp),%esi
  8016a9:	8b 7d fc             	mov    -0x4(%ebp),%edi
  8016ac:	89 ec                	mov    %ebp,%esp
  8016ae:	5d                   	pop    %ebp
  8016af:	c3                   	ret    

008016b0 <sys_env_set_pgfault_upcall>:
	return syscall(SYS_env_set_trapframe, 1, envid, (uint32_t) tf, 0, 0, 0);
}

int
sys_env_set_pgfault_upcall(envid_t envid, void *upcall)
{
  8016b0:	55                   	push   %ebp
  8016b1:	89 e5                	mov    %esp,%ebp
  8016b3:	83 ec 38             	sub    $0x38,%esp
  8016b6:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  8016b9:	89 75 f8             	mov    %esi,-0x8(%ebp)
  8016bc:	89 7d fc             	mov    %edi,-0x4(%ebp)
	// 
	// The last clause tells the assembler that this can
	// potentially change the condition codes and arbitrary
	// memory locations.

	asm volatile("int %1\n"
  8016bf:	bb 00 00 00 00       	mov    $0x0,%ebx
  8016c4:	b8 0a 00 00 00       	mov    $0xa,%eax
  8016c9:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8016cc:	8b 55 08             	mov    0x8(%ebp),%edx
  8016cf:	89 df                	mov    %ebx,%edi
  8016d1:	89 de                	mov    %ebx,%esi
  8016d3:	cd 30                	int    $0x30
		  "b" (a3),
		  "D" (a4),
		  "S" (a5)
		: "cc", "memory");
	
	if(check && ret > 0)
  8016d5:	85 c0                	test   %eax,%eax
  8016d7:	7e 28                	jle    801701 <sys_env_set_pgfault_upcall+0x51>
		panic("syscall %d returned %d (> 0)", num, ret);
  8016d9:	89 44 24 10          	mov    %eax,0x10(%esp)
  8016dd:	c7 44 24 0c 0a 00 00 	movl   $0xa,0xc(%esp)
  8016e4:	00 
  8016e5:	c7 44 24 08 8b 2a 81 	movl   $0x812a8b,0x8(%esp)
  8016ec:	00 
  8016ed:	c7 44 24 04 23 00 00 	movl   $0x23,0x4(%esp)
  8016f4:	00 
  8016f5:	c7 04 24 a8 2a 81 00 	movl   $0x812aa8,(%esp)
  8016fc:	e8 9b f2 ff ff       	call   80099c <_panic>

int
sys_env_set_pgfault_upcall(envid_t envid, void *upcall)
{
	return syscall(SYS_env_set_pgfault_upcall, 1, envid, (uint32_t) upcall, 0, 0, 0);
}
  801701:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  801704:	8b 75 f8             	mov    -0x8(%ebp),%esi
  801707:	8b 7d fc             	mov    -0x4(%ebp),%edi
  80170a:	89 ec                	mov    %ebp,%esp
  80170c:	5d                   	pop    %ebp
  80170d:	c3                   	ret    

0080170e <sys_env_set_trapframe>:
	return syscall(SYS_env_set_status, 1, envid, status, 0, 0, 0);
}

int
sys_env_set_trapframe(envid_t envid, struct Trapframe *tf)
{
  80170e:	55                   	push   %ebp
  80170f:	89 e5                	mov    %esp,%ebp
  801711:	83 ec 38             	sub    $0x38,%esp
  801714:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  801717:	89 75 f8             	mov    %esi,-0x8(%ebp)
  80171a:	89 7d fc             	mov    %edi,-0x4(%ebp)
	// 
	// The last clause tells the assembler that this can
	// potentially change the condition codes and arbitrary
	// memory locations.

	asm volatile("int %1\n"
  80171d:	bb 00 00 00 00       	mov    $0x0,%ebx
  801722:	b8 09 00 00 00       	mov    $0x9,%eax
  801727:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  80172a:	8b 55 08             	mov    0x8(%ebp),%edx
  80172d:	89 df                	mov    %ebx,%edi
  80172f:	89 de                	mov    %ebx,%esi
  801731:	cd 30                	int    $0x30
		  "b" (a3),
		  "D" (a4),
		  "S" (a5)
		: "cc", "memory");
	
	if(check && ret > 0)
  801733:	85 c0                	test   %eax,%eax
  801735:	7e 28                	jle    80175f <sys_env_set_trapframe+0x51>
		panic("syscall %d returned %d (> 0)", num, ret);
  801737:	89 44 24 10          	mov    %eax,0x10(%esp)
  80173b:	c7 44 24 0c 09 00 00 	movl   $0x9,0xc(%esp)
  801742:	00 
  801743:	c7 44 24 08 8b 2a 81 	movl   $0x812a8b,0x8(%esp)
  80174a:	00 
  80174b:	c7 44 24 04 23 00 00 	movl   $0x23,0x4(%esp)
  801752:	00 
  801753:	c7 04 24 a8 2a 81 00 	movl   $0x812aa8,(%esp)
  80175a:	e8 3d f2 ff ff       	call   80099c <_panic>

int
sys_env_set_trapframe(envid_t envid, struct Trapframe *tf)
{
	return syscall(SYS_env_set_trapframe, 1, envid, (uint32_t) tf, 0, 0, 0);
}
  80175f:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  801762:	8b 75 f8             	mov    -0x8(%ebp),%esi
  801765:	8b 7d fc             	mov    -0x4(%ebp),%edi
  801768:	89 ec                	mov    %ebp,%esp
  80176a:	5d                   	pop    %ebp
  80176b:	c3                   	ret    

0080176c <sys_env_set_status>:

// sys_exofork is inlined in lib.h

int
sys_env_set_status(envid_t envid, int status)
{
  80176c:	55                   	push   %ebp
  80176d:	89 e5                	mov    %esp,%ebp
  80176f:	83 ec 38             	sub    $0x38,%esp
  801772:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  801775:	89 75 f8             	mov    %esi,-0x8(%ebp)
  801778:	89 7d fc             	mov    %edi,-0x4(%ebp)
	// 
	// The last clause tells the assembler that this can
	// potentially change the condition codes and arbitrary
	// memory locations.

	asm volatile("int %1\n"
  80177b:	bb 00 00 00 00       	mov    $0x0,%ebx
  801780:	b8 08 00 00 00       	mov    $0x8,%eax
  801785:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801788:	8b 55 08             	mov    0x8(%ebp),%edx
  80178b:	89 df                	mov    %ebx,%edi
  80178d:	89 de                	mov    %ebx,%esi
  80178f:	cd 30                	int    $0x30
		  "b" (a3),
		  "D" (a4),
		  "S" (a5)
		: "cc", "memory");
	
	if(check && ret > 0)
  801791:	85 c0                	test   %eax,%eax
  801793:	7e 28                	jle    8017bd <sys_env_set_status+0x51>
		panic("syscall %d returned %d (> 0)", num, ret);
  801795:	89 44 24 10          	mov    %eax,0x10(%esp)
  801799:	c7 44 24 0c 08 00 00 	movl   $0x8,0xc(%esp)
  8017a0:	00 
  8017a1:	c7 44 24 08 8b 2a 81 	movl   $0x812a8b,0x8(%esp)
  8017a8:	00 
  8017a9:	c7 44 24 04 23 00 00 	movl   $0x23,0x4(%esp)
  8017b0:	00 
  8017b1:	c7 04 24 a8 2a 81 00 	movl   $0x812aa8,(%esp)
  8017b8:	e8 df f1 ff ff       	call   80099c <_panic>

int
sys_env_set_status(envid_t envid, int status)
{
	return syscall(SYS_env_set_status, 1, envid, status, 0, 0, 0);
}
  8017bd:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  8017c0:	8b 75 f8             	mov    -0x8(%ebp),%esi
  8017c3:	8b 7d fc             	mov    -0x4(%ebp),%edi
  8017c6:	89 ec                	mov    %ebp,%esp
  8017c8:	5d                   	pop    %ebp
  8017c9:	c3                   	ret    

008017ca <sys_page_unmap>:
	return syscall(SYS_page_map, 1, srcenv, (uint32_t) srcva, dstenv, (uint32_t) dstva, perm);
}

int
sys_page_unmap(envid_t envid, void *va)
{
  8017ca:	55                   	push   %ebp
  8017cb:	89 e5                	mov    %esp,%ebp
  8017cd:	83 ec 38             	sub    $0x38,%esp
  8017d0:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  8017d3:	89 75 f8             	mov    %esi,-0x8(%ebp)
  8017d6:	89 7d fc             	mov    %edi,-0x4(%ebp)
	// 
	// The last clause tells the assembler that this can
	// potentially change the condition codes and arbitrary
	// memory locations.

	asm volatile("int %1\n"
  8017d9:	bb 00 00 00 00       	mov    $0x0,%ebx
  8017de:	b8 06 00 00 00       	mov    $0x6,%eax
  8017e3:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8017e6:	8b 55 08             	mov    0x8(%ebp),%edx
  8017e9:	89 df                	mov    %ebx,%edi
  8017eb:	89 de                	mov    %ebx,%esi
  8017ed:	cd 30                	int    $0x30
		  "b" (a3),
		  "D" (a4),
		  "S" (a5)
		: "cc", "memory");
	
	if(check && ret > 0)
  8017ef:	85 c0                	test   %eax,%eax
  8017f1:	7e 28                	jle    80181b <sys_page_unmap+0x51>
		panic("syscall %d returned %d (> 0)", num, ret);
  8017f3:	89 44 24 10          	mov    %eax,0x10(%esp)
  8017f7:	c7 44 24 0c 06 00 00 	movl   $0x6,0xc(%esp)
  8017fe:	00 
  8017ff:	c7 44 24 08 8b 2a 81 	movl   $0x812a8b,0x8(%esp)
  801806:	00 
  801807:	c7 44 24 04 23 00 00 	movl   $0x23,0x4(%esp)
  80180e:	00 
  80180f:	c7 04 24 a8 2a 81 00 	movl   $0x812aa8,(%esp)
  801816:	e8 81 f1 ff ff       	call   80099c <_panic>

int
sys_page_unmap(envid_t envid, void *va)
{
	return syscall(SYS_page_unmap, 1, envid, (uint32_t) va, 0, 0, 0);
}
  80181b:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  80181e:	8b 75 f8             	mov    -0x8(%ebp),%esi
  801821:	8b 7d fc             	mov    -0x4(%ebp),%edi
  801824:	89 ec                	mov    %ebp,%esp
  801826:	5d                   	pop    %ebp
  801827:	c3                   	ret    

00801828 <sys_page_map>:
	return syscall(SYS_page_alloc, 1, envid, (uint32_t) va, perm, 0, 0);
}

int
sys_page_map(envid_t srcenv, void *srcva, envid_t dstenv, void *dstva, int perm)
{
  801828:	55                   	push   %ebp
  801829:	89 e5                	mov    %esp,%ebp
  80182b:	83 ec 38             	sub    $0x38,%esp
  80182e:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  801831:	89 75 f8             	mov    %esi,-0x8(%ebp)
  801834:	89 7d fc             	mov    %edi,-0x4(%ebp)
	// 
	// The last clause tells the assembler that this can
	// potentially change the condition codes and arbitrary
	// memory locations.

	asm volatile("int %1\n"
  801837:	b8 05 00 00 00       	mov    $0x5,%eax
  80183c:	8b 75 18             	mov    0x18(%ebp),%esi
  80183f:	8b 7d 14             	mov    0x14(%ebp),%edi
  801842:	8b 5d 10             	mov    0x10(%ebp),%ebx
  801845:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801848:	8b 55 08             	mov    0x8(%ebp),%edx
  80184b:	cd 30                	int    $0x30
		  "b" (a3),
		  "D" (a4),
		  "S" (a5)
		: "cc", "memory");
	
	if(check && ret > 0)
  80184d:	85 c0                	test   %eax,%eax
  80184f:	7e 28                	jle    801879 <sys_page_map+0x51>
		panic("syscall %d returned %d (> 0)", num, ret);
  801851:	89 44 24 10          	mov    %eax,0x10(%esp)
  801855:	c7 44 24 0c 05 00 00 	movl   $0x5,0xc(%esp)
  80185c:	00 
  80185d:	c7 44 24 08 8b 2a 81 	movl   $0x812a8b,0x8(%esp)
  801864:	00 
  801865:	c7 44 24 04 23 00 00 	movl   $0x23,0x4(%esp)
  80186c:	00 
  80186d:	c7 04 24 a8 2a 81 00 	movl   $0x812aa8,(%esp)
  801874:	e8 23 f1 ff ff       	call   80099c <_panic>

int
sys_page_map(envid_t srcenv, void *srcva, envid_t dstenv, void *dstva, int perm)
{
	return syscall(SYS_page_map, 1, srcenv, (uint32_t) srcva, dstenv, (uint32_t) dstva, perm);
}
  801879:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  80187c:	8b 75 f8             	mov    -0x8(%ebp),%esi
  80187f:	8b 7d fc             	mov    -0x4(%ebp),%edi
  801882:	89 ec                	mov    %ebp,%esp
  801884:	5d                   	pop    %ebp
  801885:	c3                   	ret    

00801886 <sys_page_alloc>:
	syscall(SYS_yield, 0, 0, 0, 0, 0, 0);
}

int
sys_page_alloc(envid_t envid, void *va, int perm)
{
  801886:	55                   	push   %ebp
  801887:	89 e5                	mov    %esp,%ebp
  801889:	83 ec 38             	sub    $0x38,%esp
  80188c:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  80188f:	89 75 f8             	mov    %esi,-0x8(%ebp)
  801892:	89 7d fc             	mov    %edi,-0x4(%ebp)
	// 
	// The last clause tells the assembler that this can
	// potentially change the condition codes and arbitrary
	// memory locations.

	asm volatile("int %1\n"
  801895:	be 00 00 00 00       	mov    $0x0,%esi
  80189a:	b8 04 00 00 00       	mov    $0x4,%eax
  80189f:	8b 5d 10             	mov    0x10(%ebp),%ebx
  8018a2:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8018a5:	8b 55 08             	mov    0x8(%ebp),%edx
  8018a8:	89 f7                	mov    %esi,%edi
  8018aa:	cd 30                	int    $0x30
		  "b" (a3),
		  "D" (a4),
		  "S" (a5)
		: "cc", "memory");
	
	if(check && ret > 0)
  8018ac:	85 c0                	test   %eax,%eax
  8018ae:	7e 28                	jle    8018d8 <sys_page_alloc+0x52>
		panic("syscall %d returned %d (> 0)", num, ret);
  8018b0:	89 44 24 10          	mov    %eax,0x10(%esp)
  8018b4:	c7 44 24 0c 04 00 00 	movl   $0x4,0xc(%esp)
  8018bb:	00 
  8018bc:	c7 44 24 08 8b 2a 81 	movl   $0x812a8b,0x8(%esp)
  8018c3:	00 
  8018c4:	c7 44 24 04 23 00 00 	movl   $0x23,0x4(%esp)
  8018cb:	00 
  8018cc:	c7 04 24 a8 2a 81 00 	movl   $0x812aa8,(%esp)
  8018d3:	e8 c4 f0 ff ff       	call   80099c <_panic>

int
sys_page_alloc(envid_t envid, void *va, int perm)
{
	return syscall(SYS_page_alloc, 1, envid, (uint32_t) va, perm, 0, 0);
}
  8018d8:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  8018db:	8b 75 f8             	mov    -0x8(%ebp),%esi
  8018de:	8b 7d fc             	mov    -0x4(%ebp),%edi
  8018e1:	89 ec                	mov    %ebp,%esp
  8018e3:	5d                   	pop    %ebp
  8018e4:	c3                   	ret    

008018e5 <sys_yield>:
	 return syscall(SYS_getenvid, 0, 0, 0, 0, 0, 0);
}

void
sys_yield(void)
{
  8018e5:	55                   	push   %ebp
  8018e6:	89 e5                	mov    %esp,%ebp
  8018e8:	83 ec 0c             	sub    $0xc,%esp
  8018eb:	89 1c 24             	mov    %ebx,(%esp)
  8018ee:	89 74 24 04          	mov    %esi,0x4(%esp)
  8018f2:	89 7c 24 08          	mov    %edi,0x8(%esp)
	// 
	// The last clause tells the assembler that this can
	// potentially change the condition codes and arbitrary
	// memory locations.

	asm volatile("int %1\n"
  8018f6:	ba 00 00 00 00       	mov    $0x0,%edx
  8018fb:	b8 0b 00 00 00       	mov    $0xb,%eax
  801900:	89 d1                	mov    %edx,%ecx
  801902:	89 d3                	mov    %edx,%ebx
  801904:	89 d7                	mov    %edx,%edi
  801906:	89 d6                	mov    %edx,%esi
  801908:	cd 30                	int    $0x30

void
sys_yield(void)
{
	syscall(SYS_yield, 0, 0, 0, 0, 0, 0);
}
  80190a:	8b 1c 24             	mov    (%esp),%ebx
  80190d:	8b 74 24 04          	mov    0x4(%esp),%esi
  801911:	8b 7c 24 08          	mov    0x8(%esp),%edi
  801915:	89 ec                	mov    %ebp,%esp
  801917:	5d                   	pop    %ebp
  801918:	c3                   	ret    

00801919 <sys_getenvid>:
	return syscall(SYS_env_destroy, 1, envid, 0, 0, 0, 0);
}

envid_t
sys_getenvid(void)
{
  801919:	55                   	push   %ebp
  80191a:	89 e5                	mov    %esp,%ebp
  80191c:	83 ec 0c             	sub    $0xc,%esp
  80191f:	89 1c 24             	mov    %ebx,(%esp)
  801922:	89 74 24 04          	mov    %esi,0x4(%esp)
  801926:	89 7c 24 08          	mov    %edi,0x8(%esp)
	// 
	// The last clause tells the assembler that this can
	// potentially change the condition codes and arbitrary
	// memory locations.

	asm volatile("int %1\n"
  80192a:	ba 00 00 00 00       	mov    $0x0,%edx
  80192f:	b8 02 00 00 00       	mov    $0x2,%eax
  801934:	89 d1                	mov    %edx,%ecx
  801936:	89 d3                	mov    %edx,%ebx
  801938:	89 d7                	mov    %edx,%edi
  80193a:	89 d6                	mov    %edx,%esi
  80193c:	cd 30                	int    $0x30

envid_t
sys_getenvid(void)
{
	 return syscall(SYS_getenvid, 0, 0, 0, 0, 0, 0);
}
  80193e:	8b 1c 24             	mov    (%esp),%ebx
  801941:	8b 74 24 04          	mov    0x4(%esp),%esi
  801945:	8b 7c 24 08          	mov    0x8(%esp),%edi
  801949:	89 ec                	mov    %ebp,%esp
  80194b:	5d                   	pop    %ebp
  80194c:	c3                   	ret    

0080194d <sys_env_destroy>:
	return syscall(SYS_cgetc, 0, 0, 0, 0, 0, 0);
}

int
sys_env_destroy(envid_t envid)
{
  80194d:	55                   	push   %ebp
  80194e:	89 e5                	mov    %esp,%ebp
  801950:	83 ec 38             	sub    $0x38,%esp
  801953:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  801956:	89 75 f8             	mov    %esi,-0x8(%ebp)
  801959:	89 7d fc             	mov    %edi,-0x4(%ebp)
	// 
	// The last clause tells the assembler that this can
	// potentially change the condition codes and arbitrary
	// memory locations.

	asm volatile("int %1\n"
  80195c:	b9 00 00 00 00       	mov    $0x0,%ecx
  801961:	b8 03 00 00 00       	mov    $0x3,%eax
  801966:	8b 55 08             	mov    0x8(%ebp),%edx
  801969:	89 cb                	mov    %ecx,%ebx
  80196b:	89 cf                	mov    %ecx,%edi
  80196d:	89 ce                	mov    %ecx,%esi
  80196f:	cd 30                	int    $0x30
		  "b" (a3),
		  "D" (a4),
		  "S" (a5)
		: "cc", "memory");
	
	if(check && ret > 0)
  801971:	85 c0                	test   %eax,%eax
  801973:	7e 28                	jle    80199d <sys_env_destroy+0x50>
		panic("syscall %d returned %d (> 0)", num, ret);
  801975:	89 44 24 10          	mov    %eax,0x10(%esp)
  801979:	c7 44 24 0c 03 00 00 	movl   $0x3,0xc(%esp)
  801980:	00 
  801981:	c7 44 24 08 8b 2a 81 	movl   $0x812a8b,0x8(%esp)
  801988:	00 
  801989:	c7 44 24 04 23 00 00 	movl   $0x23,0x4(%esp)
  801990:	00 
  801991:	c7 04 24 a8 2a 81 00 	movl   $0x812aa8,(%esp)
  801998:	e8 ff ef ff ff       	call   80099c <_panic>

int
sys_env_destroy(envid_t envid)
{
	return syscall(SYS_env_destroy, 1, envid, 0, 0, 0, 0);
}
  80199d:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  8019a0:	8b 75 f8             	mov    -0x8(%ebp),%esi
  8019a3:	8b 7d fc             	mov    -0x4(%ebp),%edi
  8019a6:	89 ec                	mov    %ebp,%esp
  8019a8:	5d                   	pop    %ebp
  8019a9:	c3                   	ret    
  8019aa:	00 00                	add    %al,(%eax)
  8019ac:	00 00                	add    %al,(%eax)
	...

008019b0 <sfork>:
}

// Challenge!
int
sfork(void)
{
  8019b0:	55                   	push   %ebp
  8019b1:	89 e5                	mov    %esp,%ebp
  8019b3:	83 ec 18             	sub    $0x18,%esp
	panic("sfork not implemented");
  8019b6:	c7 44 24 08 b6 2a 81 	movl   $0x812ab6,0x8(%esp)
  8019bd:	00 
  8019be:	c7 44 24 04 9a 00 00 	movl   $0x9a,0x4(%esp)
  8019c5:	00 
  8019c6:	c7 04 24 cc 2a 81 00 	movl   $0x812acc,(%esp)
  8019cd:	e8 ca ef ff ff       	call   80099c <_panic>

008019d2 <fork>:
//   Neither user exception stack should ever be marked copy-on-write,
//   so you must allocate a new page for the child's user exception stack.
//
envid_t
fork(void)
{
  8019d2:	55                   	push   %ebp
  8019d3:	89 e5                	mov    %esp,%ebp
  8019d5:	57                   	push   %edi
  8019d6:	56                   	push   %esi
  8019d7:	53                   	push   %ebx
  8019d8:	83 ec 3c             	sub    $0x3c,%esp
    int r   = 0;
    int i;
    envid_t childId = 0;
	// LAB 4: Your code here.
    // Setup parent process pgfault handler.
    set_pgfault_handler(pgfault);
  8019db:	c7 04 24 3c 1c 80 00 	movl   $0x801c3c,(%esp)
  8019e2:	e8 dd 1a 00 00       	call   8034c4 <set_pgfault_handler>
static __inline envid_t sys_exofork(void) __attribute__((always_inline));
static __inline envid_t
sys_exofork(void)
{
	envid_t ret;
	__asm __volatile("int %2"
  8019e7:	ba 07 00 00 00       	mov    $0x7,%edx
  8019ec:	89 d0                	mov    %edx,%eax
  8019ee:	cd 30                	int    $0x30
  8019f0:	89 45 d8             	mov    %eax,-0x28(%ebp)
    childId=sys_exofork();

    if (childId<0) {
  8019f3:	85 c0                	test   %eax,%eax
  8019f5:	79 20                	jns    801a17 <fork+0x45>
        panic("Parent: sys_exofork. Error: 0x%x\n", childId);
  8019f7:	89 44 24 0c          	mov    %eax,0xc(%esp)
  8019fb:	c7 44 24 08 3c 2b 81 	movl   $0x812b3c,0x8(%esp)
  801a02:	00 
  801a03:	c7 44 24 04 7b 00 00 	movl   $0x7b,0x4(%esp)
  801a0a:	00 
  801a0b:	c7 04 24 cc 2a 81 00 	movl   $0x812acc,(%esp)
  801a12:	e8 85 ef ff ff       	call   80099c <_panic>
    } else if (childId>0) {
  801a17:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  801a1b:	0f 8e f3 01 00 00    	jle    801c14 <fork+0x242>
      // Setup child process' pgfault handler.
      if ((r=sys_env_set_pgfault_upcall(childId, _pgfault_upcall))) {
  801a21:	c7 44 24 04 34 35 80 	movl   $0x803534,0x4(%esp)
  801a28:	00 
  801a29:	8b 45 d8             	mov    -0x28(%ebp),%eax
  801a2c:	89 04 24             	mov    %eax,(%esp)
  801a2f:	e8 7c fc ff ff       	call   8016b0 <sys_env_set_pgfault_upcall>
  801a34:	85 c0                	test   %eax,%eax
  801a36:	74 20                	je     801a58 <fork+0x86>
          panic("Child: sys_env_set_pgfault_upcall. Error: %d\n", r);
  801a38:	89 44 24 0c          	mov    %eax,0xc(%esp)
  801a3c:	c7 44 24 08 60 2b 81 	movl   $0x812b60,0x8(%esp)
  801a43:	00 
  801a44:	c7 44 24 04 7f 00 00 	movl   $0x7f,0x4(%esp)
  801a4b:	00 
  801a4c:	c7 04 24 cc 2a 81 00 	movl   $0x812acc,(%esp)
  801a53:	e8 44 ef ff ff       	call   80099c <_panic>
      }
      
      // Setup child's Image.
      // Allocate page for child's user exception stack.
      if ((r=sys_page_alloc(childId, (void *)(UXSTACKTOP-PGSIZE), PTE_U|PTE_P|PTE_W))<0) {
  801a58:	c7 44 24 08 07 00 00 	movl   $0x7,0x8(%esp)
  801a5f:	00 
  801a60:	c7 44 24 04 00 f0 bf 	movl   $0xeebff000,0x4(%esp)
  801a67:	ee 
  801a68:	8b 45 d8             	mov    -0x28(%ebp),%eax
  801a6b:	89 04 24             	mov    %eax,(%esp)
  801a6e:	e8 13 fe ff ff       	call   801886 <sys_page_alloc>
  801a73:	85 c0                	test   %eax,%eax
  801a75:	79 20                	jns    801a97 <fork+0xc5>
          panic("Parent: sys_page_alloc. Error: 0x%x\n", r);           
  801a77:	89 44 24 0c          	mov    %eax,0xc(%esp)
  801a7b:	c7 44 24 08 90 2b 81 	movl   $0x812b90,0x8(%esp)
  801a82:	00 
  801a83:	c7 44 24 04 85 00 00 	movl   $0x85,0x4(%esp)
  801a8a:	00 
  801a8b:	c7 04 24 cc 2a 81 00 	movl   $0x812acc,(%esp)
  801a92:	e8 05 ef ff ff       	call   80099c <_panic>
  801a97:	be 00 00 80 00       	mov    $0x800000,%esi
  801a9c:	bb 00 00 80 00       	mov    $0x800000,%ebx
      }

      // Copy Parent's address space to child.
      for (i=UTEXT;i<USTACKTOP;i+=PGSIZE)
        if (vpd[VPD(i)]&PTE_P)
  801aa1:	bf 00 d0 7b ef       	mov    $0xef7bd000,%edi
  801aa6:	89 f0                	mov    %esi,%eax
  801aa8:	c1 e8 16             	shr    $0x16,%eax
  801aab:	8b 04 87             	mov    (%edi,%eax,4),%eax
  801aae:	a8 01                	test   $0x1,%al
  801ab0:	0f 84 13 01 00 00    	je     801bc9 <fork+0x1f7>
// 
static int
duppage(envid_t envid, unsigned pn)
{
	int r           = 0;
  int perm        = vpt[VPN(pn)]&PTE_USER;
  801ab6:	89 f0                	mov    %esi,%eax
  801ab8:	c1 e8 0c             	shr    $0xc,%eax
  801abb:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  801ac2:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  801ac5:	25 07 0e 00 00       	and    $0xe07,%eax
  801aca:	89 45 e0             	mov    %eax,-0x20(%ebp)
  envid_t env_id  = sys_getenvid();
  801acd:	e8 47 fe ff ff       	call   801919 <sys_getenvid>
  801ad2:	89 45 dc             	mov    %eax,-0x24(%ebp)

	// LAB 4: Your code here.
  if ((perm&PTE_P) && (perm&PTE_W || perm&PTE_COW) && (!(perm&PTE_SHARE))) {
  801ad5:	f6 45 e4 01          	testb  $0x1,-0x1c(%ebp)
  801ad9:	0f 84 ea 00 00 00    	je     801bc9 <fork+0x1f7>
  801adf:	f7 45 e0 02 08 00 00 	testl  $0x802,-0x20(%ebp)
  801ae6:	0f 84 9d 00 00 00    	je     801b89 <fork+0x1b7>
  801aec:	f7 45 e0 00 04 00 00 	testl  $0x400,-0x20(%ebp)
  801af3:	0f 85 90 00 00 00    	jne    801b89 <fork+0x1b7>
    perm    &= (~PTE_W);
  801af9:	8b 45 e0             	mov    -0x20(%ebp),%eax
  801afc:	83 e0 fd             	and    $0xfffffffd,%eax
    perm    |= PTE_COW;
  801aff:	80 cc 08             	or     $0x8,%ah
  801b02:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    
    if ((r=sys_page_map(env_id, (void *)pn, envid, (void *)pn, perm))<0)
  801b05:	89 75 e0             	mov    %esi,-0x20(%ebp)
  801b08:	89 44 24 10          	mov    %eax,0x10(%esp)
  801b0c:	89 74 24 0c          	mov    %esi,0xc(%esp)
  801b10:	8b 45 d8             	mov    -0x28(%ebp),%eax
  801b13:	89 44 24 08          	mov    %eax,0x8(%esp)
  801b17:	89 74 24 04          	mov    %esi,0x4(%esp)
  801b1b:	8b 45 dc             	mov    -0x24(%ebp),%eax
  801b1e:	89 04 24             	mov    %eax,(%esp)
  801b21:	e8 02 fd ff ff       	call   801828 <sys_page_map>
  801b26:	85 c0                	test   %eax,%eax
  801b28:	79 1b                	jns    801b45 <fork+0x173>
      cprintf("[0x%x] Mapping to CHILD: sys_page_map. Address 0x%x. Error: %d\n", env_id, pn, r);
  801b2a:	89 44 24 0c          	mov    %eax,0xc(%esp)
  801b2e:	89 74 24 08          	mov    %esi,0x8(%esp)
  801b32:	8b 45 dc             	mov    -0x24(%ebp),%eax
  801b35:	89 44 24 04          	mov    %eax,0x4(%esp)
  801b39:	c7 04 24 b8 2b 81 00 	movl   $0x812bb8,(%esp)
  801b40:	e8 1c ef ff ff       	call   800a61 <cprintf>
    // Map permissions back to parent on COW.
    if ((r=sys_page_map(envid, (void *)pn, env_id, (void *)pn, perm))<0)
  801b45:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  801b48:	89 44 24 10          	mov    %eax,0x10(%esp)
  801b4c:	8b 45 e0             	mov    -0x20(%ebp),%eax
  801b4f:	89 44 24 0c          	mov    %eax,0xc(%esp)
  801b53:	8b 45 dc             	mov    -0x24(%ebp),%eax
  801b56:	89 44 24 08          	mov    %eax,0x8(%esp)
  801b5a:	8b 45 e0             	mov    -0x20(%ebp),%eax
  801b5d:	89 44 24 04          	mov    %eax,0x4(%esp)
  801b61:	8b 45 d8             	mov    -0x28(%ebp),%eax
  801b64:	89 04 24             	mov    %eax,(%esp)
  801b67:	e8 bc fc ff ff       	call   801828 <sys_page_map>
  801b6c:	85 c0                	test   %eax,%eax
  801b6e:	79 59                	jns    801bc9 <fork+0x1f7>
      cprintf("[0x%x] Mapping to PARENT: sys_page_map. Error: %d\n", env_id, r);
  801b70:	89 44 24 08          	mov    %eax,0x8(%esp)
  801b74:	8b 45 dc             	mov    -0x24(%ebp),%eax
  801b77:	89 44 24 04          	mov    %eax,0x4(%esp)
  801b7b:	c7 04 24 f8 2b 81 00 	movl   $0x812bf8,(%esp)
  801b82:	e8 da ee ff ff       	call   800a61 <cprintf>
  801b87:	eb 40                	jmp    801bc9 <fork+0x1f7>
  } else if (perm&PTE_P){
    if ((r=sys_page_map(env_id, (void *)pn, envid, (void *)pn, perm))<0)
  801b89:	8b 45 e0             	mov    -0x20(%ebp),%eax
  801b8c:	89 44 24 10          	mov    %eax,0x10(%esp)
  801b90:	89 74 24 0c          	mov    %esi,0xc(%esp)
  801b94:	8b 45 d8             	mov    -0x28(%ebp),%eax
  801b97:	89 44 24 08          	mov    %eax,0x8(%esp)
  801b9b:	89 74 24 04          	mov    %esi,0x4(%esp)
  801b9f:	8b 45 dc             	mov    -0x24(%ebp),%eax
  801ba2:	89 04 24             	mov    %eax,(%esp)
  801ba5:	e8 7e fc ff ff       	call   801828 <sys_page_map>
  801baa:	85 c0                	test   %eax,%eax
  801bac:	79 1b                	jns    801bc9 <fork+0x1f7>
      cprintf("[0x%x] Mapping to CHILD: sys_page_map. Address 0x%x. Error: %d\n", env_id, pn, r);
  801bae:	89 44 24 0c          	mov    %eax,0xc(%esp)
  801bb2:	89 74 24 08          	mov    %esi,0x8(%esp)
  801bb6:	8b 45 dc             	mov    -0x24(%ebp),%eax
  801bb9:	89 44 24 04          	mov    %eax,0x4(%esp)
  801bbd:	c7 04 24 b8 2b 81 00 	movl   $0x812bb8,(%esp)
  801bc4:	e8 98 ee ff ff       	call   800a61 <cprintf>
      if ((r=sys_page_alloc(childId, (void *)(UXSTACKTOP-PGSIZE), PTE_U|PTE_P|PTE_W))<0) {
          panic("Parent: sys_page_alloc. Error: 0x%x\n", r);           
      }

      // Copy Parent's address space to child.
      for (i=UTEXT;i<USTACKTOP;i+=PGSIZE)
  801bc9:	81 c3 00 10 00 00    	add    $0x1000,%ebx
  801bcf:	89 de                	mov    %ebx,%esi
  801bd1:	81 fb 00 e0 bf ee    	cmp    $0xeebfe000,%ebx
  801bd7:	0f 85 c9 fe ff ff    	jne    801aa6 <fork+0xd4>
        if (vpd[VPD(i)]&PTE_P)
          duppage(childId, i);

      // Set child as runnable.
      if ((r = sys_env_set_status(childId, ENV_RUNNABLE)) < 0)
  801bdd:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  801be4:	00 
  801be5:	8b 45 d8             	mov    -0x28(%ebp),%eax
  801be8:	89 04 24             	mov    %eax,(%esp)
  801beb:	e8 7c fb ff ff       	call   80176c <sys_env_set_status>
  801bf0:	85 c0                	test   %eax,%eax
  801bf2:	79 3d                	jns    801c31 <fork+0x25f>
        panic("Parent: sys_env_set_status: %e\n", r);
  801bf4:	89 44 24 0c          	mov    %eax,0xc(%esp)
  801bf8:	c7 44 24 08 2c 2c 81 	movl   $0x812c2c,0x8(%esp)
  801bff:	00 
  801c00:	c7 44 24 04 8f 00 00 	movl   $0x8f,0x4(%esp)
  801c07:	00 
  801c08:	c7 04 24 cc 2a 81 00 	movl   $0x812acc,(%esp)
  801c0f:	e8 88 ed ff ff       	call   80099c <_panic>
    } else if (childId==0) {
  801c14:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  801c18:	75 17                	jne    801c31 <fork+0x25f>
      env = &envs [ENVX(sys_getenvid())];
  801c1a:	e8 fa fc ff ff       	call   801919 <sys_getenvid>
  801c1f:	25 ff 03 00 00       	and    $0x3ff,%eax
  801c24:	6b c0 7c             	imul   $0x7c,%eax,%eax
  801c27:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  801c2c:	a3 f4 f5 b3 00       	mov    %eax,0xb3f5f4
    }
    return childId;
}
  801c31:	8b 45 d8             	mov    -0x28(%ebp),%eax
  801c34:	83 c4 3c             	add    $0x3c,%esp
  801c37:	5b                   	pop    %ebx
  801c38:	5e                   	pop    %esi
  801c39:	5f                   	pop    %edi
  801c3a:	5d                   	pop    %ebp
  801c3b:	c3                   	ret    

00801c3c <pgfault>:
// Custom page fault handler - if faulting page is copy-on-write,
// map in our own private writable copy.
//
static void
pgfault(struct UTrapframe *utf)
{
  801c3c:	55                   	push   %ebp
  801c3d:	89 e5                	mov    %esp,%ebp
  801c3f:	57                   	push   %edi
  801c40:	56                   	push   %esi
  801c41:	53                   	push   %ebx
  801c42:	83 ec 3c             	sub    $0x3c,%esp
  void *addr    = (void *) utf->utf_fault_va;
  801c45:	8b 45 08             	mov    0x8(%ebp),%eax
  801c48:	8b 38                	mov    (%eax),%edi
  uint32_t err  = utf->utf_err;
  801c4a:	8b 50 04             	mov    0x4(%eax),%edx
  801c4d:	89 55 e4             	mov    %edx,-0x1c(%ebp)
  int r         = 0;
  int perm      = 0;
  void *align   = (void *)((int)addr&(~0xFFF));
  801c50:	89 fe                	mov    %edi,%esi
  801c52:	81 e6 00 f0 ff ff    	and    $0xfffff000,%esi
  envid_t envid = sys_getenvid();
  801c58:	e8 bc fc ff ff       	call   801919 <sys_getenvid>
  801c5d:	89 c3                	mov    %eax,%ebx
	// copy-on-write page.  If not, panic.
	// Hint:
	//   Use the read-only page table mappings at vpt
	//   (see <inc/memlayout.h>).

  if ((vpd[VPD(align)]&PTE_P) && (vpt[VPN(align)]&PTE_P))
  801c5f:	89 f2                	mov    %esi,%edx
  801c61:	89 f0                	mov    %esi,%eax
  801c63:	c1 e8 16             	shr    $0x16,%eax
  801c66:	8b 04 85 00 d0 7b ef 	mov    -0x10843000(,%eax,4),%eax
  801c6d:	a8 01                	test   $0x1,%al
  801c6f:	74 3e                	je     801caf <pgfault+0x73>
  801c71:	c1 ea 0c             	shr    $0xc,%edx
  801c74:	8b 04 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%eax
  801c7b:	a8 01                	test   $0x1,%al
  801c7d:	74 30                	je     801caf <pgfault+0x73>
    perm  = vpt[VPN(addr)]&PTE_USER;
  801c7f:	c1 ef 0c             	shr    $0xc,%edi
  801c82:	8b 3c bd 00 00 40 ef 	mov    -0x10c00000(,%edi,4),%edi
	// page to the old page's address.
	// Hint:
	//   You should make three system calls.
	//   No need to explicitly delete the old page's mapping.
	// LAB 4: Your code here.
  perm    &= (~PTE_COW);
  801c89:	81 e7 07 06 00 00    	and    $0x607,%edi
  perm    |= PTE_W;
  801c8f:	83 cf 02             	or     $0x2,%edi
  if (!(r=sys_page_alloc(envid, (void *)PFTEMP, perm))) {
  801c92:	89 7c 24 08          	mov    %edi,0x8(%esp)
  801c96:	c7 44 24 04 00 f0 7f 	movl   $0x7ff000,0x4(%esp)
  801c9d:	00 
  801c9e:	89 1c 24             	mov    %ebx,(%esp)
  801ca1:	e8 e0 fb ff ff       	call   801886 <sys_page_alloc>
  801ca6:	85 c0                	test   %eax,%eax
  801ca8:	74 46                	je     801cf0 <pgfault+0xb4>
  801caa:	e9 cd 00 00 00       	jmp    801d7c <pgfault+0x140>
	//   (see <inc/memlayout.h>).

  if ((vpd[VPD(align)]&PTE_P) && (vpt[VPN(align)]&PTE_P))
    perm  = vpt[VPN(addr)]&PTE_USER;
  else {
    cprintf("Tryig to acess address: %x eip: %x Err: %x\n", align, utf->utf_eip, err);
  801caf:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  801cb2:	89 44 24 0c          	mov    %eax,0xc(%esp)
  801cb6:	8b 55 08             	mov    0x8(%ebp),%edx
  801cb9:	8b 42 28             	mov    0x28(%edx),%eax
  801cbc:	89 44 24 08          	mov    %eax,0x8(%esp)
  801cc0:	89 74 24 04          	mov    %esi,0x4(%esp)
  801cc4:	c7 04 24 4c 2c 81 00 	movl   $0x812c4c,(%esp)
  801ccb:	e8 91 ed ff ff       	call   800a61 <cprintf>
    panic("Go to hell :[%x]\n", envid);
  801cd0:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  801cd4:	c7 44 24 08 d7 2a 81 	movl   $0x812ad7,0x8(%esp)
  801cdb:	00 
  801cdc:	c7 44 24 04 24 00 00 	movl   $0x24,0x4(%esp)
  801ce3:	00 
  801ce4:	c7 04 24 cc 2a 81 00 	movl   $0x812acc,(%esp)
  801ceb:	e8 ac ec ff ff       	call   80099c <_panic>
	//   No need to explicitly delete the old page's mapping.
	// LAB 4: Your code here.
  perm    &= (~PTE_COW);
  perm    |= PTE_W;
  if (!(r=sys_page_alloc(envid, (void *)PFTEMP, perm))) {
    memmove((void *)PFTEMP, align, PGSIZE);
  801cf0:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
  801cf7:	00 
  801cf8:	89 74 24 04          	mov    %esi,0x4(%esp)
  801cfc:	c7 04 24 00 f0 7f 00 	movl   $0x7ff000,(%esp)
  801d03:	e8 dd f5 ff ff       	call   8012e5 <memmove>
    if((r=sys_page_map(envid, (void *)PFTEMP, envid, align, perm)))
  801d08:	89 7c 24 10          	mov    %edi,0x10(%esp)
  801d0c:	89 74 24 0c          	mov    %esi,0xc(%esp)
  801d10:	89 5c 24 08          	mov    %ebx,0x8(%esp)
  801d14:	c7 44 24 04 00 f0 7f 	movl   $0x7ff000,0x4(%esp)
  801d1b:	00 
  801d1c:	89 1c 24             	mov    %ebx,(%esp)
  801d1f:	e8 04 fb ff ff       	call   801828 <sys_page_map>
  801d24:	85 c0                	test   %eax,%eax
  801d26:	74 20                	je     801d48 <pgfault+0x10c>
      panic("sys_page_map. Error: 0x%x\n", r);
  801d28:	89 44 24 0c          	mov    %eax,0xc(%esp)
  801d2c:	c7 44 24 08 e9 2a 81 	movl   $0x812ae9,0x8(%esp)
  801d33:	00 
  801d34:	c7 44 24 04 34 00 00 	movl   $0x34,0x4(%esp)
  801d3b:	00 
  801d3c:	c7 04 24 cc 2a 81 00 	movl   $0x812acc,(%esp)
  801d43:	e8 54 ec ff ff       	call   80099c <_panic>

    if ((r=sys_page_unmap(envid, (void *)PFTEMP)))
  801d48:	c7 44 24 04 00 f0 7f 	movl   $0x7ff000,0x4(%esp)
  801d4f:	00 
  801d50:	89 1c 24             	mov    %ebx,(%esp)
  801d53:	e8 72 fa ff ff       	call   8017ca <sys_page_unmap>
  801d58:	85 c0                	test   %eax,%eax
  801d5a:	74 40                	je     801d9c <pgfault+0x160>
      panic("sys_page_unmap. Error: 0x%x\n", r);
  801d5c:	89 44 24 0c          	mov    %eax,0xc(%esp)
  801d60:	c7 44 24 08 04 2b 81 	movl   $0x812b04,0x8(%esp)
  801d67:	00 
  801d68:	c7 44 24 04 37 00 00 	movl   $0x37,0x4(%esp)
  801d6f:	00 
  801d70:	c7 04 24 cc 2a 81 00 	movl   $0x812acc,(%esp)
  801d77:	e8 20 ec ff ff       	call   80099c <_panic>
  } else
    panic("sys_page_alloc. Error: %d\n", r);
  801d7c:	89 44 24 0c          	mov    %eax,0xc(%esp)
  801d80:	c7 44 24 08 21 2b 81 	movl   $0x812b21,0x8(%esp)
  801d87:	00 
  801d88:	c7 44 24 04 39 00 00 	movl   $0x39,0x4(%esp)
  801d8f:	00 
  801d90:	c7 04 24 cc 2a 81 00 	movl   $0x812acc,(%esp)
  801d97:	e8 00 ec ff ff       	call   80099c <_panic>
}
  801d9c:	83 c4 3c             	add    $0x3c,%esp
  801d9f:	5b                   	pop    %ebx
  801da0:	5e                   	pop    %esi
  801da1:	5f                   	pop    %edi
  801da2:	5d                   	pop    %ebp
  801da3:	c3                   	ret    
	...

00801db0 <ipc_send>:
//   Use sys_yield() to be CPU-friendly.
//   If 'pg' is null, pass sys_ipc_recv a value that it will understand
//   as meaning "no page".  (Zero is not the right value.)
void
ipc_send(envid_t to_env, uint32_t val, void *pg, int perm)
{
  801db0:	55                   	push   %ebp
  801db1:	89 e5                	mov    %esp,%ebp
  801db3:	57                   	push   %edi
  801db4:	56                   	push   %esi
  801db5:	53                   	push   %ebx
  801db6:	83 ec 2c             	sub    $0x2c,%esp
  801db9:	8b 75 08             	mov    0x8(%ebp),%esi
  801dbc:	8b 7d 0c             	mov    0xc(%ebp),%edi
  801dbf:	8b 5d 10             	mov    0x10(%ebp),%ebx
  int r   = 0;
  while (1) {
    if ((r=sys_ipc_try_send(to_env, val, (pg==NULL?(void *)UTOP:pg), perm)) == -E_IPC_NOT_RECV)
  801dc2:	85 db                	test   %ebx,%ebx
  801dc4:	b8 00 00 c0 ee       	mov    $0xeec00000,%eax
  801dc9:	0f 45 c3             	cmovne %ebx,%eax
  801dcc:	8b 55 14             	mov    0x14(%ebp),%edx
  801dcf:	89 54 24 0c          	mov    %edx,0xc(%esp)
  801dd3:	89 44 24 08          	mov    %eax,0x8(%esp)
  801dd7:	89 7c 24 04          	mov    %edi,0x4(%esp)
  801ddb:	89 34 24             	mov    %esi,(%esp)
  801dde:	e8 6d f8 ff ff       	call   801650 <sys_ipc_try_send>
  801de3:	83 f8 f9             	cmp    $0xfffffff9,%eax
  801de6:	75 0a                	jne    801df2 <ipc_send+0x42>
      sys_yield();
  801de8:	e8 f8 fa ff ff       	call   8018e5 <sys_yield>
    else if (r < 0)
      panic("ipc_send to [%x] failed. Error: %x\n", to_env, r);
    else
      return;
  }
  801ded:	8d 76 00             	lea    0x0(%esi),%esi
  801df0:	eb d0                	jmp    801dc2 <ipc_send+0x12>
{
  int r   = 0;
  while (1) {
    if ((r=sys_ipc_try_send(to_env, val, (pg==NULL?(void *)UTOP:pg), perm)) == -E_IPC_NOT_RECV)
      sys_yield();
    else if (r < 0)
  801df2:	85 c0                	test   %eax,%eax
  801df4:	79 24                	jns    801e1a <ipc_send+0x6a>
      panic("ipc_send to [%x] failed. Error: %x\n", to_env, r);
  801df6:	89 44 24 10          	mov    %eax,0x10(%esp)
  801dfa:	89 74 24 0c          	mov    %esi,0xc(%esp)
  801dfe:	c7 44 24 08 78 2c 81 	movl   $0x812c78,0x8(%esp)
  801e05:	00 
  801e06:	c7 44 24 04 36 00 00 	movl   $0x36,0x4(%esp)
  801e0d:	00 
  801e0e:	c7 04 24 9c 2c 81 00 	movl   $0x812c9c,(%esp)
  801e15:	e8 82 eb ff ff       	call   80099c <_panic>
    else
      return;
  }
}
  801e1a:	83 c4 2c             	add    $0x2c,%esp
  801e1d:	5b                   	pop    %ebx
  801e1e:	5e                   	pop    %esi
  801e1f:	5f                   	pop    %edi
  801e20:	5d                   	pop    %ebp
  801e21:	c3                   	ret    

00801e22 <ipc_recv>:
//   If 'pg' is null, pass sys_ipc_recv a value that it will understand
//   as meaning "no page".  (Zero is not the right value, since that's
//   a perfectly valid place to map a page.)
int32_t
ipc_recv(envid_t *from_env_store, void *pg, int *perm_store)
{
  801e22:	55                   	push   %ebp
  801e23:	89 e5                	mov    %esp,%ebp
  801e25:	56                   	push   %esi
  801e26:	53                   	push   %ebx
  801e27:	83 ec 10             	sub    $0x10,%esp
  801e2a:	8b 5d 08             	mov    0x8(%ebp),%ebx
  801e2d:	8b 45 0c             	mov    0xc(%ebp),%eax
  801e30:	8b 75 10             	mov    0x10(%ebp),%esi
  int r;
  if ((r=sys_ipc_recv((pg==NULL?(void *)UTOP:pg)))<0)
  801e33:	85 c0                	test   %eax,%eax
  801e35:	ba 00 00 c0 ee       	mov    $0xeec00000,%edx
  801e3a:	0f 44 c2             	cmove  %edx,%eax
  801e3d:	89 04 24             	mov    %eax,(%esp)
  801e40:	e8 ae f7 ff ff       	call   8015f3 <sys_ipc_recv>
  801e45:	85 c0                	test   %eax,%eax
  801e47:	78 24                	js     801e6d <ipc_recv+0x4b>
    return r;

  if (from_env_store)
  801e49:	85 db                	test   %ebx,%ebx
  801e4b:	74 0a                	je     801e57 <ipc_recv+0x35>
    *from_env_store = env->env_ipc_from;
  801e4d:	a1 f4 f5 b3 00       	mov    0xb3f5f4,%eax
  801e52:	8b 40 74             	mov    0x74(%eax),%eax
  801e55:	89 03                	mov    %eax,(%ebx)

  if (perm_store)
  801e57:	85 f6                	test   %esi,%esi
  801e59:	74 0a                	je     801e65 <ipc_recv+0x43>
    *perm_store     = env->env_ipc_perm;
  801e5b:	a1 f4 f5 b3 00       	mov    0xb3f5f4,%eax
  801e60:	8b 40 78             	mov    0x78(%eax),%eax
  801e63:	89 06                	mov    %eax,(%esi)

  return env->env_ipc_value;
  801e65:	a1 f4 f5 b3 00       	mov    0xb3f5f4,%eax
  801e6a:	8b 40 70             	mov    0x70(%eax),%eax
}
  801e6d:	83 c4 10             	add    $0x10,%esp
  801e70:	5b                   	pop    %ebx
  801e71:	5e                   	pop    %esi
  801e72:	5d                   	pop    %ebp
  801e73:	c3                   	ret    
	...

00801e80 <fd2num>:
// File descriptor manipulators
// --------------------------------------------------------------

int
fd2num(struct Fd *fd)
{
  801e80:	55                   	push   %ebp
  801e81:	89 e5                	mov    %esp,%ebp
  801e83:	8b 45 08             	mov    0x8(%ebp),%eax
  801e86:	05 00 00 00 30       	add    $0x30000000,%eax
  801e8b:	c1 e8 0c             	shr    $0xc,%eax
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
}
  801e8e:	5d                   	pop    %ebp
  801e8f:	c3                   	ret    

00801e90 <fd2data>:

char*
fd2data(struct Fd *fd)
{
  801e90:	55                   	push   %ebp
  801e91:	89 e5                	mov    %esp,%ebp
  801e93:	83 ec 04             	sub    $0x4,%esp
	return INDEX2DATA(fd2num(fd));
  801e96:	8b 45 08             	mov    0x8(%ebp),%eax
  801e99:	89 04 24             	mov    %eax,(%esp)
  801e9c:	e8 df ff ff ff       	call   801e80 <fd2num>
  801ea1:	05 20 00 0d 00       	add    $0xd0020,%eax
  801ea6:	c1 e0 0c             	shl    $0xc,%eax
}
  801ea9:	c9                   	leave  
  801eaa:	c3                   	ret    

00801eab <fd_alloc>:
// Returns 0 on success, < 0 on error.  Errors are:
//	-E_MAX_FD: no more file descriptors
// On error, *fd_store is set to 0.
int
fd_alloc(struct Fd **fd_store)
{
  801eab:	55                   	push   %ebp
  801eac:	89 e5                	mov    %esp,%ebp
  801eae:	57                   	push   %edi
  801eaf:	56                   	push   %esi
  801eb0:	53                   	push   %ebx
  801eb1:	8b 7d 08             	mov    0x8(%ebp),%edi
	int i;
	struct Fd *fd;

	for (i = 0; i < MAXFD; i++) {
		fd = INDEX2FD(i);
		if ((vpd[PDX(fd)] & PTE_P) == 0 || (vpt[VPN(fd)] & PTE_P) == 0) {
  801eb4:	a1 00 dd 7b ef       	mov    0xef7bdd00,%eax
  801eb9:	a8 01                	test   $0x1,%al
  801ebb:	74 36                	je     801ef3 <fd_alloc+0x48>
  801ebd:	a1 00 00 74 ef       	mov    0xef740000,%eax
  801ec2:	a8 01                	test   $0x1,%al
  801ec4:	74 2d                	je     801ef3 <fd_alloc+0x48>
  801ec6:	b8 00 10 00 d0       	mov    $0xd0001000,%eax
  801ecb:	b9 00 d0 7b ef       	mov    $0xef7bd000,%ecx
  801ed0:	be 00 00 40 ef       	mov    $0xef400000,%esi
  801ed5:	89 c3                	mov    %eax,%ebx
  801ed7:	89 c2                	mov    %eax,%edx
  801ed9:	c1 ea 16             	shr    $0x16,%edx
  801edc:	8b 14 91             	mov    (%ecx,%edx,4),%edx
  801edf:	f6 c2 01             	test   $0x1,%dl
  801ee2:	74 14                	je     801ef8 <fd_alloc+0x4d>
  801ee4:	89 c2                	mov    %eax,%edx
  801ee6:	c1 ea 0c             	shr    $0xc,%edx
  801ee9:	8b 14 96             	mov    (%esi,%edx,4),%edx
  801eec:	f6 c2 01             	test   $0x1,%dl
  801eef:	75 10                	jne    801f01 <fd_alloc+0x56>
  801ef1:	eb 05                	jmp    801ef8 <fd_alloc+0x4d>
  801ef3:	bb 00 00 00 d0       	mov    $0xd0000000,%ebx
			*fd_store = fd;
  801ef8:	89 1f                	mov    %ebx,(%edi)
  801efa:	b8 00 00 00 00       	mov    $0x0,%eax
			return 0;
  801eff:	eb 17                	jmp    801f18 <fd_alloc+0x6d>
  801f01:	05 00 10 00 00       	add    $0x1000,%eax
fd_alloc(struct Fd **fd_store)
{
	int i;
	struct Fd *fd;

	for (i = 0; i < MAXFD; i++) {
  801f06:	3d 00 00 02 d0       	cmp    $0xd0020000,%eax
  801f0b:	75 c8                	jne    801ed5 <fd_alloc+0x2a>
		if ((vpd[PDX(fd)] & PTE_P) == 0 || (vpt[VPN(fd)] & PTE_P) == 0) {
			*fd_store = fd;
			return 0;
		}
	}
	*fd_store = 0;
  801f0d:	c7 07 00 00 00 00    	movl   $0x0,(%edi)
  801f13:	b8 f6 ff ff ff       	mov    $0xfffffff6,%eax
	return -E_MAX_OPEN;
}
  801f18:	5b                   	pop    %ebx
  801f19:	5e                   	pop    %esi
  801f1a:	5f                   	pop    %edi
  801f1b:	5d                   	pop    %ebp
  801f1c:	c3                   	ret    

00801f1d <fd_lookup>:
// Returns 0 on success (the page is in range and mapped), < 0 on error.
// Errors are:
//	-E_INVAL: fdnum was either not in range or not mapped.
int
fd_lookup(int fdnum, struct Fd **fd_store)
{
  801f1d:	55                   	push   %ebp
  801f1e:	89 e5                	mov    %esp,%ebp
	struct Fd *fd=NULL;

	if (fdnum < 0 || fdnum >= MAXFD) {
  801f20:	8b 45 08             	mov    0x8(%ebp),%eax
  801f23:	83 f8 1f             	cmp    $0x1f,%eax
  801f26:	77 36                	ja     801f5e <fd_lookup+0x41>
		if (debug)
			cprintf("[%08x] bad fd %d\n", env->env_id, fd);
		return -E_INVAL;
	}
	fd = INDEX2FD(fdnum);
  801f28:	05 00 00 0d 00       	add    $0xd0000,%eax
  801f2d:	c1 e0 0c             	shl    $0xc,%eax
	if (!(vpd[PDX(fd)] & PTE_P) || !(vpt[VPN(fd)] & PTE_P)) {
  801f30:	89 c2                	mov    %eax,%edx
  801f32:	c1 ea 16             	shr    $0x16,%edx
  801f35:	8b 14 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%edx
  801f3c:	f6 c2 01             	test   $0x1,%dl
  801f3f:	74 1d                	je     801f5e <fd_lookup+0x41>
  801f41:	89 c2                	mov    %eax,%edx
  801f43:	c1 ea 0c             	shr    $0xc,%edx
  801f46:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  801f4d:	f6 c2 01             	test   $0x1,%dl
  801f50:	74 0c                	je     801f5e <fd_lookup+0x41>
		if (debug)
			cprintf("[%08x] closed fd %d\n", env->env_id, fd);
		return -E_INVAL;
	}
	*fd_store = fd;
  801f52:	8b 55 0c             	mov    0xc(%ebp),%edx
  801f55:	89 02                	mov    %eax,(%edx)
  801f57:	b8 00 00 00 00       	mov    $0x0,%eax
	return 0;
  801f5c:	eb 05                	jmp    801f63 <fd_lookup+0x46>
  801f5e:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
}
  801f63:	5d                   	pop    %ebp
  801f64:	c3                   	ret    

00801f65 <seek>:
	return (*dev->dev_write)(fd, buf, n);
}

int
seek(int fdnum, off_t offset)
{
  801f65:	55                   	push   %ebp
  801f66:	89 e5                	mov    %esp,%ebp
  801f68:	83 ec 18             	sub    $0x18,%esp
	int r;
	struct Fd *fd;
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801f6b:	8d 45 fc             	lea    -0x4(%ebp),%eax
  801f6e:	89 44 24 04          	mov    %eax,0x4(%esp)
  801f72:	8b 45 08             	mov    0x8(%ebp),%eax
  801f75:	89 04 24             	mov    %eax,(%esp)
  801f78:	e8 a0 ff ff ff       	call   801f1d <fd_lookup>
  801f7d:	85 c0                	test   %eax,%eax
  801f7f:	78 0e                	js     801f8f <seek+0x2a>
		return r;
	fd->fd_offset = offset;
  801f81:	8b 45 fc             	mov    -0x4(%ebp),%eax
  801f84:	8b 55 0c             	mov    0xc(%ebp),%edx
  801f87:	89 50 04             	mov    %edx,0x4(%eax)
  801f8a:	b8 00 00 00 00       	mov    $0x0,%eax
	return 0;
}
  801f8f:	c9                   	leave  
  801f90:	c3                   	ret    

00801f91 <dev_lookup>:
	0
};

int
dev_lookup(int dev_id, struct Dev **dev)
{
  801f91:	55                   	push   %ebp
  801f92:	89 e5                	mov    %esp,%ebp
  801f94:	56                   	push   %esi
  801f95:	53                   	push   %ebx
  801f96:	83 ec 10             	sub    $0x10,%esp
  801f99:	8b 4d 08             	mov    0x8(%ebp),%ecx
  801f9c:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	int i;
	for (i = 0; devtab[i]; i++)
		if (devtab[i]->dev_id == dev_id) {
			*dev = devtab[i];
			return 0;
  801f9f:	ba 00 00 00 00       	mov    $0x0,%edx
int
dev_lookup(int dev_id, struct Dev **dev)
{
	int i;
	for (i = 0; devtab[i]; i++)
		if (devtab[i]->dev_id == dev_id) {
  801fa4:	b8 04 90 81 00       	mov    $0x819004,%eax
  801fa9:	39 0d 04 90 81 00    	cmp    %ecx,0x819004
  801faf:	75 11                	jne    801fc2 <dev_lookup+0x31>
  801fb1:	eb 04                	jmp    801fb7 <dev_lookup+0x26>
  801fb3:	39 08                	cmp    %ecx,(%eax)
  801fb5:	75 10                	jne    801fc7 <dev_lookup+0x36>
			*dev = devtab[i];
  801fb7:	89 03                	mov    %eax,(%ebx)
  801fb9:	b8 00 00 00 00       	mov    $0x0,%eax
			return 0;
  801fbe:	66 90                	xchg   %ax,%ax
  801fc0:	eb 36                	jmp    801ff8 <dev_lookup+0x67>

int
dev_lookup(int dev_id, struct Dev **dev)
{
	int i;
	for (i = 0; devtab[i]; i++)
  801fc2:	be 24 2d 81 00       	mov    $0x812d24,%esi
  801fc7:	83 c2 01             	add    $0x1,%edx
  801fca:	8b 04 96             	mov    (%esi,%edx,4),%eax
  801fcd:	85 c0                	test   %eax,%eax
  801fcf:	75 e2                	jne    801fb3 <dev_lookup+0x22>
		if (devtab[i]->dev_id == dev_id) {
			*dev = devtab[i];
			return 0;
		}
	cprintf("[%08x] unknown device type %d\n", env->env_id, dev_id);
  801fd1:	a1 f4 f5 b3 00       	mov    0xb3f5f4,%eax
  801fd6:	8b 40 4c             	mov    0x4c(%eax),%eax
  801fd9:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801fdd:	89 44 24 04          	mov    %eax,0x4(%esp)
  801fe1:	c7 04 24 a8 2c 81 00 	movl   $0x812ca8,(%esp)
  801fe8:	e8 74 ea ff ff       	call   800a61 <cprintf>
	*dev = 0;
  801fed:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  801ff3:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
	return -E_INVAL;
}
  801ff8:	83 c4 10             	add    $0x10,%esp
  801ffb:	5b                   	pop    %ebx
  801ffc:	5e                   	pop    %esi
  801ffd:	5d                   	pop    %ebp
  801ffe:	c3                   	ret    

00801fff <fstat>:
	return (*dev->dev_trunc)(fd, newsize);
}

int
fstat(int fdnum, struct Stat *stat)
{
  801fff:	55                   	push   %ebp
  802000:	89 e5                	mov    %esp,%ebp
  802002:	53                   	push   %ebx
  802003:	83 ec 24             	sub    $0x24,%esp
  802006:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  802009:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80200c:	89 44 24 04          	mov    %eax,0x4(%esp)
  802010:	8b 45 08             	mov    0x8(%ebp),%eax
  802013:	89 04 24             	mov    %eax,(%esp)
  802016:	e8 02 ff ff ff       	call   801f1d <fd_lookup>
  80201b:	85 c0                	test   %eax,%eax
  80201d:	78 53                	js     802072 <fstat+0x73>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  80201f:	8d 45 f4             	lea    -0xc(%ebp),%eax
  802022:	89 44 24 04          	mov    %eax,0x4(%esp)
  802026:	8b 45 f0             	mov    -0x10(%ebp),%eax
  802029:	8b 00                	mov    (%eax),%eax
  80202b:	89 04 24             	mov    %eax,(%esp)
  80202e:	e8 5e ff ff ff       	call   801f91 <dev_lookup>
{
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  802033:	85 c0                	test   %eax,%eax
  802035:	78 3b                	js     802072 <fstat+0x73>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
		return r;
	if (!dev->dev_stat)
  802037:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  80203c:	8b 55 f4             	mov    -0xc(%ebp),%edx
  80203f:	83 7a 14 00          	cmpl   $0x0,0x14(%edx)
  802043:	74 2d                	je     802072 <fstat+0x73>
		return -E_NOT_SUPP;
	stat->st_name[0] = 0;
  802045:	c6 03 00             	movb   $0x0,(%ebx)
	stat->st_size = 0;
  802048:	c7 83 80 00 00 00 00 	movl   $0x0,0x80(%ebx)
  80204f:	00 00 00 
	stat->st_isdir = 0;
  802052:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  802059:	00 00 00 
	stat->st_dev = dev;
  80205c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80205f:	89 83 88 00 00 00    	mov    %eax,0x88(%ebx)
	return (*dev->dev_stat)(fd, stat);
  802065:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  802069:	8b 55 f0             	mov    -0x10(%ebp),%edx
  80206c:	89 14 24             	mov    %edx,(%esp)
  80206f:	ff 50 14             	call   *0x14(%eax)
}
  802072:	83 c4 24             	add    $0x24,%esp
  802075:	5b                   	pop    %ebx
  802076:	5d                   	pop    %ebp
  802077:	c3                   	ret    

00802078 <ftruncate>:
	return 0;
}

int
ftruncate(int fdnum, off_t newsize)
{
  802078:	55                   	push   %ebp
  802079:	89 e5                	mov    %esp,%ebp
  80207b:	53                   	push   %ebx
  80207c:	83 ec 24             	sub    $0x24,%esp
  80207f:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;
	if ((r = fd_lookup(fdnum, &fd)) < 0
  802082:	8d 45 f0             	lea    -0x10(%ebp),%eax
  802085:	89 44 24 04          	mov    %eax,0x4(%esp)
  802089:	89 1c 24             	mov    %ebx,(%esp)
  80208c:	e8 8c fe ff ff       	call   801f1d <fd_lookup>
  802091:	85 c0                	test   %eax,%eax
  802093:	78 5f                	js     8020f4 <ftruncate+0x7c>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  802095:	8d 45 f4             	lea    -0xc(%ebp),%eax
  802098:	89 44 24 04          	mov    %eax,0x4(%esp)
  80209c:	8b 45 f0             	mov    -0x10(%ebp),%eax
  80209f:	8b 00                	mov    (%eax),%eax
  8020a1:	89 04 24             	mov    %eax,(%esp)
  8020a4:	e8 e8 fe ff ff       	call   801f91 <dev_lookup>
ftruncate(int fdnum, off_t newsize)
{
	int r;
	struct Dev *dev;
	struct Fd *fd;
	if ((r = fd_lookup(fdnum, &fd)) < 0
  8020a9:	85 c0                	test   %eax,%eax
  8020ab:	78 47                	js     8020f4 <ftruncate+0x7c>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  8020ad:	8b 55 f0             	mov    -0x10(%ebp),%edx
  8020b0:	f6 42 08 03          	testb  $0x3,0x8(%edx)
  8020b4:	75 23                	jne    8020d9 <ftruncate+0x61>
		cprintf("[%08x] ftruncate %d -- bad mode\n",
			env->env_id, fdnum); 
  8020b6:	a1 f4 f5 b3 00       	mov    0xb3f5f4,%eax
	struct Fd *fd;
	if ((r = fd_lookup(fdnum, &fd)) < 0
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
		cprintf("[%08x] ftruncate %d -- bad mode\n",
  8020bb:	8b 40 4c             	mov    0x4c(%eax),%eax
  8020be:	89 5c 24 08          	mov    %ebx,0x8(%esp)
  8020c2:	89 44 24 04          	mov    %eax,0x4(%esp)
  8020c6:	c7 04 24 c8 2c 81 00 	movl   $0x812cc8,(%esp)
  8020cd:	e8 8f e9 ff ff       	call   800a61 <cprintf>
  8020d2:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
			env->env_id, fdnum); 
		return -E_INVAL;
  8020d7:	eb 1b                	jmp    8020f4 <ftruncate+0x7c>
	}
	if (!dev->dev_trunc)
  8020d9:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8020dc:	8b 48 18             	mov    0x18(%eax),%ecx
  8020df:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  8020e4:	85 c9                	test   %ecx,%ecx
  8020e6:	74 0c                	je     8020f4 <ftruncate+0x7c>
		return -E_NOT_SUPP;
	return (*dev->dev_trunc)(fd, newsize);
  8020e8:	8b 45 0c             	mov    0xc(%ebp),%eax
  8020eb:	89 44 24 04          	mov    %eax,0x4(%esp)
  8020ef:	89 14 24             	mov    %edx,(%esp)
  8020f2:	ff d1                	call   *%ecx
}
  8020f4:	83 c4 24             	add    $0x24,%esp
  8020f7:	5b                   	pop    %ebx
  8020f8:	5d                   	pop    %ebp
  8020f9:	c3                   	ret    

008020fa <write>:
	return tot;
}

ssize_t
write(int fdnum, const void *buf, size_t n)
{
  8020fa:	55                   	push   %ebp
  8020fb:	89 e5                	mov    %esp,%ebp
  8020fd:	53                   	push   %ebx
  8020fe:	83 ec 24             	sub    $0x24,%esp
  802101:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  802104:	8d 45 f0             	lea    -0x10(%ebp),%eax
  802107:	89 44 24 04          	mov    %eax,0x4(%esp)
  80210b:	89 1c 24             	mov    %ebx,(%esp)
  80210e:	e8 0a fe ff ff       	call   801f1d <fd_lookup>
  802113:	85 c0                	test   %eax,%eax
  802115:	78 66                	js     80217d <write+0x83>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  802117:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80211a:	89 44 24 04          	mov    %eax,0x4(%esp)
  80211e:	8b 45 f0             	mov    -0x10(%ebp),%eax
  802121:	8b 00                	mov    (%eax),%eax
  802123:	89 04 24             	mov    %eax,(%esp)
  802126:	e8 66 fe ff ff       	call   801f91 <dev_lookup>
{
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  80212b:	85 c0                	test   %eax,%eax
  80212d:	78 4e                	js     80217d <write+0x83>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  80212f:	8b 55 f0             	mov    -0x10(%ebp),%edx
  802132:	f6 42 08 03          	testb  $0x3,0x8(%edx)
  802136:	75 23                	jne    80215b <write+0x61>
		cprintf("[%08x] write %d -- bad mode\n", env->env_id, fdnum);
  802138:	a1 f4 f5 b3 00       	mov    0xb3f5f4,%eax
  80213d:	8b 40 4c             	mov    0x4c(%eax),%eax
  802140:	89 5c 24 08          	mov    %ebx,0x8(%esp)
  802144:	89 44 24 04          	mov    %eax,0x4(%esp)
  802148:	c7 04 24 e9 2c 81 00 	movl   $0x812ce9,(%esp)
  80214f:	e8 0d e9 ff ff       	call   800a61 <cprintf>
  802154:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
		return -E_INVAL;
  802159:	eb 22                	jmp    80217d <write+0x83>
	}
	if (debug)
		cprintf("write %d %p %d via dev %s\n",
			fdnum, buf, n, dev->dev_name);
	if (!dev->dev_write)
  80215b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80215e:	8b 48 0c             	mov    0xc(%eax),%ecx
  802161:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  802166:	85 c9                	test   %ecx,%ecx
  802168:	74 13                	je     80217d <write+0x83>
		return -E_NOT_SUPP;
	return (*dev->dev_write)(fd, buf, n);
  80216a:	8b 45 10             	mov    0x10(%ebp),%eax
  80216d:	89 44 24 08          	mov    %eax,0x8(%esp)
  802171:	8b 45 0c             	mov    0xc(%ebp),%eax
  802174:	89 44 24 04          	mov    %eax,0x4(%esp)
  802178:	89 14 24             	mov    %edx,(%esp)
  80217b:	ff d1                	call   *%ecx
}
  80217d:	83 c4 24             	add    $0x24,%esp
  802180:	5b                   	pop    %ebx
  802181:	5d                   	pop    %ebp
  802182:	c3                   	ret    

00802183 <read>:
	return r;
}

ssize_t
read(int fdnum, void *buf, size_t n)
{
  802183:	55                   	push   %ebp
  802184:	89 e5                	mov    %esp,%ebp
  802186:	57                   	push   %edi
  802187:	56                   	push   %esi
  802188:	53                   	push   %ebx
  802189:	83 ec 2c             	sub    $0x2c,%esp
  80218c:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80218f:	8b 75 10             	mov    0x10(%ebp),%esi
	int r;
	int m, tot;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  802192:	8d 45 e0             	lea    -0x20(%ebp),%eax
  802195:	89 44 24 04          	mov    %eax,0x4(%esp)
  802199:	89 1c 24             	mov    %ebx,(%esp)
  80219c:	e8 7c fd ff ff       	call   801f1d <fd_lookup>
  8021a1:	85 c0                	test   %eax,%eax
  8021a3:	0f 88 b0 00 00 00    	js     802259 <read+0xd6>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8021a9:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  8021ac:	89 44 24 04          	mov    %eax,0x4(%esp)
  8021b0:	8b 45 e0             	mov    -0x20(%ebp),%eax
  8021b3:	8b 00                	mov    (%eax),%eax
  8021b5:	89 04 24             	mov    %eax,(%esp)
  8021b8:	e8 d4 fd ff ff       	call   801f91 <dev_lookup>
	int r;
	int m, tot;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8021bd:	85 c0                	test   %eax,%eax
  8021bf:	0f 88 94 00 00 00    	js     802259 <read+0xd6>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_WRONLY) {
  8021c5:	8b 45 e0             	mov    -0x20(%ebp),%eax
  8021c8:	8b 40 08             	mov    0x8(%eax),%eax
  8021cb:	83 e0 03             	and    $0x3,%eax
  8021ce:	83 f8 01             	cmp    $0x1,%eax
  8021d1:	75 23                	jne    8021f6 <read+0x73>
		cprintf("[%08x] read %d -- bad mode\n", env->env_id, fdnum); 
  8021d3:	a1 f4 f5 b3 00       	mov    0xb3f5f4,%eax
  8021d8:	8b 40 4c             	mov    0x4c(%eax),%eax
  8021db:	89 5c 24 08          	mov    %ebx,0x8(%esp)
  8021df:	89 44 24 04          	mov    %eax,0x4(%esp)
  8021e3:	c7 04 24 06 2d 81 00 	movl   $0x812d06,(%esp)
  8021ea:	e8 72 e8 ff ff       	call   800a61 <cprintf>
  8021ef:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
		return -E_INVAL;
  8021f4:	eb 63                	jmp    802259 <read+0xd6>
	}
	if (!dev->dev_read)
  8021f6:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  8021fb:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  8021fe:	83 7a 08 00          	cmpl   $0x0,0x8(%edx)
  802202:	74 55                	je     802259 <read+0xd6>
		return -E_NOT_SUPP;

  for (tot = 0; tot < n; tot += m) {
  802204:	ba 00 00 00 00       	mov    $0x0,%edx
  802209:	bb 00 00 00 00       	mov    $0x0,%ebx
  80220e:	b8 00 00 00 00       	mov    $0x0,%eax
  802213:	85 f6                	test   %esi,%esi
  802215:	74 42                	je     802259 <read+0xd6>
    int count=0;
    if ((n-tot)/PGSIZE == 0)
  802217:	bf 00 10 00 00       	mov    $0x1000,%edi
  80221c:	89 f0                	mov    %esi,%eax
  80221e:	29 d0                	sub    %edx,%eax
  802220:	89 c1                	mov    %eax,%ecx
  802222:	81 e1 ff 0f 00 00    	and    $0xfff,%ecx
  802228:	3d 00 10 00 00       	cmp    $0x1000,%eax
  80222d:	0f 43 cf             	cmovae %edi,%ecx
      count = (n-tot)%PGSIZE;
    else
      count = PGSIZE;

	  m = (*dev->dev_read)(fd, (char *)buf + tot, count);
  802230:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  802234:	03 55 0c             	add    0xc(%ebp),%edx
  802237:	89 54 24 04          	mov    %edx,0x4(%esp)
  80223b:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80223e:	89 04 24             	mov    %eax,(%esp)
  802241:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  802244:	ff 50 08             	call   *0x8(%eax)
		if (m < 0)
  802247:	85 c0                	test   %eax,%eax
  802249:	78 0e                	js     802259 <read+0xd6>
			return m;
		if (m == 0)
  80224b:	85 c0                	test   %eax,%eax
  80224d:	74 08                	je     802257 <read+0xd4>
		return -E_INVAL;
	}
	if (!dev->dev_read)
		return -E_NOT_SUPP;

  for (tot = 0; tot < n; tot += m) {
  80224f:	01 c3                	add    %eax,%ebx
  802251:	89 da                	mov    %ebx,%edx
  802253:	39 f3                	cmp    %esi,%ebx
  802255:	72 c5                	jb     80221c <read+0x99>
  802257:	89 d8                	mov    %ebx,%eax
			return m;
		if (m == 0)
			break;
	}
	return tot;
}
  802259:	83 c4 2c             	add    $0x2c,%esp
  80225c:	5b                   	pop    %ebx
  80225d:	5e                   	pop    %esi
  80225e:	5f                   	pop    %edi
  80225f:	5d                   	pop    %ebp
  802260:	c3                   	ret    

00802261 <readn>:

ssize_t
readn(int fdnum, void *buf, size_t n)
{
  802261:	55                   	push   %ebp
  802262:	89 e5                	mov    %esp,%ebp
  802264:	57                   	push   %edi
  802265:	56                   	push   %esi
  802266:	53                   	push   %ebx
  802267:	83 ec 1c             	sub    $0x1c,%esp
  80226a:	8b 7d 08             	mov    0x8(%ebp),%edi
  80226d:	8b 75 10             	mov    0x10(%ebp),%esi
	int m, tot;
  struct Fd *fd = INDEX2FD(fdnum);

	for (tot = 0; tot < n; tot += m) {
  802270:	ba 00 00 00 00       	mov    $0x0,%edx
  802275:	bb 00 00 00 00       	mov    $0x0,%ebx
  80227a:	b8 00 00 00 00       	mov    $0x0,%eax
  80227f:	85 f6                	test   %esi,%esi
  802281:	74 29                	je     8022ac <readn+0x4b>
		m = read(fdnum, (char*)buf + tot, n - tot);
  802283:	89 f0                	mov    %esi,%eax
  802285:	29 d0                	sub    %edx,%eax
  802287:	89 44 24 08          	mov    %eax,0x8(%esp)
  80228b:	03 55 0c             	add    0xc(%ebp),%edx
  80228e:	89 54 24 04          	mov    %edx,0x4(%esp)
  802292:	89 3c 24             	mov    %edi,(%esp)
  802295:	e8 e9 fe ff ff       	call   802183 <read>
		if (m < 0)
  80229a:	85 c0                	test   %eax,%eax
  80229c:	78 0e                	js     8022ac <readn+0x4b>
			return m;
		if (m == 0)
  80229e:	85 c0                	test   %eax,%eax
  8022a0:	74 08                	je     8022aa <readn+0x49>
readn(int fdnum, void *buf, size_t n)
{
	int m, tot;
  struct Fd *fd = INDEX2FD(fdnum);

	for (tot = 0; tot < n; tot += m) {
  8022a2:	01 c3                	add    %eax,%ebx
  8022a4:	89 da                	mov    %ebx,%edx
  8022a6:	39 f3                	cmp    %esi,%ebx
  8022a8:	72 d9                	jb     802283 <readn+0x22>
  8022aa:	89 d8                	mov    %ebx,%eax
			return m;
		if (m == 0)
			break;
	}
	return tot;
}
  8022ac:	83 c4 1c             	add    $0x1c,%esp
  8022af:	5b                   	pop    %ebx
  8022b0:	5e                   	pop    %esi
  8022b1:	5f                   	pop    %edi
  8022b2:	5d                   	pop    %ebp
  8022b3:	c3                   	ret    

008022b4 <fd_close>:
// If 'must_exist' is 1, then fd_close returns -E_INVAL when passed a
// closed or nonexistent file descriptor.
// Returns 0 on success, < 0 on error.
int
fd_close(struct Fd *fd, bool must_exist)
{
  8022b4:	55                   	push   %ebp
  8022b5:	89 e5                	mov    %esp,%ebp
  8022b7:	83 ec 28             	sub    $0x28,%esp
  8022ba:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  8022bd:	89 75 fc             	mov    %esi,-0x4(%ebp)
  8022c0:	8b 75 08             	mov    0x8(%ebp),%esi
	struct Fd *fd2;
	struct Dev *dev;
	int r;
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  8022c3:	89 34 24             	mov    %esi,(%esp)
  8022c6:	e8 b5 fb ff ff       	call   801e80 <fd2num>
  8022cb:	8d 55 f4             	lea    -0xc(%ebp),%edx
  8022ce:	89 54 24 04          	mov    %edx,0x4(%esp)
  8022d2:	89 04 24             	mov    %eax,(%esp)
  8022d5:	e8 43 fc ff ff       	call   801f1d <fd_lookup>
  8022da:	89 c3                	mov    %eax,%ebx
  8022dc:	85 c0                	test   %eax,%eax
  8022de:	78 05                	js     8022e5 <fd_close+0x31>
  8022e0:	3b 75 f4             	cmp    -0xc(%ebp),%esi
  8022e3:	74 0e                	je     8022f3 <fd_close+0x3f>
	    || fd != fd2)
		return (must_exist ? r : 0);
  8022e5:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  8022e9:	b8 00 00 00 00       	mov    $0x0,%eax
  8022ee:	0f 44 d8             	cmove  %eax,%ebx
  8022f1:	eb 3d                	jmp    802330 <fd_close+0x7c>
	if ((r = dev_lookup(fd->fd_dev_id, &dev)) >= 0) {
  8022f3:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8022f6:	89 44 24 04          	mov    %eax,0x4(%esp)
  8022fa:	8b 06                	mov    (%esi),%eax
  8022fc:	89 04 24             	mov    %eax,(%esp)
  8022ff:	e8 8d fc ff ff       	call   801f91 <dev_lookup>
  802304:	89 c3                	mov    %eax,%ebx
  802306:	85 c0                	test   %eax,%eax
  802308:	78 16                	js     802320 <fd_close+0x6c>
		if (dev->dev_close)
  80230a:	8b 45 f0             	mov    -0x10(%ebp),%eax
  80230d:	8b 40 10             	mov    0x10(%eax),%eax
  802310:	bb 00 00 00 00       	mov    $0x0,%ebx
  802315:	85 c0                	test   %eax,%eax
  802317:	74 07                	je     802320 <fd_close+0x6c>
			r = (*dev->dev_close)(fd);
  802319:	89 34 24             	mov    %esi,(%esp)
  80231c:	ff d0                	call   *%eax
  80231e:	89 c3                	mov    %eax,%ebx
		else
			r = 0;
	}
	// Make sure fd is unmapped.  Might be a no-op if
	// (*dev->dev_close)(fd) already unmapped it.
	(void) sys_page_unmap(0, fd);
  802320:	89 74 24 04          	mov    %esi,0x4(%esp)
  802324:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80232b:	e8 9a f4 ff ff       	call   8017ca <sys_page_unmap>
	return r;
}
  802330:	89 d8                	mov    %ebx,%eax
  802332:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  802335:	8b 75 fc             	mov    -0x4(%ebp),%esi
  802338:	89 ec                	mov    %ebp,%esp
  80233a:	5d                   	pop    %ebp
  80233b:	c3                   	ret    

0080233c <close>:
	return -E_INVAL;
}

int
close(int fdnum)
{
  80233c:	55                   	push   %ebp
  80233d:	89 e5                	mov    %esp,%ebp
  80233f:	83 ec 28             	sub    $0x28,%esp
	struct Fd *fd;
	int r;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  802342:	8d 45 f4             	lea    -0xc(%ebp),%eax
  802345:	89 44 24 04          	mov    %eax,0x4(%esp)
  802349:	8b 45 08             	mov    0x8(%ebp),%eax
  80234c:	89 04 24             	mov    %eax,(%esp)
  80234f:	e8 c9 fb ff ff       	call   801f1d <fd_lookup>
  802354:	85 c0                	test   %eax,%eax
  802356:	78 13                	js     80236b <close+0x2f>
		return r;
	else
		return fd_close(fd, 1);
  802358:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  80235f:	00 
  802360:	8b 45 f4             	mov    -0xc(%ebp),%eax
  802363:	89 04 24             	mov    %eax,(%esp)
  802366:	e8 49 ff ff ff       	call   8022b4 <fd_close>
}
  80236b:	c9                   	leave  
  80236c:	c3                   	ret    

0080236d <stat>:
	return (*dev->dev_stat)(fd, stat);
}

int
stat(const char *path, struct Stat *stat)
{
  80236d:	55                   	push   %ebp
  80236e:	89 e5                	mov    %esp,%ebp
  802370:	83 ec 18             	sub    $0x18,%esp
  802373:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  802376:	89 75 fc             	mov    %esi,-0x4(%ebp)
	int fd, r;

	if ((fd = open(path, O_RDONLY)) < 0)
  802379:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  802380:	00 
  802381:	8b 45 08             	mov    0x8(%ebp),%eax
  802384:	89 04 24             	mov    %eax,(%esp)
  802387:	e8 80 03 00 00       	call   80270c <open>
  80238c:	89 c3                	mov    %eax,%ebx
  80238e:	85 c0                	test   %eax,%eax
  802390:	78 1b                	js     8023ad <stat+0x40>
		return fd;
	r = fstat(fd, stat);
  802392:	8b 45 0c             	mov    0xc(%ebp),%eax
  802395:	89 44 24 04          	mov    %eax,0x4(%esp)
  802399:	89 1c 24             	mov    %ebx,(%esp)
  80239c:	e8 5e fc ff ff       	call   801fff <fstat>
  8023a1:	89 c6                	mov    %eax,%esi
	close(fd);
  8023a3:	89 1c 24             	mov    %ebx,(%esp)
  8023a6:	e8 91 ff ff ff       	call   80233c <close>
  8023ab:	89 f3                	mov    %esi,%ebx
	return r;
}
  8023ad:	89 d8                	mov    %ebx,%eax
  8023af:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  8023b2:	8b 75 fc             	mov    -0x4(%ebp),%esi
  8023b5:	89 ec                	mov    %ebp,%esp
  8023b7:	5d                   	pop    %ebp
  8023b8:	c3                   	ret    

008023b9 <close_all>:
		return fd_close(fd, 1);
}

void
close_all(void)
{
  8023b9:	55                   	push   %ebp
  8023ba:	89 e5                	mov    %esp,%ebp
  8023bc:	53                   	push   %ebx
  8023bd:	83 ec 14             	sub    $0x14,%esp
  8023c0:	bb 00 00 00 00       	mov    $0x0,%ebx
	int i;
	for (i = 0; i < MAXFD; i++)
		close(i);
  8023c5:	89 1c 24             	mov    %ebx,(%esp)
  8023c8:	e8 6f ff ff ff       	call   80233c <close>

void
close_all(void)
{
	int i;
	for (i = 0; i < MAXFD; i++)
  8023cd:	83 c3 01             	add    $0x1,%ebx
  8023d0:	83 fb 20             	cmp    $0x20,%ebx
  8023d3:	75 f0                	jne    8023c5 <close_all+0xc>
		close(i);
}
  8023d5:	83 c4 14             	add    $0x14,%esp
  8023d8:	5b                   	pop    %ebx
  8023d9:	5d                   	pop    %ebp
  8023da:	c3                   	ret    

008023db <dup>:
// file and the file offset of the other.
// Closes any previously open file descriptor at 'newfdnum'.
// This is implemented using virtual memory tricks (of course!).
int
dup(int oldfdnum, int newfdnum)
{
  8023db:	55                   	push   %ebp
  8023dc:	89 e5                	mov    %esp,%ebp
  8023de:	83 ec 58             	sub    $0x58,%esp
  8023e1:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  8023e4:	89 75 f8             	mov    %esi,-0x8(%ebp)
  8023e7:	89 7d fc             	mov    %edi,-0x4(%ebp)
  8023ea:	8b 7d 0c             	mov    0xc(%ebp),%edi
	int r;
	char *ova, *nva;
	pte_t pte;
	struct Fd *oldfd, *newfd;

	if ((r = fd_lookup(oldfdnum, &oldfd)) < 0)
  8023ed:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  8023f0:	89 44 24 04          	mov    %eax,0x4(%esp)
  8023f4:	8b 45 08             	mov    0x8(%ebp),%eax
  8023f7:	89 04 24             	mov    %eax,(%esp)
  8023fa:	e8 1e fb ff ff       	call   801f1d <fd_lookup>
  8023ff:	89 c3                	mov    %eax,%ebx
  802401:	85 c0                	test   %eax,%eax
  802403:	0f 88 e0 00 00 00    	js     8024e9 <dup+0x10e>
		return r;
	close(newfdnum);
  802409:	89 3c 24             	mov    %edi,(%esp)
  80240c:	e8 2b ff ff ff       	call   80233c <close>

	newfd = INDEX2FD(newfdnum);
  802411:	8d b7 00 00 0d 00    	lea    0xd0000(%edi),%esi
  802417:	c1 e6 0c             	shl    $0xc,%esi
	ova = fd2data(oldfd);
  80241a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80241d:	89 04 24             	mov    %eax,(%esp)
  802420:	e8 6b fa ff ff       	call   801e90 <fd2data>
  802425:	89 c3                	mov    %eax,%ebx
	nva = fd2data(newfd);
  802427:	89 34 24             	mov    %esi,(%esp)
  80242a:	e8 61 fa ff ff       	call   801e90 <fd2data>
  80242f:	89 45 d4             	mov    %eax,-0x2c(%ebp)
	if ((vpd[PDX(ova)] & PTE_P) && (vpt[VPN(ova)] & PTE_P))
  802432:	89 da                	mov    %ebx,%edx
  802434:	89 d8                	mov    %ebx,%eax
  802436:	c1 e8 16             	shr    $0x16,%eax
  802439:	8b 04 85 00 d0 7b ef 	mov    -0x10843000(,%eax,4),%eax
  802440:	a8 01                	test   $0x1,%al
  802442:	74 43                	je     802487 <dup+0xac>
  802444:	c1 ea 0c             	shr    $0xc,%edx
  802447:	8b 04 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%eax
  80244e:	a8 01                	test   $0x1,%al
  802450:	74 35                	je     802487 <dup+0xac>
		if ((r = sys_page_map(0, ova, 0, nva, (vpt[VPN(ova)]) & PTE_USER)) < 0)
  802452:	8b 04 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%eax
  802459:	25 07 0e 00 00       	and    $0xe07,%eax
  80245e:	89 44 24 10          	mov    %eax,0x10(%esp)
  802462:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  802465:	89 44 24 0c          	mov    %eax,0xc(%esp)
  802469:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  802470:	00 
  802471:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  802475:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80247c:	e8 a7 f3 ff ff       	call   801828 <sys_page_map>
  802481:	89 c3                	mov    %eax,%ebx
  802483:	85 c0                	test   %eax,%eax
  802485:	78 3f                	js     8024c6 <dup+0xeb>
			goto err;
	if ((r = sys_page_map(0, oldfd, 0, newfd, (vpt[VPN(oldfd)]) & PTE_USER)) < 0)
  802487:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80248a:	89 c2                	mov    %eax,%edx
  80248c:	c1 ea 0c             	shr    $0xc,%edx
  80248f:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  802496:	81 e2 07 0e 00 00    	and    $0xe07,%edx
  80249c:	89 54 24 10          	mov    %edx,0x10(%esp)
  8024a0:	89 74 24 0c          	mov    %esi,0xc(%esp)
  8024a4:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  8024ab:	00 
  8024ac:	89 44 24 04          	mov    %eax,0x4(%esp)
  8024b0:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  8024b7:	e8 6c f3 ff ff       	call   801828 <sys_page_map>
  8024bc:	89 c3                	mov    %eax,%ebx
  8024be:	85 c0                	test   %eax,%eax
  8024c0:	78 04                	js     8024c6 <dup+0xeb>
  8024c2:	89 fb                	mov    %edi,%ebx
  8024c4:	eb 23                	jmp    8024e9 <dup+0x10e>
		goto err;

	return newfdnum;
err:
	sys_page_unmap(0, newfd);
  8024c6:	89 74 24 04          	mov    %esi,0x4(%esp)
  8024ca:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  8024d1:	e8 f4 f2 ff ff       	call   8017ca <sys_page_unmap>
	sys_page_unmap(0, nva);
  8024d6:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  8024d9:	89 44 24 04          	mov    %eax,0x4(%esp)
  8024dd:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  8024e4:	e8 e1 f2 ff ff       	call   8017ca <sys_page_unmap>
	return r;
}
  8024e9:	89 d8                	mov    %ebx,%eax
  8024eb:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  8024ee:	8b 75 f8             	mov    -0x8(%ebp),%esi
  8024f1:	8b 7d fc             	mov    -0x4(%ebp),%edi
  8024f4:	89 ec                	mov    %ebp,%esp
  8024f6:	5d                   	pop    %ebp
  8024f7:	c3                   	ret    

008024f8 <fsipc>:
// type: request code, passed as the simple integer IPC value.
// dstva: virtual address at which to receive reply page, 0 if none.
// Returns result from the file server.
static int
fsipc(unsigned type, void *dstva)
{
  8024f8:	55                   	push   %ebp
  8024f9:	89 e5                	mov    %esp,%ebp
  8024fb:	53                   	push   %ebx
  8024fc:	83 ec 14             	sub    $0x14,%esp
  8024ff:	89 d3                	mov    %edx,%ebx
	if (debug)
		cprintf("[%08x] fsipc %d %08x\n", env->env_id, type, *(uint32_t *)&fsipcbuf);

	ipc_send(envs[1].env_id, type, &fsipcbuf, PTE_P | PTE_W | PTE_U);
  802501:	8b 15 c8 00 c0 ee    	mov    0xeec000c8,%edx
  802507:	c7 44 24 0c 07 00 00 	movl   $0x7,0xc(%esp)
  80250e:	00 
  80250f:	c7 44 24 08 00 60 81 	movl   $0x816000,0x8(%esp)
  802516:	00 
  802517:	89 44 24 04          	mov    %eax,0x4(%esp)
  80251b:	89 14 24             	mov    %edx,(%esp)
  80251e:	e8 8d f8 ff ff       	call   801db0 <ipc_send>
	return ipc_recv(NULL, dstva, NULL);
  802523:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80252a:	00 
  80252b:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  80252f:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  802536:	e8 e7 f8 ff ff       	call   801e22 <ipc_recv>
}
  80253b:	83 c4 14             	add    $0x14,%esp
  80253e:	5b                   	pop    %ebx
  80253f:	5d                   	pop    %ebp
  802540:	c3                   	ret    

00802541 <devfile_trunc>:
}

// Truncate or extend an open file to 'size' bytes
static int
devfile_trunc(struct Fd *fd, off_t newsize)
{
  802541:	55                   	push   %ebp
  802542:	89 e5                	mov    %esp,%ebp
  802544:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.set_size.req_fileid = fd->fd_file.id;
  802547:	8b 45 08             	mov    0x8(%ebp),%eax
  80254a:	8b 40 0c             	mov    0xc(%eax),%eax
  80254d:	a3 00 60 81 00       	mov    %eax,0x816000
	fsipcbuf.set_size.req_size = newsize;
  802552:	8b 45 0c             	mov    0xc(%ebp),%eax
  802555:	a3 04 60 81 00       	mov    %eax,0x816004
	return fsipc(FSREQ_SET_SIZE, NULL);
  80255a:	ba 00 00 00 00       	mov    $0x0,%edx
  80255f:	b8 02 00 00 00       	mov    $0x2,%eax
  802564:	e8 8f ff ff ff       	call   8024f8 <fsipc>
}
  802569:	c9                   	leave  
  80256a:	c3                   	ret    

0080256b <devfile_flush>:
// open, unmapping it is enough to free up server-side resources.
// Other than that, we just have to make sure our changes are flushed
// to disk.
static int
devfile_flush(struct Fd *fd)
{
  80256b:	55                   	push   %ebp
  80256c:	89 e5                	mov    %esp,%ebp
  80256e:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.flush.req_fileid = fd->fd_file.id;
  802571:	8b 45 08             	mov    0x8(%ebp),%eax
  802574:	8b 40 0c             	mov    0xc(%eax),%eax
  802577:	a3 00 60 81 00       	mov    %eax,0x816000
	return fsipc(FSREQ_FLUSH, NULL);
  80257c:	ba 00 00 00 00       	mov    $0x0,%edx
  802581:	b8 06 00 00 00       	mov    $0x6,%eax
  802586:	e8 6d ff ff ff       	call   8024f8 <fsipc>
}
  80258b:	c9                   	leave  
  80258c:	c3                   	ret    

0080258d <sync>:
}

// Synchronize disk with buffer cache
int
sync(void)
{
  80258d:	55                   	push   %ebp
  80258e:	89 e5                	mov    %esp,%ebp
  802590:	83 ec 08             	sub    $0x8,%esp
	// Ask the file server to update the disk
	// by writing any dirty blocks in the buffer cache.

	return fsipc(FSREQ_SYNC, NULL);
  802593:	ba 00 00 00 00       	mov    $0x0,%edx
  802598:	b8 08 00 00 00       	mov    $0x8,%eax
  80259d:	e8 56 ff ff ff       	call   8024f8 <fsipc>
}
  8025a2:	c9                   	leave  
  8025a3:	c3                   	ret    

008025a4 <devfile_stat>:
    return n;
}

static int
devfile_stat(struct Fd *fd, struct Stat *st)
{
  8025a4:	55                   	push   %ebp
  8025a5:	89 e5                	mov    %esp,%ebp
  8025a7:	53                   	push   %ebx
  8025a8:	83 ec 14             	sub    $0x14,%esp
  8025ab:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	int r;

	fsipcbuf.stat.req_fileid = fd->fd_file.id;
  8025ae:	8b 45 08             	mov    0x8(%ebp),%eax
  8025b1:	8b 40 0c             	mov    0xc(%eax),%eax
  8025b4:	a3 00 60 81 00       	mov    %eax,0x816000
	if ((r = fsipc(FSREQ_STAT, NULL)) < 0)
  8025b9:	ba 00 00 00 00       	mov    $0x0,%edx
  8025be:	b8 05 00 00 00       	mov    $0x5,%eax
  8025c3:	e8 30 ff ff ff       	call   8024f8 <fsipc>
  8025c8:	85 c0                	test   %eax,%eax
  8025ca:	78 2b                	js     8025f7 <devfile_stat+0x53>
		return r;
	strcpy(st->st_name, fsipcbuf.statRet.ret_name);
  8025cc:	c7 44 24 04 00 60 81 	movl   $0x816000,0x4(%esp)
  8025d3:	00 
  8025d4:	89 1c 24             	mov    %ebx,(%esp)
  8025d7:	e8 4e eb ff ff       	call   80112a <strcpy>
	st->st_size = fsipcbuf.statRet.ret_size;
  8025dc:	a1 80 60 81 00       	mov    0x816080,%eax
  8025e1:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	st->st_isdir = fsipcbuf.statRet.ret_isdir;
  8025e7:	a1 84 60 81 00       	mov    0x816084,%eax
  8025ec:	89 83 84 00 00 00    	mov    %eax,0x84(%ebx)
  8025f2:	b8 00 00 00 00       	mov    $0x0,%eax
	return 0;
}
  8025f7:	83 c4 14             	add    $0x14,%esp
  8025fa:	5b                   	pop    %ebx
  8025fb:	5d                   	pop    %ebp
  8025fc:	c3                   	ret    

008025fd <devfile_write>:
// Returns:
//	 The number of bytes successfully written.
//	 < 0 on error.
static ssize_t
devfile_write(struct Fd *fd, const void *buf, size_t n)
{
  8025fd:	55                   	push   %ebp
  8025fe:	89 e5                	mov    %esp,%ebp
  802600:	53                   	push   %ebx
  802601:	83 ec 14             	sub    $0x14,%esp
  802604:	8b 45 08             	mov    0x8(%ebp),%eax
  802607:	8b 55 0c             	mov    0xc(%ebp),%edx
  80260a:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// careful: fsipcbuf.write.req_buf is only so large, but
	// remember that write is always allowed to write *fewer*
	// bytes than requested.
	// LAB 5: Your code here
    int r;
    if (!fd || !buf || (n>(PGSIZE-sizeof(size_t)-sizeof(int))))
  80260d:	85 c0                	test   %eax,%eax
  80260f:	74 44                	je     802655 <devfile_write+0x58>
  802611:	85 d2                	test   %edx,%edx
  802613:	74 40                	je     802655 <devfile_write+0x58>
  802615:	81 fb f8 0f 00 00    	cmp    $0xff8,%ebx
  80261b:	77 38                	ja     802655 <devfile_write+0x58>
        return -E_INVAL;

    fsipcbuf.write.req_fileid   = fd->fd_file.id;
  80261d:	8b 40 0c             	mov    0xc(%eax),%eax
  802620:	a3 00 60 81 00       	mov    %eax,0x816000
    fsipcbuf.write.req_n        = n;
  802625:	89 1d 04 60 81 00    	mov    %ebx,0x816004
    memmove(fsipcbuf.write.req_buf, buf, n);
  80262b:	89 5c 24 08          	mov    %ebx,0x8(%esp)
  80262f:	89 54 24 04          	mov    %edx,0x4(%esp)
  802633:	c7 04 24 08 60 81 00 	movl   $0x816008,(%esp)
  80263a:	e8 a6 ec ff ff       	call   8012e5 <memmove>
    if ((r=fsipc(FSREQ_WRITE, NULL))<0)
  80263f:	ba 00 00 00 00       	mov    $0x0,%edx
  802644:	b8 04 00 00 00       	mov    $0x4,%eax
  802649:	e8 aa fe ff ff       	call   8024f8 <fsipc>
        return r;
    return n;
  80264e:	85 c0                	test   %eax,%eax
  802650:	0f 49 c3             	cmovns %ebx,%eax
  802653:	eb 05                	jmp    80265a <devfile_write+0x5d>
  802655:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
}
  80265a:	83 c4 14             	add    $0x14,%esp
  80265d:	5b                   	pop    %ebx
  80265e:	5d                   	pop    %ebp
  80265f:	c3                   	ret    

00802660 <devfile_read>:
// Returns:
// 	The number of bytes successfully read.
// 	< 0 on error.
static ssize_t
devfile_read(struct Fd *fd, void *buf, size_t n)
{
  802660:	55                   	push   %ebp
  802661:	89 e5                	mov    %esp,%ebp
  802663:	83 ec 18             	sub    $0x18,%esp
  802666:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  802669:	89 75 fc             	mov    %esi,-0x4(%ebp)
  80266c:	8b 45 08             	mov    0x8(%ebp),%eax
  80266f:	8b 75 0c             	mov    0xc(%ebp),%esi
	// filling fsipcbuf.read with the request arguments.  The
	// bytes read will be written back to fsipcbuf by the file
	// system server.
	// LAB 5: Your code here
  int r;
  if (!fd || !buf)
  802672:	85 c0                	test   %eax,%eax
  802674:	74 04                	je     80267a <devfile_read+0x1a>
  802676:	85 f6                	test   %esi,%esi
  802678:	75 07                	jne    802681 <devfile_read+0x21>
  80267a:	bb fd ff ff ff       	mov    $0xfffffffd,%ebx
  80267f:	eb 39                	jmp    8026ba <devfile_read+0x5a>
    return -E_INVAL;

  fsipcbuf.read.req_fileid    = fd->fd_file.id;
  802681:	8b 40 0c             	mov    0xc(%eax),%eax
  802684:	a3 00 60 81 00       	mov    %eax,0x816000
  fsipcbuf.read.req_n         = n;
  802689:	8b 45 10             	mov    0x10(%ebp),%eax
  80268c:	a3 04 60 81 00       	mov    %eax,0x816004
  if ((r=fsipc(FSREQ_READ, NULL))<0)
  802691:	ba 00 00 00 00       	mov    $0x0,%edx
  802696:	b8 03 00 00 00       	mov    $0x3,%eax
  80269b:	e8 58 fe ff ff       	call   8024f8 <fsipc>
  8026a0:	89 c3                	mov    %eax,%ebx
  8026a2:	85 c0                	test   %eax,%eax
  8026a4:	78 14                	js     8026ba <devfile_read+0x5a>
    return r;

  memmove(buf, fsipcbuf.readRet.ret_buf, r);
  8026a6:	89 44 24 08          	mov    %eax,0x8(%esp)
  8026aa:	c7 44 24 04 00 60 81 	movl   $0x816000,0x4(%esp)
  8026b1:	00 
  8026b2:	89 34 24             	mov    %esi,(%esp)
  8026b5:	e8 2b ec ff ff       	call   8012e5 <memmove>
  return r;
}
  8026ba:	89 d8                	mov    %ebx,%eax
  8026bc:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  8026bf:	8b 75 fc             	mov    -0x4(%ebp),%esi
  8026c2:	89 ec                	mov    %ebp,%esp
  8026c4:	5d                   	pop    %ebp
  8026c5:	c3                   	ret    

008026c6 <remove>:
}

// Delete a file
int
remove(const char *path)
{
  8026c6:	55                   	push   %ebp
  8026c7:	89 e5                	mov    %esp,%ebp
  8026c9:	53                   	push   %ebx
  8026ca:	83 ec 14             	sub    $0x14,%esp
  8026cd:	8b 5d 08             	mov    0x8(%ebp),%ebx
	if (strlen(path) >= MAXPATHLEN)
  8026d0:	89 1c 24             	mov    %ebx,(%esp)
  8026d3:	e8 08 ea ff ff       	call   8010e0 <strlen>
  8026d8:	89 c2                	mov    %eax,%edx
  8026da:	b8 f4 ff ff ff       	mov    $0xfffffff4,%eax
  8026df:	81 fa ff 03 00 00    	cmp    $0x3ff,%edx
  8026e5:	7f 1f                	jg     802706 <remove+0x40>
		return -E_BAD_PATH;
	strcpy(fsipcbuf.remove.req_path, path);
  8026e7:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  8026eb:	c7 04 24 00 60 81 00 	movl   $0x816000,(%esp)
  8026f2:	e8 33 ea ff ff       	call   80112a <strcpy>
	return fsipc(FSREQ_REMOVE, NULL);
  8026f7:	ba 00 00 00 00       	mov    $0x0,%edx
  8026fc:	b8 07 00 00 00       	mov    $0x7,%eax
  802701:	e8 f2 fd ff ff       	call   8024f8 <fsipc>
}
  802706:	83 c4 14             	add    $0x14,%esp
  802709:	5b                   	pop    %ebx
  80270a:	5d                   	pop    %ebp
  80270b:	c3                   	ret    

0080270c <open>:
// 	The file descriptor index on success
// 	-E_BAD_PATH if the path is too long (>= MAXPATHLEN)
// 	< 0 for other errors.
int
open(const char *path, int mode)
{
  80270c:	55                   	push   %ebp
  80270d:	89 e5                	mov    %esp,%ebp
  80270f:	83 ec 28             	sub    $0x28,%esp
  802712:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  802715:	89 75 fc             	mov    %esi,-0x4(%ebp)
  802718:	8b 75 08             	mov    0x8(%ebp),%esi
	// Return the file descriptor index.
	// If any step after fd_alloc fails, use fd_close to free the
  struct Fd *f    = NULL;
  int r   = 0;

  if (!path)
  80271b:	bb fd ff ff ff       	mov    $0xfffffffd,%ebx
  802720:	85 f6                	test   %esi,%esi
  802722:	74 65                	je     802789 <open+0x7d>
	// (fd_alloc does not allocate a page, it just returns an
	// unused fd address.  Do you need to allocate a page?)
	//
	// Return the file descriptor index.
	// If any step after fd_alloc fails, use fd_close to free the
  struct Fd *f    = NULL;
  802724:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  int r   = 0;

  if (!path)
    return -E_INVAL;
  if((r=fd_alloc(&f))<0)
  80272b:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80272e:	89 04 24             	mov    %eax,(%esp)
  802731:	e8 75 f7 ff ff       	call   801eab <fd_alloc>
  802736:	89 c3                	mov    %eax,%ebx
  802738:	85 c0                	test   %eax,%eax
  80273a:	78 4d                	js     802789 <open+0x7d>
    return r;

	strcpy(fsipcbuf.open.req_path, path);
  80273c:	89 74 24 04          	mov    %esi,0x4(%esp)
  802740:	c7 04 24 00 60 81 00 	movl   $0x816000,(%esp)
  802747:	e8 de e9 ff ff       	call   80112a <strcpy>
	fsipcbuf.open.req_omode = mode;
  80274c:	8b 45 0c             	mov    0xc(%ebp),%eax
  80274f:	a3 00 64 81 00       	mov    %eax,0x816400

  if ((r=fsipc(FSREQ_OPEN, f))<0) {
  802754:	8b 55 f4             	mov    -0xc(%ebp),%edx
  802757:	b8 01 00 00 00       	mov    $0x1,%eax
  80275c:	e8 97 fd ff ff       	call   8024f8 <fsipc>
  802761:	89 c3                	mov    %eax,%ebx
  802763:	85 c0                	test   %eax,%eax
  802765:	79 15                	jns    80277c <open+0x70>
    fd_close(f, 0);
  802767:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80276e:	00 
  80276f:	8b 45 f4             	mov    -0xc(%ebp),%eax
  802772:	89 04 24             	mov    %eax,(%esp)
  802775:	e8 3a fb ff ff       	call   8022b4 <fd_close>
    return r;
  80277a:	eb 0d                	jmp    802789 <open+0x7d>
  }
  return fd2num(f);
  80277c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80277f:	89 04 24             	mov    %eax,(%esp)
  802782:	e8 f9 f6 ff ff       	call   801e80 <fd2num>
  802787:	89 c3                	mov    %eax,%ebx
}
  802789:	89 d8                	mov    %ebx,%eax
  80278b:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  80278e:	8b 75 fc             	mov    -0x4(%ebp),%esi
  802791:	89 ec                	mov    %ebp,%esp
  802793:	5d                   	pop    %ebp
  802794:	c3                   	ret    
	...

008027a0 <devsock_stat>:
	return nsipc_send(fd->fd_sock.sockid, buf, n, 0);
}

static int
devsock_stat(struct Fd *fd, struct Stat *stat)
{
  8027a0:	55                   	push   %ebp
  8027a1:	89 e5                	mov    %esp,%ebp
  8027a3:	83 ec 18             	sub    $0x18,%esp
	strcpy(stat->st_name, "<sock>");
  8027a6:	c7 44 24 04 38 2d 81 	movl   $0x812d38,0x4(%esp)
  8027ad:	00 
  8027ae:	8b 45 0c             	mov    0xc(%ebp),%eax
  8027b1:	89 04 24             	mov    %eax,(%esp)
  8027b4:	e8 71 e9 ff ff       	call   80112a <strcpy>
	return 0;
}
  8027b9:	b8 00 00 00 00       	mov    $0x0,%eax
  8027be:	c9                   	leave  
  8027bf:	c3                   	ret    

008027c0 <devsock_close>:
	return nsipc_shutdown(r, how);
}

static int
devsock_close(struct Fd *fd)
{
  8027c0:	55                   	push   %ebp
  8027c1:	89 e5                	mov    %esp,%ebp
  8027c3:	83 ec 18             	sub    $0x18,%esp
	return nsipc_close(fd->fd_sock.sockid);
  8027c6:	8b 45 08             	mov    0x8(%ebp),%eax
  8027c9:	8b 40 0c             	mov    0xc(%eax),%eax
  8027cc:	89 04 24             	mov    %eax,(%esp)
  8027cf:	e8 9d 02 00 00       	call   802a71 <nsipc_close>
}
  8027d4:	c9                   	leave  
  8027d5:	c3                   	ret    

008027d6 <devsock_write>:
	return nsipc_recv(fd->fd_sock.sockid, buf, n, 0);
}

static ssize_t
devsock_write(struct Fd *fd, const void *buf, size_t n)
{
  8027d6:	55                   	push   %ebp
  8027d7:	89 e5                	mov    %esp,%ebp
  8027d9:	83 ec 18             	sub    $0x18,%esp
	return nsipc_send(fd->fd_sock.sockid, buf, n, 0);
  8027dc:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  8027e3:	00 
  8027e4:	8b 45 10             	mov    0x10(%ebp),%eax
  8027e7:	89 44 24 08          	mov    %eax,0x8(%esp)
  8027eb:	8b 45 0c             	mov    0xc(%ebp),%eax
  8027ee:	89 44 24 04          	mov    %eax,0x4(%esp)
  8027f2:	8b 45 08             	mov    0x8(%ebp),%eax
  8027f5:	8b 40 0c             	mov    0xc(%eax),%eax
  8027f8:	89 04 24             	mov    %eax,(%esp)
  8027fb:	e8 ad 02 00 00       	call   802aad <nsipc_send>
}
  802800:	c9                   	leave  
  802801:	c3                   	ret    

00802802 <devsock_read>:
	return nsipc_listen(r, backlog);
}

static ssize_t
devsock_read(struct Fd *fd, void *buf, size_t n)
{
  802802:	55                   	push   %ebp
  802803:	89 e5                	mov    %esp,%ebp
  802805:	83 ec 18             	sub    $0x18,%esp
	return nsipc_recv(fd->fd_sock.sockid, buf, n, 0);
  802808:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  80280f:	00 
  802810:	8b 45 10             	mov    0x10(%ebp),%eax
  802813:	89 44 24 08          	mov    %eax,0x8(%esp)
  802817:	8b 45 0c             	mov    0xc(%ebp),%eax
  80281a:	89 44 24 04          	mov    %eax,0x4(%esp)
  80281e:	8b 45 08             	mov    0x8(%ebp),%eax
  802821:	8b 40 0c             	mov    0xc(%eax),%eax
  802824:	89 04 24             	mov    %eax,(%esp)
  802827:	e8 f4 02 00 00       	call   802b20 <nsipc_recv>
}
  80282c:	c9                   	leave  
  80282d:	c3                   	ret    

0080282e <alloc_sockfd>:
	return sfd->fd_sock.sockid;
}

static int
alloc_sockfd(int sockid)
{
  80282e:	55                   	push   %ebp
  80282f:	89 e5                	mov    %esp,%ebp
  802831:	56                   	push   %esi
  802832:	53                   	push   %ebx
  802833:	83 ec 20             	sub    $0x20,%esp
  802836:	89 c6                	mov    %eax,%esi
	struct Fd *sfd;
	int r;

	if ((r = fd_alloc(&sfd)) < 0
  802838:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80283b:	89 04 24             	mov    %eax,(%esp)
  80283e:	e8 68 f6 ff ff       	call   801eab <fd_alloc>
  802843:	89 c3                	mov    %eax,%ebx
  802845:	85 c0                	test   %eax,%eax
  802847:	78 21                	js     80286a <alloc_sockfd+0x3c>
	    || (r = sys_page_alloc(0, sfd, PTE_P|PTE_W|PTE_U)) < 0) {
  802849:	c7 44 24 08 07 00 00 	movl   $0x7,0x8(%esp)
  802850:	00 
  802851:	8b 45 f4             	mov    -0xc(%ebp),%eax
  802854:	89 44 24 04          	mov    %eax,0x4(%esp)
  802858:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80285f:	e8 22 f0 ff ff       	call   801886 <sys_page_alloc>
  802864:	89 c3                	mov    %eax,%ebx
alloc_sockfd(int sockid)
{
	struct Fd *sfd;
	int r;

	if ((r = fd_alloc(&sfd)) < 0
  802866:	85 c0                	test   %eax,%eax
  802868:	79 0a                	jns    802874 <alloc_sockfd+0x46>
	    || (r = sys_page_alloc(0, sfd, PTE_P|PTE_W|PTE_U)) < 0) {
		nsipc_close(sockid);
  80286a:	89 34 24             	mov    %esi,(%esp)
  80286d:	e8 ff 01 00 00       	call   802a71 <nsipc_close>
		return r;
  802872:	eb 28                	jmp    80289c <alloc_sockfd+0x6e>
	}

	sfd->fd_dev_id = devsock.dev_id;
  802874:	8b 15 20 90 81 00    	mov    0x819020,%edx
  80287a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80287d:	89 10                	mov    %edx,(%eax)
	sfd->fd_omode = O_RDWR;
  80287f:	8b 45 f4             	mov    -0xc(%ebp),%eax
  802882:	c7 40 08 02 00 00 00 	movl   $0x2,0x8(%eax)
	sfd->fd_sock.sockid = sockid;
  802889:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80288c:	89 70 0c             	mov    %esi,0xc(%eax)
	return fd2num(sfd);
  80288f:	8b 45 f4             	mov    -0xc(%ebp),%eax
  802892:	89 04 24             	mov    %eax,(%esp)
  802895:	e8 e6 f5 ff ff       	call   801e80 <fd2num>
  80289a:	89 c3                	mov    %eax,%ebx
}
  80289c:	89 d8                	mov    %ebx,%eax
  80289e:	83 c4 20             	add    $0x20,%esp
  8028a1:	5b                   	pop    %ebx
  8028a2:	5e                   	pop    %esi
  8028a3:	5d                   	pop    %ebp
  8028a4:	c3                   	ret    

008028a5 <socket>:
	return 0;
}

int
socket(int domain, int type, int protocol)
{
  8028a5:	55                   	push   %ebp
  8028a6:	89 e5                	mov    %esp,%ebp
  8028a8:	83 ec 18             	sub    $0x18,%esp
	int r;
	if ((r = nsipc_socket(domain, type, protocol)) < 0)
  8028ab:	8b 45 10             	mov    0x10(%ebp),%eax
  8028ae:	89 44 24 08          	mov    %eax,0x8(%esp)
  8028b2:	8b 45 0c             	mov    0xc(%ebp),%eax
  8028b5:	89 44 24 04          	mov    %eax,0x4(%esp)
  8028b9:	8b 45 08             	mov    0x8(%ebp),%eax
  8028bc:	89 04 24             	mov    %eax,(%esp)
  8028bf:	e8 61 01 00 00       	call   802a25 <nsipc_socket>
  8028c4:	85 c0                	test   %eax,%eax
  8028c6:	78 05                	js     8028cd <socket+0x28>
		return r;
	return alloc_sockfd(r);
  8028c8:	e8 61 ff ff ff       	call   80282e <alloc_sockfd>
}
  8028cd:	c9                   	leave  
  8028ce:	66 90                	xchg   %ax,%ax
  8028d0:	c3                   	ret    

008028d1 <fd2sockid>:
	.dev_stat =	devsock_stat,
};

static int
fd2sockid(int fd)
{
  8028d1:	55                   	push   %ebp
  8028d2:	89 e5                	mov    %esp,%ebp
  8028d4:	83 ec 28             	sub    $0x28,%esp
	struct Fd *sfd;
	int r;

	if ((r = fd_lookup(fd, &sfd)) < 0)
  8028d7:	8d 55 f4             	lea    -0xc(%ebp),%edx
  8028da:	89 54 24 04          	mov    %edx,0x4(%esp)
  8028de:	89 04 24             	mov    %eax,(%esp)
  8028e1:	e8 37 f6 ff ff       	call   801f1d <fd_lookup>
  8028e6:	85 c0                	test   %eax,%eax
  8028e8:	78 15                	js     8028ff <fd2sockid+0x2e>
		return r;
	if (sfd->fd_dev_id != devsock.dev_id)
  8028ea:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8028ed:	8b 0a                	mov    (%edx),%ecx
  8028ef:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  8028f4:	3b 0d 20 90 81 00    	cmp    0x819020,%ecx
  8028fa:	75 03                	jne    8028ff <fd2sockid+0x2e>
		return -E_NOT_SUPP;
	return sfd->fd_sock.sockid;
  8028fc:	8b 42 0c             	mov    0xc(%edx),%eax
}
  8028ff:	c9                   	leave  
  802900:	c3                   	ret    

00802901 <listen>:
	return nsipc_connect(r, name, namelen);
}

int
listen(int s, int backlog)
{
  802901:	55                   	push   %ebp
  802902:	89 e5                	mov    %esp,%ebp
  802904:	83 ec 18             	sub    $0x18,%esp
	int r;
	if ((r = fd2sockid(s)) < 0)
  802907:	8b 45 08             	mov    0x8(%ebp),%eax
  80290a:	e8 c2 ff ff ff       	call   8028d1 <fd2sockid>
  80290f:	85 c0                	test   %eax,%eax
  802911:	78 0f                	js     802922 <listen+0x21>
		return r;
	return nsipc_listen(r, backlog);
  802913:	8b 55 0c             	mov    0xc(%ebp),%edx
  802916:	89 54 24 04          	mov    %edx,0x4(%esp)
  80291a:	89 04 24             	mov    %eax,(%esp)
  80291d:	e8 2d 01 00 00       	call   802a4f <nsipc_listen>
}
  802922:	c9                   	leave  
  802923:	c3                   	ret    

00802924 <connect>:
	return nsipc_close(fd->fd_sock.sockid);
}

int
connect(int s, const struct sockaddr *name, socklen_t namelen)
{
  802924:	55                   	push   %ebp
  802925:	89 e5                	mov    %esp,%ebp
  802927:	83 ec 18             	sub    $0x18,%esp
	int r;
	if ((r = fd2sockid(s)) < 0)
  80292a:	8b 45 08             	mov    0x8(%ebp),%eax
  80292d:	e8 9f ff ff ff       	call   8028d1 <fd2sockid>
  802932:	85 c0                	test   %eax,%eax
  802934:	78 16                	js     80294c <connect+0x28>
		return r;
	return nsipc_connect(r, name, namelen);
  802936:	8b 55 10             	mov    0x10(%ebp),%edx
  802939:	89 54 24 08          	mov    %edx,0x8(%esp)
  80293d:	8b 55 0c             	mov    0xc(%ebp),%edx
  802940:	89 54 24 04          	mov    %edx,0x4(%esp)
  802944:	89 04 24             	mov    %eax,(%esp)
  802947:	e8 54 02 00 00       	call   802ba0 <nsipc_connect>
}
  80294c:	c9                   	leave  
  80294d:	c3                   	ret    

0080294e <shutdown>:
	return nsipc_bind(r, name, namelen);
}

int
shutdown(int s, int how)
{
  80294e:	55                   	push   %ebp
  80294f:	89 e5                	mov    %esp,%ebp
  802951:	83 ec 18             	sub    $0x18,%esp
	int r;
	if ((r = fd2sockid(s)) < 0)
  802954:	8b 45 08             	mov    0x8(%ebp),%eax
  802957:	e8 75 ff ff ff       	call   8028d1 <fd2sockid>
  80295c:	85 c0                	test   %eax,%eax
  80295e:	78 0f                	js     80296f <shutdown+0x21>
		return r;
	return nsipc_shutdown(r, how);
  802960:	8b 55 0c             	mov    0xc(%ebp),%edx
  802963:	89 54 24 04          	mov    %edx,0x4(%esp)
  802967:	89 04 24             	mov    %eax,(%esp)
  80296a:	e8 1c 01 00 00       	call   802a8b <nsipc_shutdown>
}
  80296f:	c9                   	leave  
  802970:	c3                   	ret    

00802971 <bind>:
	return alloc_sockfd(r);
}

int
bind(int s, struct sockaddr *name, socklen_t namelen)
{
  802971:	55                   	push   %ebp
  802972:	89 e5                	mov    %esp,%ebp
  802974:	83 ec 18             	sub    $0x18,%esp
	int r;
	if ((r = fd2sockid(s)) < 0)
  802977:	8b 45 08             	mov    0x8(%ebp),%eax
  80297a:	e8 52 ff ff ff       	call   8028d1 <fd2sockid>
  80297f:	85 c0                	test   %eax,%eax
  802981:	78 16                	js     802999 <bind+0x28>
		return r;
	return nsipc_bind(r, name, namelen);
  802983:	8b 55 10             	mov    0x10(%ebp),%edx
  802986:	89 54 24 08          	mov    %edx,0x8(%esp)
  80298a:	8b 55 0c             	mov    0xc(%ebp),%edx
  80298d:	89 54 24 04          	mov    %edx,0x4(%esp)
  802991:	89 04 24             	mov    %eax,(%esp)
  802994:	e8 46 02 00 00       	call   802bdf <nsipc_bind>
}
  802999:	c9                   	leave  
  80299a:	c3                   	ret    

0080299b <accept>:
	return fd2num(sfd);
}

int
accept(int s, struct sockaddr *addr, socklen_t *addrlen)
{
  80299b:	55                   	push   %ebp
  80299c:	89 e5                	mov    %esp,%ebp
  80299e:	83 ec 18             	sub    $0x18,%esp
	int r;
	if ((r = fd2sockid(s)) < 0)
  8029a1:	8b 45 08             	mov    0x8(%ebp),%eax
  8029a4:	e8 28 ff ff ff       	call   8028d1 <fd2sockid>
  8029a9:	85 c0                	test   %eax,%eax
  8029ab:	78 1f                	js     8029cc <accept+0x31>
		return r;
	if ((r = nsipc_accept(r, addr, addrlen)) < 0)
  8029ad:	8b 55 10             	mov    0x10(%ebp),%edx
  8029b0:	89 54 24 08          	mov    %edx,0x8(%esp)
  8029b4:	8b 55 0c             	mov    0xc(%ebp),%edx
  8029b7:	89 54 24 04          	mov    %edx,0x4(%esp)
  8029bb:	89 04 24             	mov    %eax,(%esp)
  8029be:	e8 5b 02 00 00       	call   802c1e <nsipc_accept>
  8029c3:	85 c0                	test   %eax,%eax
  8029c5:	78 05                	js     8029cc <accept+0x31>
		return r;
	return alloc_sockfd(r);
  8029c7:	e8 62 fe ff ff       	call   80282e <alloc_sockfd>
}
  8029cc:	c9                   	leave  
  8029cd:	8d 76 00             	lea    0x0(%esi),%esi
  8029d0:	c3                   	ret    
	...

008029e0 <nsipc>:
// may be written back to nsipcbuf.
// type: request code, passed as the simple integer IPC value.
// Returns 0 if successful, < 0 on failure.
static int
nsipc(unsigned type)
{
  8029e0:	55                   	push   %ebp
  8029e1:	89 e5                	mov    %esp,%ebp
  8029e3:	83 ec 28             	sub    $0x28,%esp
    int r=0;
    envid_t from;
	if (debug)
		cprintf("[%08x] nsipc %d\n", env->env_id, type);

	ipc_send(envs[2].env_id, type, &nsipcbuf, PTE_P|PTE_W|PTE_U);
  8029e6:	8b 15 44 01 c0 ee    	mov    0xeec00144,%edx
  8029ec:	c7 44 24 0c 07 00 00 	movl   $0x7,0xc(%esp)
  8029f3:	00 
  8029f4:	c7 44 24 08 00 80 81 	movl   $0x818000,0x8(%esp)
  8029fb:	00 
  8029fc:	89 44 24 04          	mov    %eax,0x4(%esp)
  802a00:	89 14 24             	mov    %edx,(%esp)
  802a03:	e8 a8 f3 ff ff       	call   801db0 <ipc_send>
	r=ipc_recv(&from, NULL, NULL);
  802a08:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  802a0f:	00 
  802a10:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  802a17:	00 
  802a18:	8d 45 f4             	lea    -0xc(%ebp),%eax
  802a1b:	89 04 24             	mov    %eax,(%esp)
  802a1e:	e8 ff f3 ff ff       	call   801e22 <ipc_recv>
    return r;
}
  802a23:	c9                   	leave  
  802a24:	c3                   	ret    

00802a25 <nsipc_socket>:
	return nsipc(NSREQ_SEND);
}

int
nsipc_socket(int domain, int type, int protocol)
{
  802a25:	55                   	push   %ebp
  802a26:	89 e5                	mov    %esp,%ebp
  802a28:	83 ec 08             	sub    $0x8,%esp
	nsipcbuf.socket.req_domain = domain;
  802a2b:	8b 45 08             	mov    0x8(%ebp),%eax
  802a2e:	a3 00 80 81 00       	mov    %eax,0x818000
	nsipcbuf.socket.req_type = type;
  802a33:	8b 45 0c             	mov    0xc(%ebp),%eax
  802a36:	a3 04 80 81 00       	mov    %eax,0x818004
	nsipcbuf.socket.req_protocol = protocol;
  802a3b:	8b 45 10             	mov    0x10(%ebp),%eax
  802a3e:	a3 08 80 81 00       	mov    %eax,0x818008
	return nsipc(NSREQ_SOCKET);
  802a43:	b8 09 00 00 00       	mov    $0x9,%eax
  802a48:	e8 93 ff ff ff       	call   8029e0 <nsipc>
}
  802a4d:	c9                   	leave  
  802a4e:	c3                   	ret    

00802a4f <nsipc_listen>:
	return nsipc(NSREQ_CONNECT);
}

int
nsipc_listen(int s, int backlog)
{
  802a4f:	55                   	push   %ebp
  802a50:	89 e5                	mov    %esp,%ebp
  802a52:	83 ec 08             	sub    $0x8,%esp
	nsipcbuf.listen.req_s = s;
  802a55:	8b 45 08             	mov    0x8(%ebp),%eax
  802a58:	a3 00 80 81 00       	mov    %eax,0x818000
	nsipcbuf.listen.req_backlog = backlog;
  802a5d:	8b 45 0c             	mov    0xc(%ebp),%eax
  802a60:	a3 04 80 81 00       	mov    %eax,0x818004
	return nsipc(NSREQ_LISTEN);
  802a65:	b8 06 00 00 00       	mov    $0x6,%eax
  802a6a:	e8 71 ff ff ff       	call   8029e0 <nsipc>
}
  802a6f:	c9                   	leave  
  802a70:	c3                   	ret    

00802a71 <nsipc_close>:
	return nsipc(NSREQ_SHUTDOWN);
}

int
nsipc_close(int s)
{
  802a71:	55                   	push   %ebp
  802a72:	89 e5                	mov    %esp,%ebp
  802a74:	83 ec 08             	sub    $0x8,%esp
	nsipcbuf.close.req_s = s;
  802a77:	8b 45 08             	mov    0x8(%ebp),%eax
  802a7a:	a3 00 80 81 00       	mov    %eax,0x818000
	return nsipc(NSREQ_CLOSE);
  802a7f:	b8 04 00 00 00       	mov    $0x4,%eax
  802a84:	e8 57 ff ff ff       	call   8029e0 <nsipc>
}
  802a89:	c9                   	leave  
  802a8a:	c3                   	ret    

00802a8b <nsipc_shutdown>:
	return nsipc(NSREQ_BIND);
}

int
nsipc_shutdown(int s, int how)
{
  802a8b:	55                   	push   %ebp
  802a8c:	89 e5                	mov    %esp,%ebp
  802a8e:	83 ec 08             	sub    $0x8,%esp
	nsipcbuf.shutdown.req_s = s;
  802a91:	8b 45 08             	mov    0x8(%ebp),%eax
  802a94:	a3 00 80 81 00       	mov    %eax,0x818000
	nsipcbuf.shutdown.req_how = how;
  802a99:	8b 45 0c             	mov    0xc(%ebp),%eax
  802a9c:	a3 04 80 81 00       	mov    %eax,0x818004
	return nsipc(NSREQ_SHUTDOWN);
  802aa1:	b8 03 00 00 00       	mov    $0x3,%eax
  802aa6:	e8 35 ff ff ff       	call   8029e0 <nsipc>
}
  802aab:	c9                   	leave  
  802aac:	c3                   	ret    

00802aad <nsipc_send>:
	return r;
}

int
nsipc_send(int s, const void *buf, int size, unsigned int flags)
{
  802aad:	55                   	push   %ebp
  802aae:	89 e5                	mov    %esp,%ebp
  802ab0:	53                   	push   %ebx
  802ab1:	83 ec 14             	sub    $0x14,%esp
  802ab4:	8b 5d 10             	mov    0x10(%ebp),%ebx
	nsipcbuf.send.req_s = s;
  802ab7:	8b 45 08             	mov    0x8(%ebp),%eax
  802aba:	a3 00 80 81 00       	mov    %eax,0x818000
	assert(size < 1600);
  802abf:	81 fb 3f 06 00 00    	cmp    $0x63f,%ebx
  802ac5:	7e 24                	jle    802aeb <nsipc_send+0x3e>
  802ac7:	c7 44 24 0c 44 2d 81 	movl   $0x812d44,0xc(%esp)
  802ace:	00 
  802acf:	c7 44 24 08 50 2d 81 	movl   $0x812d50,0x8(%esp)
  802ad6:	00 
  802ad7:	c7 44 24 04 69 00 00 	movl   $0x69,0x4(%esp)
  802ade:	00 
  802adf:	c7 04 24 65 2d 81 00 	movl   $0x812d65,(%esp)
  802ae6:	e8 b1 de ff ff       	call   80099c <_panic>
	memmove(&nsipcbuf.send.req_buf, buf, size);
  802aeb:	89 5c 24 08          	mov    %ebx,0x8(%esp)
  802aef:	8b 45 0c             	mov    0xc(%ebp),%eax
  802af2:	89 44 24 04          	mov    %eax,0x4(%esp)
  802af6:	c7 04 24 0c 80 81 00 	movl   $0x81800c,(%esp)
  802afd:	e8 e3 e7 ff ff       	call   8012e5 <memmove>
	nsipcbuf.send.req_size = size;
  802b02:	89 1d 04 80 81 00    	mov    %ebx,0x818004
	nsipcbuf.send.req_flags = flags;
  802b08:	8b 45 14             	mov    0x14(%ebp),%eax
  802b0b:	a3 08 80 81 00       	mov    %eax,0x818008
	return nsipc(NSREQ_SEND);
  802b10:	b8 08 00 00 00       	mov    $0x8,%eax
  802b15:	e8 c6 fe ff ff       	call   8029e0 <nsipc>
}
  802b1a:	83 c4 14             	add    $0x14,%esp
  802b1d:	5b                   	pop    %ebx
  802b1e:	5d                   	pop    %ebp
  802b1f:	c3                   	ret    

00802b20 <nsipc_recv>:
	return nsipc(NSREQ_LISTEN);
}

int
nsipc_recv(int s, void *mem, int len, unsigned int flags)
{
  802b20:	55                   	push   %ebp
  802b21:	89 e5                	mov    %esp,%ebp
  802b23:	56                   	push   %esi
  802b24:	53                   	push   %ebx
  802b25:	83 ec 10             	sub    $0x10,%esp
  802b28:	8b 75 10             	mov    0x10(%ebp),%esi
	int r;

	nsipcbuf.recv.req_s = s;
  802b2b:	8b 45 08             	mov    0x8(%ebp),%eax
  802b2e:	a3 00 80 81 00       	mov    %eax,0x818000
	nsipcbuf.recv.req_len = len;
  802b33:	89 35 04 80 81 00    	mov    %esi,0x818004
	nsipcbuf.recv.req_flags = flags;
  802b39:	8b 45 14             	mov    0x14(%ebp),%eax
  802b3c:	a3 08 80 81 00       	mov    %eax,0x818008

	if ((r = nsipc(NSREQ_RECV)) >= 0) {
  802b41:	b8 07 00 00 00       	mov    $0x7,%eax
  802b46:	e8 95 fe ff ff       	call   8029e0 <nsipc>
  802b4b:	89 c3                	mov    %eax,%ebx
  802b4d:	85 c0                	test   %eax,%eax
  802b4f:	78 46                	js     802b97 <nsipc_recv+0x77>
		assert(r < 1600 && r <= len);
  802b51:	3d 3f 06 00 00       	cmp    $0x63f,%eax
  802b56:	7f 04                	jg     802b5c <nsipc_recv+0x3c>
  802b58:	39 c6                	cmp    %eax,%esi
  802b5a:	7d 24                	jge    802b80 <nsipc_recv+0x60>
  802b5c:	c7 44 24 0c 71 2d 81 	movl   $0x812d71,0xc(%esp)
  802b63:	00 
  802b64:	c7 44 24 08 50 2d 81 	movl   $0x812d50,0x8(%esp)
  802b6b:	00 
  802b6c:	c7 44 24 04 5e 00 00 	movl   $0x5e,0x4(%esp)
  802b73:	00 
  802b74:	c7 04 24 65 2d 81 00 	movl   $0x812d65,(%esp)
  802b7b:	e8 1c de ff ff       	call   80099c <_panic>
		memmove(mem, nsipcbuf.recvRet.ret_buf, r);
  802b80:	89 44 24 08          	mov    %eax,0x8(%esp)
  802b84:	c7 44 24 04 00 80 81 	movl   $0x818000,0x4(%esp)
  802b8b:	00 
  802b8c:	8b 45 0c             	mov    0xc(%ebp),%eax
  802b8f:	89 04 24             	mov    %eax,(%esp)
  802b92:	e8 4e e7 ff ff       	call   8012e5 <memmove>
	}

	return r;
}
  802b97:	89 d8                	mov    %ebx,%eax
  802b99:	83 c4 10             	add    $0x10,%esp
  802b9c:	5b                   	pop    %ebx
  802b9d:	5e                   	pop    %esi
  802b9e:	5d                   	pop    %ebp
  802b9f:	c3                   	ret    

00802ba0 <nsipc_connect>:
	return nsipc(NSREQ_CLOSE);
}

int
nsipc_connect(int s, const struct sockaddr *name, socklen_t namelen)
{
  802ba0:	55                   	push   %ebp
  802ba1:	89 e5                	mov    %esp,%ebp
  802ba3:	53                   	push   %ebx
  802ba4:	83 ec 14             	sub    $0x14,%esp
  802ba7:	8b 5d 10             	mov    0x10(%ebp),%ebx
	nsipcbuf.connect.req_s = s;
  802baa:	8b 45 08             	mov    0x8(%ebp),%eax
  802bad:	a3 00 80 81 00       	mov    %eax,0x818000
	memmove(&nsipcbuf.connect.req_name, name, namelen);
  802bb2:	89 5c 24 08          	mov    %ebx,0x8(%esp)
  802bb6:	8b 45 0c             	mov    0xc(%ebp),%eax
  802bb9:	89 44 24 04          	mov    %eax,0x4(%esp)
  802bbd:	c7 04 24 04 80 81 00 	movl   $0x818004,(%esp)
  802bc4:	e8 1c e7 ff ff       	call   8012e5 <memmove>
	nsipcbuf.connect.req_namelen = namelen;
  802bc9:	89 1d 14 80 81 00    	mov    %ebx,0x818014
	return nsipc(NSREQ_CONNECT);
  802bcf:	b8 05 00 00 00       	mov    $0x5,%eax
  802bd4:	e8 07 fe ff ff       	call   8029e0 <nsipc>
}
  802bd9:	83 c4 14             	add    $0x14,%esp
  802bdc:	5b                   	pop    %ebx
  802bdd:	5d                   	pop    %ebp
  802bde:	c3                   	ret    

00802bdf <nsipc_bind>:
	return r;
}

int
nsipc_bind(int s, struct sockaddr *name, socklen_t namelen)
{
  802bdf:	55                   	push   %ebp
  802be0:	89 e5                	mov    %esp,%ebp
  802be2:	53                   	push   %ebx
  802be3:	83 ec 14             	sub    $0x14,%esp
  802be6:	8b 5d 10             	mov    0x10(%ebp),%ebx
	nsipcbuf.bind.req_s = s;
  802be9:	8b 45 08             	mov    0x8(%ebp),%eax
  802bec:	a3 00 80 81 00       	mov    %eax,0x818000
	memmove(&nsipcbuf.bind.req_name, name, namelen);
  802bf1:	89 5c 24 08          	mov    %ebx,0x8(%esp)
  802bf5:	8b 45 0c             	mov    0xc(%ebp),%eax
  802bf8:	89 44 24 04          	mov    %eax,0x4(%esp)
  802bfc:	c7 04 24 04 80 81 00 	movl   $0x818004,(%esp)
  802c03:	e8 dd e6 ff ff       	call   8012e5 <memmove>
	nsipcbuf.bind.req_namelen = namelen;
  802c08:	89 1d 14 80 81 00    	mov    %ebx,0x818014
	return nsipc(NSREQ_BIND);
  802c0e:	b8 02 00 00 00       	mov    $0x2,%eax
  802c13:	e8 c8 fd ff ff       	call   8029e0 <nsipc>
}
  802c18:	83 c4 14             	add    $0x14,%esp
  802c1b:	5b                   	pop    %ebx
  802c1c:	5d                   	pop    %ebp
  802c1d:	c3                   	ret    

00802c1e <nsipc_accept>:
    return r;
}

int
nsipc_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
{
  802c1e:	55                   	push   %ebp
  802c1f:	89 e5                	mov    %esp,%ebp
  802c21:	83 ec 18             	sub    $0x18,%esp
  802c24:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  802c27:	89 75 fc             	mov    %esi,-0x4(%ebp)
	int r;
	
	nsipcbuf.accept.req_s = s;
  802c2a:	8b 45 08             	mov    0x8(%ebp),%eax
  802c2d:	a3 00 80 81 00       	mov    %eax,0x818000
	if ((r = nsipc(NSREQ_ACCEPT)) >= 0) {
  802c32:	b8 01 00 00 00       	mov    $0x1,%eax
  802c37:	e8 a4 fd ff ff       	call   8029e0 <nsipc>
  802c3c:	89 c3                	mov    %eax,%ebx
  802c3e:	85 c0                	test   %eax,%eax
  802c40:	78 25                	js     802c67 <nsipc_accept+0x49>
		struct Nsret_accept *ret = &nsipcbuf.acceptRet;
		memmove(addr, &ret->ret_addr, ret->ret_addrlen);
  802c42:	be 10 80 81 00       	mov    $0x818010,%esi
  802c47:	8b 06                	mov    (%esi),%eax
  802c49:	89 44 24 08          	mov    %eax,0x8(%esp)
  802c4d:	c7 44 24 04 00 80 81 	movl   $0x818000,0x4(%esp)
  802c54:	00 
  802c55:	8b 45 0c             	mov    0xc(%ebp),%eax
  802c58:	89 04 24             	mov    %eax,(%esp)
  802c5b:	e8 85 e6 ff ff       	call   8012e5 <memmove>
		*addrlen = ret->ret_addrlen;
  802c60:	8b 16                	mov    (%esi),%edx
  802c62:	8b 45 10             	mov    0x10(%ebp),%eax
  802c65:	89 10                	mov    %edx,(%eax)
	}
	return r;
}
  802c67:	89 d8                	mov    %ebx,%eax
  802c69:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  802c6c:	8b 75 fc             	mov    -0x4(%ebp),%esi
  802c6f:	89 ec                	mov    %ebp,%esp
  802c71:	5d                   	pop    %ebp
  802c72:	c3                   	ret    
	...

00802c80 <free>:
	return v;
}

void
free(void *v)
{
  802c80:	55                   	push   %ebp
  802c81:	89 e5                	mov    %esp,%ebp
  802c83:	56                   	push   %esi
  802c84:	53                   	push   %ebx
  802c85:	83 ec 10             	sub    $0x10,%esp
  802c88:	8b 5d 08             	mov    0x8(%ebp),%ebx
	uint8_t *c;
	uint32_t *ref;

	if (v == 0)
  802c8b:	85 db                	test   %ebx,%ebx
  802c8d:	0f 84 b9 00 00 00    	je     802d4c <free+0xcc>
		return;
	assert(mbegin <= (uint8_t*) v && (uint8_t*) v < mend);
  802c93:	81 fb ff ff ff 07    	cmp    $0x7ffffff,%ebx
  802c99:	76 08                	jbe    802ca3 <free+0x23>
  802c9b:	81 fb ff ff ff 0f    	cmp    $0xfffffff,%ebx
  802ca1:	76 24                	jbe    802cc7 <free+0x47>
  802ca3:	c7 44 24 0c 88 2d 81 	movl   $0x812d88,0xc(%esp)
  802caa:	00 
  802cab:	c7 44 24 08 50 2d 81 	movl   $0x812d50,0x8(%esp)
  802cb2:	00 
  802cb3:	c7 44 24 04 7a 00 00 	movl   $0x7a,0x4(%esp)
  802cba:	00 
  802cbb:	c7 04 24 b6 2d 81 00 	movl   $0x812db6,(%esp)
  802cc2:	e8 d5 dc ff ff       	call   80099c <_panic>

	c = ROUNDDOWN(v, PGSIZE);
  802cc7:	81 e3 00 f0 ff ff    	and    $0xfffff000,%ebx

	while (vpt[VPN(c)] & PTE_CONTINUED) {
  802ccd:	be 00 00 40 ef       	mov    $0xef400000,%esi
  802cd2:	eb 4a                	jmp    802d1e <free+0x9e>
		sys_page_unmap(0, c);
  802cd4:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  802cd8:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  802cdf:	e8 e6 ea ff ff       	call   8017ca <sys_page_unmap>
		c += PGSIZE;
  802ce4:	81 c3 00 10 00 00    	add    $0x1000,%ebx
		assert(mbegin <= c && c < mend);
  802cea:	81 fb ff ff ff 07    	cmp    $0x7ffffff,%ebx
  802cf0:	76 08                	jbe    802cfa <free+0x7a>
  802cf2:	81 fb ff ff ff 0f    	cmp    $0xfffffff,%ebx
  802cf8:	76 24                	jbe    802d1e <free+0x9e>
  802cfa:	c7 44 24 0c c3 2d 81 	movl   $0x812dc3,0xc(%esp)
  802d01:	00 
  802d02:	c7 44 24 08 50 2d 81 	movl   $0x812d50,0x8(%esp)
  802d09:	00 
  802d0a:	c7 44 24 04 81 00 00 	movl   $0x81,0x4(%esp)
  802d11:	00 
  802d12:	c7 04 24 b6 2d 81 00 	movl   $0x812db6,(%esp)
  802d19:	e8 7e dc ff ff       	call   80099c <_panic>
		return;
	assert(mbegin <= (uint8_t*) v && (uint8_t*) v < mend);

	c = ROUNDDOWN(v, PGSIZE);

	while (vpt[VPN(c)] & PTE_CONTINUED) {
  802d1e:	89 d8                	mov    %ebx,%eax
  802d20:	c1 e8 0c             	shr    $0xc,%eax
  802d23:	8b 04 86             	mov    (%esi,%eax,4),%eax
  802d26:	f6 c4 04             	test   $0x4,%ah
  802d29:	75 a9                	jne    802cd4 <free+0x54>

	/*
	 * c is just a piece of this page, so dec the ref count
	 * and maybe free the page.
	 */
	ref = (uint32_t*) (c + PGSIZE - 4);
  802d2b:	8d 93 fc 0f 00 00    	lea    0xffc(%ebx),%edx
	if (--(*ref) == 0)
  802d31:	8b 02                	mov    (%edx),%eax
  802d33:	83 e8 01             	sub    $0x1,%eax
  802d36:	89 02                	mov    %eax,(%edx)
  802d38:	85 c0                	test   %eax,%eax
  802d3a:	75 10                	jne    802d4c <free+0xcc>
		sys_page_unmap(0, c);	
  802d3c:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  802d40:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  802d47:	e8 7e ea ff ff       	call   8017ca <sys_page_unmap>
}
  802d4c:	83 c4 10             	add    $0x10,%esp
  802d4f:	5b                   	pop    %ebx
  802d50:	5e                   	pop    %esi
  802d51:	5d                   	pop    %ebp
  802d52:	c3                   	ret    

00802d53 <malloc>:
	return 1;
}

void*
malloc(size_t n)
{
  802d53:	55                   	push   %ebp
  802d54:	89 e5                	mov    %esp,%ebp
  802d56:	57                   	push   %edi
  802d57:	56                   	push   %esi
  802d58:	53                   	push   %ebx
  802d59:	83 ec 3c             	sub    $0x3c,%esp
	int i, cont;
	int nwrap;
	uint32_t *ref;
	void *v;

	if (mptr == 0)
  802d5c:	83 3d 10 94 81 00 00 	cmpl   $0x0,0x819410
  802d63:	75 0a                	jne    802d6f <malloc+0x1c>
		mptr = mbegin;
  802d65:	c7 05 10 94 81 00 00 	movl   $0x8000000,0x819410
  802d6c:	00 00 08 

	n = ROUNDUP(n, 4);
  802d6f:	8b 45 08             	mov    0x8(%ebp),%eax
  802d72:	83 c0 03             	add    $0x3,%eax
  802d75:	83 e0 fc             	and    $0xfffffffc,%eax
  802d78:	89 45 d8             	mov    %eax,-0x28(%ebp)

	if (n >= MAXMALLOC)
  802d7b:	3d ff ff 0f 00       	cmp    $0xfffff,%eax
  802d80:	0f 87 97 01 00 00    	ja     802f1d <malloc+0x1ca>
		return 0;

	if ((uintptr_t) mptr % PGSIZE){
  802d86:	a1 10 94 81 00       	mov    0x819410,%eax
  802d8b:	89 c2                	mov    %eax,%edx
  802d8d:	a9 ff 0f 00 00       	test   $0xfff,%eax
  802d92:	74 4d                	je     802de1 <malloc+0x8e>
		 * we're in the middle of a partially
		 * allocated page - can we add this chunk?
		 * the +4 below is for the ref count.
		 */
		ref = (uint32_t*) (ROUNDUP(mptr, PGSIZE) - 4);
		if ((uintptr_t) mptr / PGSIZE == (uintptr_t) (mptr + n - 1 + 4) / PGSIZE) {
  802d94:	89 c3                	mov    %eax,%ebx
  802d96:	c1 eb 0c             	shr    $0xc,%ebx
  802d99:	8b 75 d8             	mov    -0x28(%ebp),%esi
  802d9c:	8d 4c 30 03          	lea    0x3(%eax,%esi,1),%ecx
  802da0:	c1 e9 0c             	shr    $0xc,%ecx
  802da3:	39 cb                	cmp    %ecx,%ebx
  802da5:	75 1e                	jne    802dc5 <malloc+0x72>
		/*
		 * we're in the middle of a partially
		 * allocated page - can we add this chunk?
		 * the +4 below is for the ref count.
		 */
		ref = (uint32_t*) (ROUNDUP(mptr, PGSIZE) - 4);
  802da7:	81 c2 ff 0f 00 00    	add    $0xfff,%edx
  802dad:	81 e2 00 f0 ff ff    	and    $0xfffff000,%edx
		if ((uintptr_t) mptr / PGSIZE == (uintptr_t) (mptr + n - 1 + 4) / PGSIZE) {
			(*ref)++;
  802db3:	83 42 fc 01          	addl   $0x1,-0x4(%edx)
			v = mptr;
			mptr += n;
  802db7:	8d 14 30             	lea    (%eax,%esi,1),%edx
  802dba:	89 15 10 94 81 00    	mov    %edx,0x819410
			return v;
  802dc0:	e9 5d 01 00 00       	jmp    802f22 <malloc+0x1cf>
		}
		/*
		 * stop working on this page and move on.
		 */
		free(mptr);	/* drop reference to this page */
  802dc5:	89 04 24             	mov    %eax,(%esp)
  802dc8:	e8 b3 fe ff ff       	call   802c80 <free>
		mptr = ROUNDDOWN(mptr + PGSIZE, PGSIZE);
  802dcd:	a1 10 94 81 00       	mov    0x819410,%eax
  802dd2:	05 00 10 00 00       	add    $0x1000,%eax
  802dd7:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  802ddc:	a3 10 94 81 00       	mov    %eax,0x819410
  802de1:	8b 3d 10 94 81 00    	mov    0x819410,%edi
  802de7:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
			return 0;
	return 1;
}

void*
malloc(size_t n)
  802dee:	8b 45 d8             	mov    -0x28(%ebp),%eax
  802df1:	83 c0 04             	add    $0x4,%eax
  802df4:	89 45 dc             	mov    %eax,-0x24(%ebp)
{
	uintptr_t va, end_va = (uintptr_t) v + n;

	for (va = (uintptr_t) v; va < end_va; va += PGSIZE)
		if (va >= (uintptr_t) mend
		    || ((vpd[PDX(va)] & PTE_P) && (vpt[VPN(va)] & PTE_P)))
  802df7:	bb 00 d0 7b ef       	mov    $0xef7bd000,%ebx
  802dfc:	be 00 00 40 ef       	mov    $0xef400000,%esi
			return 0;
	return 1;
}

void*
malloc(size_t n)
  802e01:	8b 45 dc             	mov    -0x24(%ebp),%eax
  802e04:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  802e07:	8d 0c 07             	lea    (%edi,%eax,1),%ecx
  802e0a:	89 7d e4             	mov    %edi,-0x1c(%ebp)
static int
isfree(void *v, size_t n)
{
	uintptr_t va, end_va = (uintptr_t) v + n;

	for (va = (uintptr_t) v; va < end_va; va += PGSIZE)
  802e0d:	39 cf                	cmp    %ecx,%edi
  802e0f:	0f 83 d7 00 00 00    	jae    802eec <malloc+0x199>
		if (va >= (uintptr_t) mend
  802e15:	89 f8                	mov    %edi,%eax
  802e17:	81 ff ff ff ff 0f    	cmp    $0xfffffff,%edi
  802e1d:	76 09                	jbe    802e28 <malloc+0xd5>
  802e1f:	eb 38                	jmp    802e59 <malloc+0x106>
  802e21:	3d ff ff ff 0f       	cmp    $0xfffffff,%eax
  802e26:	77 31                	ja     802e59 <malloc+0x106>
		    || ((vpd[PDX(va)] & PTE_P) && (vpt[VPN(va)] & PTE_P)))
  802e28:	89 c2                	mov    %eax,%edx
  802e2a:	c1 ea 16             	shr    $0x16,%edx
  802e2d:	8b 14 93             	mov    (%ebx,%edx,4),%edx
isfree(void *v, size_t n)
{
	uintptr_t va, end_va = (uintptr_t) v + n;

	for (va = (uintptr_t) v; va < end_va; va += PGSIZE)
		if (va >= (uintptr_t) mend
  802e30:	f6 c2 01             	test   $0x1,%dl
  802e33:	74 0d                	je     802e42 <malloc+0xef>
		    || ((vpd[PDX(va)] & PTE_P) && (vpt[VPN(va)] & PTE_P)))
  802e35:	89 c2                	mov    %eax,%edx
  802e37:	c1 ea 0c             	shr    $0xc,%edx
  802e3a:	8b 14 96             	mov    (%esi,%edx,4),%edx
isfree(void *v, size_t n)
{
	uintptr_t va, end_va = (uintptr_t) v + n;

	for (va = (uintptr_t) v; va < end_va; va += PGSIZE)
		if (va >= (uintptr_t) mend
  802e3d:	f6 c2 01             	test   $0x1,%dl
  802e40:	75 17                	jne    802e59 <malloc+0x106>
static int
isfree(void *v, size_t n)
{
	uintptr_t va, end_va = (uintptr_t) v + n;

	for (va = (uintptr_t) v; va < end_va; va += PGSIZE)
  802e42:	05 00 10 00 00       	add    $0x1000,%eax
  802e47:	39 c8                	cmp    %ecx,%eax
  802e49:	72 d6                	jb     802e21 <malloc+0xce>
  802e4b:	8b 75 e4             	mov    -0x1c(%ebp),%esi
  802e4e:	89 35 10 94 81 00    	mov    %esi,0x819410
  802e54:	e9 9b 00 00 00       	jmp    802ef4 <malloc+0x1a1>
  802e59:	81 c7 00 10 00 00    	add    $0x1000,%edi
  802e5f:	81 c1 00 10 00 00    	add    $0x1000,%ecx
	nwrap = 0;
	while (1) {
		if (isfree(mptr, n + 4))
			break;
		mptr += PGSIZE;
		if (mptr == mend) {
  802e65:	81 ff 00 00 00 10    	cmp    $0x10000000,%edi
  802e6b:	75 9d                	jne    802e0a <malloc+0xb7>
			mptr = mbegin;
			if (++nwrap == 2)
  802e6d:	83 45 e0 01          	addl   $0x1,-0x20(%ebp)
  802e71:	83 7d e0 02          	cmpl   $0x2,-0x20(%ebp)
  802e75:	74 07                	je     802e7e <malloc+0x12b>
  802e77:	bf 00 00 00 08       	mov    $0x8000000,%edi
  802e7c:	eb 83                	jmp    802e01 <malloc+0xae>
  802e7e:	c7 05 10 94 81 00 00 	movl   $0x8000000,0x819410
  802e85:	00 00 08 
  802e88:	b8 00 00 00 00       	mov    $0x0,%eax
  802e8d:	e9 90 00 00 00       	jmp    802f22 <malloc+0x1cf>

	/*
	 * allocate at mptr - the +4 makes sure we allocate a ref count.
	 */
	for (i = 0; i < n + 4; i += PGSIZE){
		cont = (i + PGSIZE < n + 4) ? PTE_CONTINUED : 0;
  802e92:	8d b3 00 10 00 00    	lea    0x1000(%ebx),%esi
  802e98:	39 fe                	cmp    %edi,%esi
  802e9a:	19 c0                	sbb    %eax,%eax
  802e9c:	25 00 04 00 00       	and    $0x400,%eax
		if (sys_page_alloc(0, mptr + i, PTE_P|PTE_U|PTE_W|cont) < 0){
  802ea1:	83 c8 07             	or     $0x7,%eax
  802ea4:	89 44 24 08          	mov    %eax,0x8(%esp)
  802ea8:	03 15 10 94 81 00    	add    0x819410,%edx
  802eae:	89 54 24 04          	mov    %edx,0x4(%esp)
  802eb2:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  802eb9:	e8 c8 e9 ff ff       	call   801886 <sys_page_alloc>
  802ebe:	85 c0                	test   %eax,%eax
  802ec0:	78 04                	js     802ec6 <malloc+0x173>
  802ec2:	89 f3                	mov    %esi,%ebx
  802ec4:	eb 36                	jmp    802efc <malloc+0x1a9>
			for (; i >= 0; i -= PGSIZE)
  802ec6:	85 db                	test   %ebx,%ebx
  802ec8:	78 53                	js     802f1d <malloc+0x1ca>
				sys_page_unmap(0, mptr + i);
  802eca:	89 d8                	mov    %ebx,%eax
  802ecc:	03 05 10 94 81 00    	add    0x819410,%eax
  802ed2:	89 44 24 04          	mov    %eax,0x4(%esp)
  802ed6:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  802edd:	e8 e8 e8 ff ff       	call   8017ca <sys_page_unmap>
	 * allocate at mptr - the +4 makes sure we allocate a ref count.
	 */
	for (i = 0; i < n + 4; i += PGSIZE){
		cont = (i + PGSIZE < n + 4) ? PTE_CONTINUED : 0;
		if (sys_page_alloc(0, mptr + i, PTE_P|PTE_U|PTE_W|cont) < 0){
			for (; i >= 0; i -= PGSIZE)
  802ee2:	81 eb 00 10 00 00    	sub    $0x1000,%ebx
  802ee8:	79 e0                	jns    802eca <malloc+0x177>
  802eea:	eb 31                	jmp    802f1d <malloc+0x1ca>
  802eec:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  802eef:	a3 10 94 81 00       	mov    %eax,0x819410
  802ef4:	bb 00 00 00 00       	mov    $0x0,%ebx
  802ef9:	8b 7d d4             	mov    -0x2c(%ebp),%edi
  802efc:	89 da                	mov    %ebx,%edx
	}

	/*
	 * allocate at mptr - the +4 makes sure we allocate a ref count.
	 */
	for (i = 0; i < n + 4; i += PGSIZE){
  802efe:	39 fb                	cmp    %edi,%ebx
  802f00:	72 90                	jb     802e92 <malloc+0x13f>
				sys_page_unmap(0, mptr + i);
			return 0;	/* out of physical memory */
		}
	}

	ref = (uint32_t*) (mptr + i - 4);
  802f02:	a1 10 94 81 00       	mov    0x819410,%eax
	*ref = 2;	/* reference for mptr, reference for returned block */
  802f07:	c7 44 18 fc 02 00 00 	movl   $0x2,-0x4(%eax,%ebx,1)
  802f0e:	00 
	v = mptr;
	mptr += n;
  802f0f:	8b 55 d8             	mov    -0x28(%ebp),%edx
  802f12:	8d 14 10             	lea    (%eax,%edx,1),%edx
  802f15:	89 15 10 94 81 00    	mov    %edx,0x819410
	return v;
  802f1b:	eb 05                	jmp    802f22 <malloc+0x1cf>
  802f1d:	b8 00 00 00 00       	mov    $0x0,%eax
}
  802f22:	83 c4 3c             	add    $0x3c,%esp
  802f25:	5b                   	pop    %ebx
  802f26:	5e                   	pop    %esi
  802f27:	5f                   	pop    %edi
  802f28:	5d                   	pop    %ebp
  802f29:	c3                   	ret    
  802f2a:	00 00                	add    %al,(%eax)
  802f2c:	00 00                	add    %al,(%eax)
	...

00802f30 <devpipe_stat>:
	return i;
}

static int
devpipe_stat(struct Fd *fd, struct Stat *stat)
{
  802f30:	55                   	push   %ebp
  802f31:	89 e5                	mov    %esp,%ebp
  802f33:	83 ec 18             	sub    $0x18,%esp
  802f36:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  802f39:	89 75 fc             	mov    %esi,-0x4(%ebp)
  802f3c:	8b 75 0c             	mov    0xc(%ebp),%esi
	struct Pipe *p = (struct Pipe*) fd2data(fd);
  802f3f:	8b 45 08             	mov    0x8(%ebp),%eax
  802f42:	89 04 24             	mov    %eax,(%esp)
  802f45:	e8 46 ef ff ff       	call   801e90 <fd2data>
  802f4a:	89 c3                	mov    %eax,%ebx
	strcpy(stat->st_name, "<pipe>");
  802f4c:	c7 44 24 04 db 2d 81 	movl   $0x812ddb,0x4(%esp)
  802f53:	00 
  802f54:	89 34 24             	mov    %esi,(%esp)
  802f57:	e8 ce e1 ff ff       	call   80112a <strcpy>
	stat->st_size = p->p_wpos - p->p_rpos;
  802f5c:	8b 43 04             	mov    0x4(%ebx),%eax
  802f5f:	2b 03                	sub    (%ebx),%eax
  802f61:	89 86 80 00 00 00    	mov    %eax,0x80(%esi)
	stat->st_isdir = 0;
  802f67:	c7 86 84 00 00 00 00 	movl   $0x0,0x84(%esi)
  802f6e:	00 00 00 
	stat->st_dev = &devpipe;
  802f71:	c7 86 88 00 00 00 3c 	movl   $0x81903c,0x88(%esi)
  802f78:	90 81 00 
	return 0;
}
  802f7b:	b8 00 00 00 00       	mov    $0x0,%eax
  802f80:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  802f83:	8b 75 fc             	mov    -0x4(%ebp),%esi
  802f86:	89 ec                	mov    %ebp,%esp
  802f88:	5d                   	pop    %ebp
  802f89:	c3                   	ret    

00802f8a <devpipe_close>:

static int
devpipe_close(struct Fd *fd)
{
  802f8a:	55                   	push   %ebp
  802f8b:	89 e5                	mov    %esp,%ebp
  802f8d:	53                   	push   %ebx
  802f8e:	83 ec 14             	sub    $0x14,%esp
  802f91:	8b 5d 08             	mov    0x8(%ebp),%ebx
	(void) sys_page_unmap(0, fd);
  802f94:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  802f98:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  802f9f:	e8 26 e8 ff ff       	call   8017ca <sys_page_unmap>
	return sys_page_unmap(0, fd2data(fd));
  802fa4:	89 1c 24             	mov    %ebx,(%esp)
  802fa7:	e8 e4 ee ff ff       	call   801e90 <fd2data>
  802fac:	89 44 24 04          	mov    %eax,0x4(%esp)
  802fb0:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  802fb7:	e8 0e e8 ff ff       	call   8017ca <sys_page_unmap>
}
  802fbc:	83 c4 14             	add    $0x14,%esp
  802fbf:	5b                   	pop    %ebx
  802fc0:	5d                   	pop    %ebp
  802fc1:	c3                   	ret    

00802fc2 <_pipeisclosed>:
	return r;
}

static int
_pipeisclosed(struct Fd *fd, struct Pipe *p)
{
  802fc2:	55                   	push   %ebp
  802fc3:	89 e5                	mov    %esp,%ebp
  802fc5:	57                   	push   %edi
  802fc6:	56                   	push   %esi
  802fc7:	53                   	push   %ebx
  802fc8:	83 ec 2c             	sub    $0x2c,%esp
  802fcb:	89 c7                	mov    %eax,%edi
  802fcd:	89 55 e4             	mov    %edx,-0x1c(%ebp)
	int n, nn, ret;

	while (1) {
		n = env->env_runs;
  802fd0:	a1 f4 f5 b3 00       	mov    0xb3f5f4,%eax
  802fd5:	8b 58 58             	mov    0x58(%eax),%ebx
		ret = pageref(fd) == pageref(p);
  802fd8:	89 3c 24             	mov    %edi,(%esp)
  802fdb:	e8 7c 05 00 00       	call   80355c <pageref>
  802fe0:	89 c6                	mov    %eax,%esi
  802fe2:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  802fe5:	89 04 24             	mov    %eax,(%esp)
  802fe8:	e8 6f 05 00 00       	call   80355c <pageref>
  802fed:	39 c6                	cmp    %eax,%esi
  802fef:	0f 94 c0             	sete   %al
  802ff2:	0f b6 c0             	movzbl %al,%eax
		nn = env->env_runs;
  802ff5:	8b 15 f4 f5 b3 00    	mov    0xb3f5f4,%edx
  802ffb:	8b 4a 58             	mov    0x58(%edx),%ecx
		if (n == nn)
  802ffe:	39 cb                	cmp    %ecx,%ebx
  803000:	75 08                	jne    80300a <_pipeisclosed+0x48>
			return ret;
		if (n != nn && ret == 1)
			cprintf("pipe race avoided\n", n, env->env_runs, ret);
	}
}
  803002:	83 c4 2c             	add    $0x2c,%esp
  803005:	5b                   	pop    %ebx
  803006:	5e                   	pop    %esi
  803007:	5f                   	pop    %edi
  803008:	5d                   	pop    %ebp
  803009:	c3                   	ret    
		n = env->env_runs;
		ret = pageref(fd) == pageref(p);
		nn = env->env_runs;
		if (n == nn)
			return ret;
		if (n != nn && ret == 1)
  80300a:	83 f8 01             	cmp    $0x1,%eax
  80300d:	75 c1                	jne    802fd0 <_pipeisclosed+0xe>
			cprintf("pipe race avoided\n", n, env->env_runs, ret);
  80300f:	8b 52 58             	mov    0x58(%edx),%edx
  803012:	89 44 24 0c          	mov    %eax,0xc(%esp)
  803016:	89 54 24 08          	mov    %edx,0x8(%esp)
  80301a:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  80301e:	c7 04 24 e2 2d 81 00 	movl   $0x812de2,(%esp)
  803025:	e8 37 da ff ff       	call   800a61 <cprintf>
  80302a:	eb a4                	jmp    802fd0 <_pipeisclosed+0xe>

0080302c <devpipe_write>:
	return i;
}

static ssize_t
devpipe_write(struct Fd *fd, const void *vbuf, size_t n)
{
  80302c:	55                   	push   %ebp
  80302d:	89 e5                	mov    %esp,%ebp
  80302f:	57                   	push   %edi
  803030:	56                   	push   %esi
  803031:	53                   	push   %ebx
  803032:	83 ec 1c             	sub    $0x1c,%esp
  803035:	8b 75 08             	mov    0x8(%ebp),%esi
	const uint8_t *buf;
	size_t i;
	struct Pipe *p;

	p = (struct Pipe*) fd2data(fd);
  803038:	89 34 24             	mov    %esi,(%esp)
  80303b:	e8 50 ee ff ff       	call   801e90 <fd2data>
  803040:	89 c3                	mov    %eax,%ebx
	if (debug)
		cprintf("[%08x] devpipe_write %08x %d rpos %d wpos %d\n",
			env->env_id, vpt[VPN(p)], n, p->p_rpos, p->p_wpos);

	buf = vbuf;
	for (i = 0; i < n; i++) {
  803042:	bf 00 00 00 00       	mov    $0x0,%edi
  803047:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  80304b:	75 54                	jne    8030a1 <devpipe_write+0x75>
  80304d:	eb 60                	jmp    8030af <devpipe_write+0x83>
		while (p->p_wpos >= p->p_rpos + sizeof(p->p_buf)) {
			// pipe is full
			// if all the readers are gone
			// (it's only writers like us now),
			// note eof
			if (_pipeisclosed(fd, p))
  80304f:	89 da                	mov    %ebx,%edx
  803051:	89 f0                	mov    %esi,%eax
  803053:	e8 6a ff ff ff       	call   802fc2 <_pipeisclosed>
  803058:	85 c0                	test   %eax,%eax
  80305a:	74 07                	je     803063 <devpipe_write+0x37>
  80305c:	b8 00 00 00 00       	mov    $0x0,%eax
  803061:	eb 53                	jmp    8030b6 <devpipe_write+0x8a>
				return 0;
			// yield and see what happens
			if (debug)
				cprintf("devpipe_write yield\n");
			sys_yield();
  803063:	90                   	nop
  803064:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  803068:	e8 78 e8 ff ff       	call   8018e5 <sys_yield>
		cprintf("[%08x] devpipe_write %08x %d rpos %d wpos %d\n",
			env->env_id, vpt[VPN(p)], n, p->p_rpos, p->p_wpos);

	buf = vbuf;
	for (i = 0; i < n; i++) {
		while (p->p_wpos >= p->p_rpos + sizeof(p->p_buf)) {
  80306d:	8b 43 04             	mov    0x4(%ebx),%eax
  803070:	8b 13                	mov    (%ebx),%edx
  803072:	83 c2 20             	add    $0x20,%edx
  803075:	39 d0                	cmp    %edx,%eax
  803077:	73 d6                	jae    80304f <devpipe_write+0x23>
				cprintf("devpipe_write yield\n");
			sys_yield();
		}
		// there's room for a byte.  store it.
		// wait to increment wpos until the byte is stored!
		p->p_buf[p->p_wpos % PIPEBUFSIZ] = buf[i];
  803079:	89 c2                	mov    %eax,%edx
  80307b:	c1 fa 1f             	sar    $0x1f,%edx
  80307e:	c1 ea 1b             	shr    $0x1b,%edx
  803081:	01 d0                	add    %edx,%eax
  803083:	83 e0 1f             	and    $0x1f,%eax
  803086:	29 d0                	sub    %edx,%eax
  803088:	89 c2                	mov    %eax,%edx
  80308a:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  80308d:	0f b6 04 39          	movzbl (%ecx,%edi,1),%eax
  803091:	88 44 13 08          	mov    %al,0x8(%ebx,%edx,1)
		p->p_wpos++;
  803095:	83 43 04 01          	addl   $0x1,0x4(%ebx)
	if (debug)
		cprintf("[%08x] devpipe_write %08x %d rpos %d wpos %d\n",
			env->env_id, vpt[VPN(p)], n, p->p_rpos, p->p_wpos);

	buf = vbuf;
	for (i = 0; i < n; i++) {
  803099:	83 c7 01             	add    $0x1,%edi
  80309c:	39 7d 10             	cmp    %edi,0x10(%ebp)
  80309f:	76 13                	jbe    8030b4 <devpipe_write+0x88>
		while (p->p_wpos >= p->p_rpos + sizeof(p->p_buf)) {
  8030a1:	8b 43 04             	mov    0x4(%ebx),%eax
  8030a4:	8b 13                	mov    (%ebx),%edx
  8030a6:	83 c2 20             	add    $0x20,%edx
  8030a9:	39 d0                	cmp    %edx,%eax
  8030ab:	73 a2                	jae    80304f <devpipe_write+0x23>
  8030ad:	eb ca                	jmp    803079 <devpipe_write+0x4d>
  8030af:	bf 00 00 00 00       	mov    $0x0,%edi
		// wait to increment wpos until the byte is stored!
		p->p_buf[p->p_wpos % PIPEBUFSIZ] = buf[i];
		p->p_wpos++;
	}
	
	return i;
  8030b4:	89 f8                	mov    %edi,%eax
}
  8030b6:	83 c4 1c             	add    $0x1c,%esp
  8030b9:	5b                   	pop    %ebx
  8030ba:	5e                   	pop    %esi
  8030bb:	5f                   	pop    %edi
  8030bc:	5d                   	pop    %ebp
  8030bd:	c3                   	ret    

008030be <devpipe_read>:
	return _pipeisclosed(fd, p);
}

static ssize_t
devpipe_read(struct Fd *fd, void *vbuf, size_t n)
{
  8030be:	55                   	push   %ebp
  8030bf:	89 e5                	mov    %esp,%ebp
  8030c1:	83 ec 28             	sub    $0x28,%esp
  8030c4:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  8030c7:	89 75 f8             	mov    %esi,-0x8(%ebp)
  8030ca:	89 7d fc             	mov    %edi,-0x4(%ebp)
  8030cd:	8b 7d 08             	mov    0x8(%ebp),%edi
	uint8_t *buf;
	size_t i;
	struct Pipe *p;

	p = (struct Pipe*)fd2data(fd);
  8030d0:	89 3c 24             	mov    %edi,(%esp)
  8030d3:	e8 b8 ed ff ff       	call   801e90 <fd2data>
  8030d8:	89 c3                	mov    %eax,%ebx
	if (debug)
		cprintf("[%08x] devpipe_read %08x %d rpos %d wpos %d\n",
			env->env_id, vpt[VPN(p)], n, p->p_rpos, p->p_wpos);

	buf = vbuf;
	for (i = 0; i < n; i++) {
  8030da:	be 00 00 00 00       	mov    $0x0,%esi
  8030df:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  8030e3:	75 4c                	jne    803131 <devpipe_read+0x73>
  8030e5:	eb 5b                	jmp    803142 <devpipe_read+0x84>
		while (p->p_rpos == p->p_wpos) {
			// pipe is empty
			// if we got any data, return it
			if (i > 0)
				return i;
  8030e7:	89 f0                	mov    %esi,%eax
  8030e9:	eb 5e                	jmp    803149 <devpipe_read+0x8b>
			// if all the writers are gone, note eof
			if (_pipeisclosed(fd, p))
  8030eb:	89 da                	mov    %ebx,%edx
  8030ed:	89 f8                	mov    %edi,%eax
  8030ef:	90                   	nop
  8030f0:	e8 cd fe ff ff       	call   802fc2 <_pipeisclosed>
  8030f5:	85 c0                	test   %eax,%eax
  8030f7:	74 07                	je     803100 <devpipe_read+0x42>
  8030f9:	b8 00 00 00 00       	mov    $0x0,%eax
  8030fe:	eb 49                	jmp    803149 <devpipe_read+0x8b>
				return 0;
			// yield and see what happens
			if (debug)
				cprintf("devpipe_read yield\n");
			sys_yield();
  803100:	e8 e0 e7 ff ff       	call   8018e5 <sys_yield>
		cprintf("[%08x] devpipe_read %08x %d rpos %d wpos %d\n",
			env->env_id, vpt[VPN(p)], n, p->p_rpos, p->p_wpos);

	buf = vbuf;
	for (i = 0; i < n; i++) {
		while (p->p_rpos == p->p_wpos) {
  803105:	8b 03                	mov    (%ebx),%eax
  803107:	3b 43 04             	cmp    0x4(%ebx),%eax
  80310a:	74 df                	je     8030eb <devpipe_read+0x2d>
				cprintf("devpipe_read yield\n");
			sys_yield();
		}
		// there's a byte.  take it.
		// wait to increment rpos until the byte is taken!
		buf[i] = p->p_buf[p->p_rpos % PIPEBUFSIZ];
  80310c:	89 c2                	mov    %eax,%edx
  80310e:	c1 fa 1f             	sar    $0x1f,%edx
  803111:	c1 ea 1b             	shr    $0x1b,%edx
  803114:	01 d0                	add    %edx,%eax
  803116:	83 e0 1f             	and    $0x1f,%eax
  803119:	29 d0                	sub    %edx,%eax
  80311b:	0f b6 44 03 08       	movzbl 0x8(%ebx,%eax,1),%eax
  803120:	8b 55 0c             	mov    0xc(%ebp),%edx
  803123:	88 04 32             	mov    %al,(%edx,%esi,1)
		p->p_rpos++;
  803126:	83 03 01             	addl   $0x1,(%ebx)
	if (debug)
		cprintf("[%08x] devpipe_read %08x %d rpos %d wpos %d\n",
			env->env_id, vpt[VPN(p)], n, p->p_rpos, p->p_wpos);

	buf = vbuf;
	for (i = 0; i < n; i++) {
  803129:	83 c6 01             	add    $0x1,%esi
  80312c:	39 75 10             	cmp    %esi,0x10(%ebp)
  80312f:	76 16                	jbe    803147 <devpipe_read+0x89>
		while (p->p_rpos == p->p_wpos) {
  803131:	8b 03                	mov    (%ebx),%eax
  803133:	3b 43 04             	cmp    0x4(%ebx),%eax
  803136:	75 d4                	jne    80310c <devpipe_read+0x4e>
			// pipe is empty
			// if we got any data, return it
			if (i > 0)
  803138:	85 f6                	test   %esi,%esi
  80313a:	75 ab                	jne    8030e7 <devpipe_read+0x29>
  80313c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  803140:	eb a9                	jmp    8030eb <devpipe_read+0x2d>
  803142:	be 00 00 00 00       	mov    $0x0,%esi
		// there's a byte.  take it.
		// wait to increment rpos until the byte is taken!
		buf[i] = p->p_buf[p->p_rpos % PIPEBUFSIZ];
		p->p_rpos++;
	}
	return i;
  803147:	89 f0                	mov    %esi,%eax
}
  803149:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  80314c:	8b 75 f8             	mov    -0x8(%ebp),%esi
  80314f:	8b 7d fc             	mov    -0x4(%ebp),%edi
  803152:	89 ec                	mov    %ebp,%esp
  803154:	5d                   	pop    %ebp
  803155:	c3                   	ret    

00803156 <pipeisclosed>:
	}
}

int
pipeisclosed(int fdnum)
{
  803156:	55                   	push   %ebp
  803157:	89 e5                	mov    %esp,%ebp
  803159:	83 ec 28             	sub    $0x28,%esp
	struct Fd *fd;
	struct Pipe *p;
	int r;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  80315c:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80315f:	89 44 24 04          	mov    %eax,0x4(%esp)
  803163:	8b 45 08             	mov    0x8(%ebp),%eax
  803166:	89 04 24             	mov    %eax,(%esp)
  803169:	e8 af ed ff ff       	call   801f1d <fd_lookup>
  80316e:	85 c0                	test   %eax,%eax
  803170:	78 15                	js     803187 <pipeisclosed+0x31>
		return r;
	p = (struct Pipe*) fd2data(fd);
  803172:	8b 45 f4             	mov    -0xc(%ebp),%eax
  803175:	89 04 24             	mov    %eax,(%esp)
  803178:	e8 13 ed ff ff       	call   801e90 <fd2data>
	return _pipeisclosed(fd, p);
  80317d:	89 c2                	mov    %eax,%edx
  80317f:	8b 45 f4             	mov    -0xc(%ebp),%eax
  803182:	e8 3b fe ff ff       	call   802fc2 <_pipeisclosed>
}
  803187:	c9                   	leave  
  803188:	c3                   	ret    

00803189 <pipe>:
	uint8_t p_buf[PIPEBUFSIZ];	// data buffer
};

int
pipe(int pfd[2])
{
  803189:	55                   	push   %ebp
  80318a:	89 e5                	mov    %esp,%ebp
  80318c:	83 ec 48             	sub    $0x48,%esp
  80318f:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  803192:	89 75 f8             	mov    %esi,-0x8(%ebp)
  803195:	89 7d fc             	mov    %edi,-0x4(%ebp)
  803198:	8b 7d 08             	mov    0x8(%ebp),%edi
	int r;
	struct Fd *fd0, *fd1;
	void *va;

	// allocate the file descriptor table entries
	if ((r = fd_alloc(&fd0)) < 0
  80319b:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80319e:	89 04 24             	mov    %eax,(%esp)
  8031a1:	e8 05 ed ff ff       	call   801eab <fd_alloc>
  8031a6:	89 c3                	mov    %eax,%ebx
  8031a8:	85 c0                	test   %eax,%eax
  8031aa:	0f 88 42 01 00 00    	js     8032f2 <pipe+0x169>
	    || (r = sys_page_alloc(0, fd0, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  8031b0:	c7 44 24 08 07 04 00 	movl   $0x407,0x8(%esp)
  8031b7:	00 
  8031b8:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  8031bb:	89 44 24 04          	mov    %eax,0x4(%esp)
  8031bf:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  8031c6:	e8 bb e6 ff ff       	call   801886 <sys_page_alloc>
  8031cb:	89 c3                	mov    %eax,%ebx
	int r;
	struct Fd *fd0, *fd1;
	void *va;

	// allocate the file descriptor table entries
	if ((r = fd_alloc(&fd0)) < 0
  8031cd:	85 c0                	test   %eax,%eax
  8031cf:	0f 88 1d 01 00 00    	js     8032f2 <pipe+0x169>
	    || (r = sys_page_alloc(0, fd0, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
		goto err;

	if ((r = fd_alloc(&fd1)) < 0
  8031d5:	8d 45 e0             	lea    -0x20(%ebp),%eax
  8031d8:	89 04 24             	mov    %eax,(%esp)
  8031db:	e8 cb ec ff ff       	call   801eab <fd_alloc>
  8031e0:	89 c3                	mov    %eax,%ebx
  8031e2:	85 c0                	test   %eax,%eax
  8031e4:	0f 88 f5 00 00 00    	js     8032df <pipe+0x156>
	    || (r = sys_page_alloc(0, fd1, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  8031ea:	c7 44 24 08 07 04 00 	movl   $0x407,0x8(%esp)
  8031f1:	00 
  8031f2:	8b 45 e0             	mov    -0x20(%ebp),%eax
  8031f5:	89 44 24 04          	mov    %eax,0x4(%esp)
  8031f9:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  803200:	e8 81 e6 ff ff       	call   801886 <sys_page_alloc>
  803205:	89 c3                	mov    %eax,%ebx
	// allocate the file descriptor table entries
	if ((r = fd_alloc(&fd0)) < 0
	    || (r = sys_page_alloc(0, fd0, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
		goto err;

	if ((r = fd_alloc(&fd1)) < 0
  803207:	85 c0                	test   %eax,%eax
  803209:	0f 88 d0 00 00 00    	js     8032df <pipe+0x156>
	    || (r = sys_page_alloc(0, fd1, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
		goto err1;

	// allocate the pipe structure as first data page in both
	va = fd2data(fd0);
  80320f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  803212:	89 04 24             	mov    %eax,(%esp)
  803215:	e8 76 ec ff ff       	call   801e90 <fd2data>
  80321a:	89 c6                	mov    %eax,%esi
	if ((r = sys_page_alloc(0, va, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  80321c:	c7 44 24 08 07 04 00 	movl   $0x407,0x8(%esp)
  803223:	00 
  803224:	89 44 24 04          	mov    %eax,0x4(%esp)
  803228:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80322f:	e8 52 e6 ff ff       	call   801886 <sys_page_alloc>
  803234:	89 c3                	mov    %eax,%ebx
  803236:	85 c0                	test   %eax,%eax
  803238:	0f 88 8e 00 00 00    	js     8032cc <pipe+0x143>
		goto err2;
	if ((r = sys_page_map(0, va, 0, fd2data(fd1), PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  80323e:	8b 45 e0             	mov    -0x20(%ebp),%eax
  803241:	89 04 24             	mov    %eax,(%esp)
  803244:	e8 47 ec ff ff       	call   801e90 <fd2data>
  803249:	c7 44 24 10 07 04 00 	movl   $0x407,0x10(%esp)
  803250:	00 
  803251:	89 44 24 0c          	mov    %eax,0xc(%esp)
  803255:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80325c:	00 
  80325d:	89 74 24 04          	mov    %esi,0x4(%esp)
  803261:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  803268:	e8 bb e5 ff ff       	call   801828 <sys_page_map>
  80326d:	89 c3                	mov    %eax,%ebx
  80326f:	85 c0                	test   %eax,%eax
  803271:	78 49                	js     8032bc <pipe+0x133>
		goto err3;

	// set up fd structures
	fd0->fd_dev_id = devpipe.dev_id;
  803273:	b8 3c 90 81 00       	mov    $0x81903c,%eax
  803278:	8b 08                	mov    (%eax),%ecx
  80327a:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80327d:	89 0a                	mov    %ecx,(%edx)
	fd0->fd_omode = O_RDONLY;
  80327f:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  803282:	c7 42 08 00 00 00 00 	movl   $0x0,0x8(%edx)

	fd1->fd_dev_id = devpipe.dev_id;
  803289:	8b 10                	mov    (%eax),%edx
  80328b:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80328e:	89 10                	mov    %edx,(%eax)
	fd1->fd_omode = O_WRONLY;
  803290:	8b 45 e0             	mov    -0x20(%ebp),%eax
  803293:	c7 40 08 01 00 00 00 	movl   $0x1,0x8(%eax)

	if (debug)
		cprintf("[%08x] pipecreate %08x\n", env->env_id, vpt[VPN(va)]);

	pfd[0] = fd2num(fd0);
  80329a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80329d:	89 04 24             	mov    %eax,(%esp)
  8032a0:	e8 db eb ff ff       	call   801e80 <fd2num>
  8032a5:	89 07                	mov    %eax,(%edi)
	pfd[1] = fd2num(fd1);
  8032a7:	8b 45 e0             	mov    -0x20(%ebp),%eax
  8032aa:	89 04 24             	mov    %eax,(%esp)
  8032ad:	e8 ce eb ff ff       	call   801e80 <fd2num>
  8032b2:	89 47 04             	mov    %eax,0x4(%edi)
  8032b5:	bb 00 00 00 00       	mov    $0x0,%ebx
	return 0;
  8032ba:	eb 36                	jmp    8032f2 <pipe+0x169>

    err3:
	sys_page_unmap(0, va);
  8032bc:	89 74 24 04          	mov    %esi,0x4(%esp)
  8032c0:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  8032c7:	e8 fe e4 ff ff       	call   8017ca <sys_page_unmap>
    err2:
	sys_page_unmap(0, fd1);
  8032cc:	8b 45 e0             	mov    -0x20(%ebp),%eax
  8032cf:	89 44 24 04          	mov    %eax,0x4(%esp)
  8032d3:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  8032da:	e8 eb e4 ff ff       	call   8017ca <sys_page_unmap>
    err1:
	sys_page_unmap(0, fd0);
  8032df:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  8032e2:	89 44 24 04          	mov    %eax,0x4(%esp)
  8032e6:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  8032ed:	e8 d8 e4 ff ff       	call   8017ca <sys_page_unmap>
    err:
	return r;
}
  8032f2:	89 d8                	mov    %ebx,%eax
  8032f4:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  8032f7:	8b 75 f8             	mov    -0x8(%ebp),%esi
  8032fa:	8b 7d fc             	mov    -0x4(%ebp),%edi
  8032fd:	89 ec                	mov    %ebp,%esp
  8032ff:	5d                   	pop    %ebp
  803300:	c3                   	ret    
	...

00803310 <devcons_close>:
	return tot;
}

static int
devcons_close(struct Fd *fd)
{
  803310:	55                   	push   %ebp
  803311:	89 e5                	mov    %esp,%ebp
	USED(fd);

	return 0;
}
  803313:	b8 00 00 00 00       	mov    $0x0,%eax
  803318:	5d                   	pop    %ebp
  803319:	c3                   	ret    

0080331a <devcons_stat>:

static int
devcons_stat(struct Fd *fd, struct Stat *stat)
{
  80331a:	55                   	push   %ebp
  80331b:	89 e5                	mov    %esp,%ebp
  80331d:	83 ec 18             	sub    $0x18,%esp
	strcpy(stat->st_name, "<cons>");
  803320:	c7 44 24 04 fa 2d 81 	movl   $0x812dfa,0x4(%esp)
  803327:	00 
  803328:	8b 45 0c             	mov    0xc(%ebp),%eax
  80332b:	89 04 24             	mov    %eax,(%esp)
  80332e:	e8 f7 dd ff ff       	call   80112a <strcpy>
	return 0;
}
  803333:	b8 00 00 00 00       	mov    $0x0,%eax
  803338:	c9                   	leave  
  803339:	c3                   	ret    

0080333a <devcons_write>:
	return 1;
}

static ssize_t
devcons_write(struct Fd *fd, const void *vbuf, size_t n)
{
  80333a:	55                   	push   %ebp
  80333b:	89 e5                	mov    %esp,%ebp
  80333d:	57                   	push   %edi
  80333e:	56                   	push   %esi
  80333f:	53                   	push   %ebx
  803340:	81 ec 9c 00 00 00    	sub    $0x9c,%esp
	int tot, m;
	char buf[128];

	// mistake: have to nul-terminate arg to sys_cputs, 
	// so we have to copy vbuf into buf in chunks and nul-terminate.
	for (tot = 0; tot < n; tot += m) {
  803346:	b8 00 00 00 00       	mov    $0x0,%eax
  80334b:	be 00 00 00 00       	mov    $0x0,%esi
  803350:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  803354:	74 41                	je     803397 <devcons_write+0x5d>
		m = n - tot;
		if (m > sizeof(buf) - 1)
			m = sizeof(buf) - 1;
		memmove(buf, (char*)vbuf + tot, m);
  803356:	8d bd 68 ff ff ff    	lea    -0x98(%ebp),%edi
	char buf[128];

	// mistake: have to nul-terminate arg to sys_cputs, 
	// so we have to copy vbuf into buf in chunks and nul-terminate.
	for (tot = 0; tot < n; tot += m) {
		m = n - tot;
  80335c:	8b 5d 10             	mov    0x10(%ebp),%ebx
  80335f:	29 c3                	sub    %eax,%ebx
		if (m > sizeof(buf) - 1)
  803361:	81 fb 80 00 00 00    	cmp    $0x80,%ebx
  803367:	ba 7f 00 00 00       	mov    $0x7f,%edx
  80336c:	0f 43 da             	cmovae %edx,%ebx
			m = sizeof(buf) - 1;
		memmove(buf, (char*)vbuf + tot, m);
  80336f:	89 5c 24 08          	mov    %ebx,0x8(%esp)
  803373:	03 45 0c             	add    0xc(%ebp),%eax
  803376:	89 44 24 04          	mov    %eax,0x4(%esp)
  80337a:	89 3c 24             	mov    %edi,(%esp)
  80337d:	e8 63 df ff ff       	call   8012e5 <memmove>
		sys_cputs(buf, m);
  803382:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  803386:	89 3c 24             	mov    %edi,(%esp)
  803389:	e8 92 e1 ff ff       	call   801520 <sys_cputs>
	int tot, m;
	char buf[128];

	// mistake: have to nul-terminate arg to sys_cputs, 
	// so we have to copy vbuf into buf in chunks and nul-terminate.
	for (tot = 0; tot < n; tot += m) {
  80338e:	01 de                	add    %ebx,%esi
  803390:	89 f0                	mov    %esi,%eax
  803392:	3b 75 10             	cmp    0x10(%ebp),%esi
  803395:	72 c5                	jb     80335c <devcons_write+0x22>
			m = sizeof(buf) - 1;
		memmove(buf, (char*)vbuf + tot, m);
		sys_cputs(buf, m);
	}
	return tot;
}
  803397:	89 f0                	mov    %esi,%eax
  803399:	81 c4 9c 00 00 00    	add    $0x9c,%esp
  80339f:	5b                   	pop    %ebx
  8033a0:	5e                   	pop    %esi
  8033a1:	5f                   	pop    %edi
  8033a2:	5d                   	pop    %ebp
  8033a3:	c3                   	ret    

008033a4 <cputchar>:
#include <inc/string.h>
#include <inc/lib.h>

void
cputchar(int ch)
{
  8033a4:	55                   	push   %ebp
  8033a5:	89 e5                	mov    %esp,%ebp
  8033a7:	83 ec 28             	sub    $0x28,%esp
	char c = ch;
  8033aa:	8b 45 08             	mov    0x8(%ebp),%eax
  8033ad:	88 45 f7             	mov    %al,-0x9(%ebp)

	// Unlike standard Unix's putchar,
	// the cputchar function _always_ outputs to the system console.
	sys_cputs(&c, 1);
  8033b0:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  8033b7:	00 
  8033b8:	8d 45 f7             	lea    -0x9(%ebp),%eax
  8033bb:	89 04 24             	mov    %eax,(%esp)
  8033be:	e8 5d e1 ff ff       	call   801520 <sys_cputs>
}
  8033c3:	c9                   	leave  
  8033c4:	c3                   	ret    

008033c5 <devcons_read>:
	return fd2num(fd);
}

static ssize_t
devcons_read(struct Fd *fd, void *vbuf, size_t n)
{
  8033c5:	55                   	push   %ebp
  8033c6:	89 e5                	mov    %esp,%ebp
  8033c8:	83 ec 08             	sub    $0x8,%esp
	int c;

	if (n == 0)
  8033cb:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  8033cf:	75 07                	jne    8033d8 <devcons_read+0x13>
  8033d1:	eb 2d                	jmp    803400 <devcons_read+0x3b>
		return 0;
	while ((c = sys_cgetc()) == 0)
		sys_yield();
  8033d3:	e8 0d e5 ff ff       	call   8018e5 <sys_yield>
{
	int c;

	if (n == 0)
		return 0;
	while ((c = sys_cgetc()) == 0)
  8033d8:	90                   	nop
  8033d9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  8033e0:	e8 07 e1 ff ff       	call   8014ec <sys_cgetc>
  8033e5:	85 c0                	test   %eax,%eax
  8033e7:	74 ea                	je     8033d3 <devcons_read+0xe>
  8033e9:	89 c2                	mov    %eax,%edx
		sys_yield();
	if (c < 0)
  8033eb:	85 c0                	test   %eax,%eax
  8033ed:	78 16                	js     803405 <devcons_read+0x40>
		return c;
	if (c == 0x04)	// ctl-d is eof
  8033ef:	83 f8 04             	cmp    $0x4,%eax
  8033f2:	74 0c                	je     803400 <devcons_read+0x3b>
		return 0;
	*(char*)vbuf = c;
  8033f4:	8b 45 0c             	mov    0xc(%ebp),%eax
  8033f7:	88 10                	mov    %dl,(%eax)
  8033f9:	b8 01 00 00 00       	mov    $0x1,%eax
	return 1;
  8033fe:	eb 05                	jmp    803405 <devcons_read+0x40>
  803400:	b8 00 00 00 00       	mov    $0x0,%eax
}
  803405:	c9                   	leave  
  803406:	c3                   	ret    

00803407 <opencons>:
	return fd->fd_dev_id == devcons.dev_id;
}

int
opencons(void)
{
  803407:	55                   	push   %ebp
  803408:	89 e5                	mov    %esp,%ebp
  80340a:	83 ec 28             	sub    $0x28,%esp
	int r;
	struct Fd* fd;

	if ((r = fd_alloc(&fd)) < 0)
  80340d:	8d 45 f4             	lea    -0xc(%ebp),%eax
  803410:	89 04 24             	mov    %eax,(%esp)
  803413:	e8 93 ea ff ff       	call   801eab <fd_alloc>
  803418:	85 c0                	test   %eax,%eax
  80341a:	78 3f                	js     80345b <opencons+0x54>
		return r;
	if ((r = sys_page_alloc(0, fd, PTE_P|PTE_U|PTE_W|PTE_SHARE)) < 0)
  80341c:	c7 44 24 08 07 04 00 	movl   $0x407,0x8(%esp)
  803423:	00 
  803424:	8b 45 f4             	mov    -0xc(%ebp),%eax
  803427:	89 44 24 04          	mov    %eax,0x4(%esp)
  80342b:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  803432:	e8 4f e4 ff ff       	call   801886 <sys_page_alloc>
  803437:	85 c0                	test   %eax,%eax
  803439:	78 20                	js     80345b <opencons+0x54>
		return r;
	fd->fd_dev_id = devcons.dev_id;
  80343b:	8b 15 58 90 81 00    	mov    0x819058,%edx
  803441:	8b 45 f4             	mov    -0xc(%ebp),%eax
  803444:	89 10                	mov    %edx,(%eax)
	fd->fd_omode = O_RDWR;
  803446:	8b 45 f4             	mov    -0xc(%ebp),%eax
  803449:	c7 40 08 02 00 00 00 	movl   $0x2,0x8(%eax)
	return fd2num(fd);
  803450:	8b 45 f4             	mov    -0xc(%ebp),%eax
  803453:	89 04 24             	mov    %eax,(%esp)
  803456:	e8 25 ea ff ff       	call   801e80 <fd2num>
}
  80345b:	c9                   	leave  
  80345c:	c3                   	ret    

0080345d <iscons>:
	.dev_stat =	devcons_stat
};

int
iscons(int fdnum)
{
  80345d:	55                   	push   %ebp
  80345e:	89 e5                	mov    %esp,%ebp
  803460:	83 ec 28             	sub    $0x28,%esp
	int r;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  803463:	8d 45 f4             	lea    -0xc(%ebp),%eax
  803466:	89 44 24 04          	mov    %eax,0x4(%esp)
  80346a:	8b 45 08             	mov    0x8(%ebp),%eax
  80346d:	89 04 24             	mov    %eax,(%esp)
  803470:	e8 a8 ea ff ff       	call   801f1d <fd_lookup>
  803475:	85 c0                	test   %eax,%eax
  803477:	78 11                	js     80348a <iscons+0x2d>
		return r;
	return fd->fd_dev_id == devcons.dev_id;
  803479:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80347c:	8b 00                	mov    (%eax),%eax
  80347e:	3b 05 58 90 81 00    	cmp    0x819058,%eax
  803484:	0f 94 c0             	sete   %al
  803487:	0f b6 c0             	movzbl %al,%eax
}
  80348a:	c9                   	leave  
  80348b:	c3                   	ret    

0080348c <getchar>:
	sys_cputs(&c, 1);
}

int
getchar(void)
{
  80348c:	55                   	push   %ebp
  80348d:	89 e5                	mov    %esp,%ebp
  80348f:	83 ec 28             	sub    $0x28,%esp
	int r;

	// JOS does, however, support standard _input_ redirection,
	// allowing the user to redirect script files to the shell and such.
	// getchar() reads a character from file descriptor 0.
	r = read(0, &c, 1);
  803492:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
  803499:	00 
  80349a:	8d 45 f7             	lea    -0x9(%ebp),%eax
  80349d:	89 44 24 04          	mov    %eax,0x4(%esp)
  8034a1:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  8034a8:	e8 d6 ec ff ff       	call   802183 <read>
	if (r < 0)
  8034ad:	85 c0                	test   %eax,%eax
  8034af:	78 0f                	js     8034c0 <getchar+0x34>
		return r;
	if (r < 1)
  8034b1:	85 c0                	test   %eax,%eax
  8034b3:	7f 07                	jg     8034bc <getchar+0x30>
  8034b5:	b8 f8 ff ff ff       	mov    $0xfffffff8,%eax
  8034ba:	eb 04                	jmp    8034c0 <getchar+0x34>
		return -E_EOF;
	return c;
  8034bc:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
}
  8034c0:	c9                   	leave  
  8034c1:	c3                   	ret    
	...

008034c4 <set_pgfault_handler>:
// at UXSTACKTOP), and tell the kernel to call the assembly-language
// _pgfault_upcall routine when a page fault occurs.
//
void
set_pgfault_handler(void (*handler)(struct UTrapframe *utf))
{
  8034c4:	55                   	push   %ebp
  8034c5:	89 e5                	mov    %esp,%ebp
  8034c7:	83 ec 18             	sub    $0x18,%esp
	int r;

	if (_pgfault_handler == NULL) {
  8034ca:	83 3d fc f5 b3 00 00 	cmpl   $0x0,0xb3f5fc
  8034d1:	75 55                	jne    803528 <set_pgfault_handler+0x64>
		// First time through!
		// LAB 4: Your code here.
        if (sys_page_alloc(sys_getenvid(), (void *)(UXSTACKTOP-PGSIZE), PTE_P|PTE_U|PTE_W))
  8034d3:	e8 41 e4 ff ff       	call   801919 <sys_getenvid>
  8034d8:	c7 44 24 08 07 00 00 	movl   $0x7,0x8(%esp)
  8034df:	00 
  8034e0:	c7 44 24 04 00 f0 bf 	movl   $0xeebff000,0x4(%esp)
  8034e7:	ee 
  8034e8:	89 04 24             	mov    %eax,(%esp)
  8034eb:	e8 96 e3 ff ff       	call   801886 <sys_page_alloc>
  8034f0:	85 c0                	test   %eax,%eax
  8034f2:	74 1c                	je     803510 <set_pgfault_handler+0x4c>
		    panic("set_pgfault_handler not implemented");
  8034f4:	c7 44 24 08 08 2e 81 	movl   $0x812e08,0x8(%esp)
  8034fb:	00 
  8034fc:	c7 44 24 04 21 00 00 	movl   $0x21,0x4(%esp)
  803503:	00 
  803504:	c7 04 24 2c 2e 81 00 	movl   $0x812e2c,(%esp)
  80350b:	e8 8c d4 ff ff       	call   80099c <_panic>
        sys_env_set_pgfault_upcall(env->env_id, _pgfault_upcall);
  803510:	a1 f4 f5 b3 00       	mov    0xb3f5f4,%eax
  803515:	8b 40 4c             	mov    0x4c(%eax),%eax
  803518:	c7 44 24 04 34 35 80 	movl   $0x803534,0x4(%esp)
  80351f:	00 
  803520:	89 04 24             	mov    %eax,(%esp)
  803523:	e8 88 e1 ff ff       	call   8016b0 <sys_env_set_pgfault_upcall>
	}

	// Save handler pointer for assembly to call.
	_pgfault_handler = handler;
  803528:	8b 45 08             	mov    0x8(%ebp),%eax
  80352b:	a3 fc f5 b3 00       	mov    %eax,0xb3f5fc
}
  803530:	c9                   	leave  
  803531:	c3                   	ret    
	...

00803534 <_pgfault_upcall>:

.text
.globl _pgfault_upcall
_pgfault_upcall:
	// Call the C page fault handler.
	pushl %esp			// function argument: pointer to UTF
  803534:	54                   	push   %esp
	movl _pgfault_handler, %eax
  803535:	a1 fc f5 b3 00       	mov    0xb3f5fc,%eax
	call *%eax
  80353a:	ff d0                	call   *%eax
	addl $4, %esp			// pop function argument
  80353c:	83 c4 04             	add    $0x4,%esp
	// may find that you have to rearrange your code in non-obvious
	// ways as registers become unavailable as scratch space.
	//
	// LAB 4: Your code here.

    subl $4, 48(%esp)
  80353f:	83 6c 24 30 04       	subl   $0x4,0x30(%esp)
    movl 48(%esp), %eax
  803544:	8b 44 24 30          	mov    0x30(%esp),%eax
    movl 40(%esp), %ebx
  803548:	8b 5c 24 28          	mov    0x28(%esp),%ebx
    movl %ebx, (%eax)
  80354c:	89 18                	mov    %ebx,(%eax)
    
	// Restore the trap-time registers.  After you do this, you
	// can no longer modify any general-purpose registers.
	// LAB 4: Your code here.
    addl $8, %esp
  80354e:	83 c4 08             	add    $0x8,%esp
    popal
  803551:	61                   	popa   
   
	// Restore eflags from the stack.  After you do this, you can
	// no longer use arithmetic operations or anything else that
	// modifies eflags.
	// LAB 4: Your code here.
    pushl 4(%esp)
  803552:	ff 74 24 04          	pushl  0x4(%esp)
    popf
  803556:	9d                   	popf   

	// Switch back to the adjusted trap-time stack.
	// LAB 4: Your code here.
    movl 8(%esp), %esp
  803557:	8b 64 24 08          	mov    0x8(%esp),%esp

	// Return to re-execute the instruction that faulted.
	// LAB 4: Your code here.
    ret
  80355b:	c3                   	ret    

0080355c <pageref>:
#include <inc/lib.h>

int
pageref(void *v)
{
  80355c:	55                   	push   %ebp
  80355d:	89 e5                	mov    %esp,%ebp
	pte_t pte;

	if (!(vpd[PDX(v)] & PTE_P))
  80355f:	8b 45 08             	mov    0x8(%ebp),%eax
  803562:	89 c2                	mov    %eax,%edx
  803564:	c1 ea 16             	shr    $0x16,%edx
  803567:	8b 14 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%edx
  80356e:	f6 c2 01             	test   $0x1,%dl
  803571:	74 26                	je     803599 <pageref+0x3d>
		return 0;
	pte = vpt[VPN(v)];
  803573:	c1 e8 0c             	shr    $0xc,%eax
  803576:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
	if (!(pte & PTE_P))
  80357d:	a8 01                	test   $0x1,%al
  80357f:	74 18                	je     803599 <pageref+0x3d>
		return 0;
	return pages[PPN(pte)].pp_ref;
  803581:	c1 e8 0c             	shr    $0xc,%eax
  803584:	8d 14 40             	lea    (%eax,%eax,2),%edx
  803587:	c1 e2 02             	shl    $0x2,%edx
  80358a:	b8 00 00 00 ef       	mov    $0xef000000,%eax
  80358f:	0f b7 44 02 08       	movzwl 0x8(%edx,%eax,1),%eax
  803594:	0f b7 c0             	movzwl %ax,%eax
  803597:	eb 05                	jmp    80359e <pageref+0x42>
  803599:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80359e:	5d                   	pop    %ebp
  80359f:	c3                   	ret    

008035a0 <get_socket>:
 * @param s externally used socket index
 * @return struct lwip_socket for the socket or NULL if not found
 */
static struct lwip_socket *
get_socket(int s)
{
  8035a0:	55                   	push   %ebp
  8035a1:	89 e5                	mov    %esp,%ebp
  struct lwip_socket *sock;

  if ((s < 0) || (s >= NUM_SOCKETS)) {
  8035a3:	83 f8 1f             	cmp    $0x1f,%eax
  8035a6:	76 11                	jbe    8035b9 <get_socket+0x19>
    LWIP_DEBUGF(SOCKETS_DEBUG, ("get_socket(%d): invalid\n", s));
    set_errno(EBADF);
  8035a8:	c7 05 a0 f5 b3 00 09 	movl   $0x9,0xb3f5a0
  8035af:	00 00 00 
  8035b2:	b8 00 00 00 00       	mov    $0x0,%eax
    return NULL;
  8035b7:	eb 1e                	jmp    8035d7 <get_socket+0x37>
  }

  sock = &sockets[s];
  8035b9:	8d 04 80             	lea    (%eax,%eax,4),%eax
  8035bc:	8d 04 85 20 94 81 00 	lea    0x819420(,%eax,4),%eax

  if (!sock->conn) {
  8035c3:	83 38 00             	cmpl   $0x0,(%eax)
  8035c6:	75 0f                	jne    8035d7 <get_socket+0x37>
    LWIP_DEBUGF(SOCKETS_DEBUG, ("get_socket(%d): not active\n", s));
    set_errno(EBADF);
  8035c8:	c7 05 a0 f5 b3 00 09 	movl   $0x9,0xb3f5a0
  8035cf:	00 00 00 
  8035d2:	b8 00 00 00 00       	mov    $0x0,%eax
    return NULL;
  }

  return sock;
}
  8035d7:	5d                   	pop    %ebp
  8035d8:	c3                   	ret    

008035d9 <lwip_ioctl>:
  sys_sem_signal(sock->conn->op_completed);
}

int
lwip_ioctl(int s, long cmd, void *argp)
{
  8035d9:	55                   	push   %ebp
  8035da:	89 e5                	mov    %esp,%ebp
  8035dc:	56                   	push   %esi
  8035dd:	53                   	push   %ebx
  8035de:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  8035e1:	8b 75 10             	mov    0x10(%ebp),%esi
  struct lwip_socket *sock = get_socket(s);
  8035e4:	8b 45 08             	mov    0x8(%ebp),%eax
  8035e7:	e8 b4 ff ff ff       	call   8035a0 <get_socket>
  u16_t buflen = 0;

  if (!sock)
  8035ec:	ba ff ff ff ff       	mov    $0xffffffff,%edx
  8035f1:	85 c0                	test   %eax,%eax
  8035f3:	0f 84 a6 00 00 00    	je     80369f <lwip_ioctl+0xc6>
    return -1;

  switch (cmd) {
  8035f9:	81 fb 7e 66 04 80    	cmp    $0x8004667e,%ebx
  8035ff:	74 59                	je     80365a <lwip_ioctl+0x81>
  803601:	81 fb 7f 66 04 40    	cmp    $0x4004667f,%ebx
  803607:	0f 85 7c 00 00 00    	jne    803689 <lwip_ioctl+0xb0>
  case FIONREAD:
    if (!argp) {
  80360d:	85 f6                	test   %esi,%esi
  80360f:	90                   	nop
  803610:	75 13                	jne    803625 <lwip_ioctl+0x4c>
      sock_set_errno(sock, EINVAL);
  803612:	c7 40 10 16 00 00 00 	movl   $0x16,0x10(%eax)
  803619:	c7 05 a0 f5 b3 00 16 	movl   $0x16,0xb3f5a0
  803620:	00 00 00 
      return -1;
  803623:	eb 7a                	jmp    80369f <lwip_ioctl+0xc6>
    }

    SYS_ARCH_GET(sock->conn->recv_avail, *((u16_t*)argp));
  803625:	8b 10                	mov    (%eax),%edx
  803627:	0f b7 52 20          	movzwl 0x20(%edx),%edx
  80362b:	66 89 16             	mov    %dx,(%esi)

    /* Check if there is data left from the last recv operation. /maq 041215 */
    if (sock->lastdata) {
  80362e:	8b 48 04             	mov    0x4(%eax),%ecx
  803631:	85 c9                	test   %ecx,%ecx
  803633:	74 0d                	je     803642 <lwip_ioctl+0x69>
      buflen = netbuf_len(sock->lastdata);
  803635:	8b 09                	mov    (%ecx),%ecx
      buflen -= sock->lastoffset;

      *((u16_t*)argp) += buflen;
  803637:	66 03 51 08          	add    0x8(%ecx),%dx
  80363b:	66 2b 50 08          	sub    0x8(%eax),%dx
  80363f:	66 89 16             	mov    %dx,(%esi)
    }

    LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_ioctl(%d, FIONREAD, %p) = %u\n", s, argp, *((u16_t*)argp)));
    sock_set_errno(sock, 0);
  803642:	c7 40 10 00 00 00 00 	movl   $0x0,0x10(%eax)
  803649:	c7 05 a0 f5 b3 00 00 	movl   $0x0,0xb3f5a0
  803650:	00 00 00 
  803653:	ba 00 00 00 00       	mov    $0x0,%edx
    return 0;
  803658:	eb 45                	jmp    80369f <lwip_ioctl+0xc6>

  case FIONBIO:
    if (argp && *(u32_t*)argp)
  80365a:	85 f6                	test   %esi,%esi
  80365c:	74 0d                	je     80366b <lwip_ioctl+0x92>
  80365e:	83 3e 00             	cmpl   $0x0,(%esi)
  803661:	74 08                	je     80366b <lwip_ioctl+0x92>
      sock->flags |= O_NONBLOCK;
  803663:	66 81 48 0e 00 08    	orw    $0x800,0xe(%eax)
    LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_ioctl(%d, FIONREAD, %p) = %u\n", s, argp, *((u16_t*)argp)));
    sock_set_errno(sock, 0);
    return 0;

  case FIONBIO:
    if (argp && *(u32_t*)argp)
  803669:	eb 06                	jmp    803671 <lwip_ioctl+0x98>
      sock->flags |= O_NONBLOCK;
    else
      sock->flags &= ~O_NONBLOCK;
  80366b:	66 81 60 0e ff f7    	andw   $0xf7ff,0xe(%eax)
    LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_ioctl(%d, FIONBIO, %d)\n", s, !!(sock->flags & O_NONBLOCK)));
    sock_set_errno(sock, 0);
  803671:	c7 40 10 00 00 00 00 	movl   $0x0,0x10(%eax)
  803678:	c7 05 a0 f5 b3 00 00 	movl   $0x0,0xb3f5a0
  80367f:	00 00 00 
  803682:	ba 00 00 00 00       	mov    $0x0,%edx
    return 0;
  803687:	eb 16                	jmp    80369f <lwip_ioctl+0xc6>

  default:
    LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_ioctl(%d, UNIMPL: 0x%lx, %p)\n", s, cmd, argp));
    sock_set_errno(sock, ENOSYS); /* not yet implemented */
  803689:	c7 40 10 26 00 00 00 	movl   $0x26,0x10(%eax)
  803690:	c7 05 a0 f5 b3 00 26 	movl   $0x26,0xb3f5a0
  803697:	00 00 00 
  80369a:	ba ff ff ff ff       	mov    $0xffffffff,%edx
    return -1;
  } /* switch (cmd) */
}
  80369f:	89 d0                	mov    %edx,%eax
  8036a1:	5b                   	pop    %ebx
  8036a2:	5e                   	pop    %esi
  8036a3:	5d                   	pop    %ebp
  8036a4:	c3                   	ret    

008036a5 <lwip_setsockopt>:
  sys_sem_signal(sock->conn->op_completed);
}

int
lwip_setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen)
{
  8036a5:	55                   	push   %ebp
  8036a6:	89 e5                	mov    %esp,%ebp
  8036a8:	83 ec 48             	sub    $0x48,%esp
  8036ab:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  8036ae:	89 75 f8             	mov    %esi,-0x8(%ebp)
  8036b1:	89 7d fc             	mov    %edi,-0x4(%ebp)
  8036b4:	8b 75 0c             	mov    0xc(%ebp),%esi
  8036b7:	8b 7d 14             	mov    0x14(%ebp),%edi
  struct lwip_socket *sock = get_socket(s);
  8036ba:	8b 45 08             	mov    0x8(%ebp),%eax
  8036bd:	e8 de fe ff ff       	call   8035a0 <get_socket>
  8036c2:	89 c3                	mov    %eax,%ebx
  int err = ERR_OK;
  struct lwip_setgetsockopt_data data;

  if (!sock)
  8036c4:	85 c0                	test   %eax,%eax
  8036c6:	0f 84 52 01 00 00    	je     80381e <lwip_setsockopt+0x179>
    return -1;

  if (NULL == optval) {
  8036cc:	85 ff                	test   %edi,%edi
  8036ce:	75 1b                	jne    8036eb <lwip_setsockopt+0x46>
    sock_set_errno(sock, EFAULT);
  8036d0:	c7 40 10 0e 00 00 00 	movl   $0xe,0x10(%eax)
  8036d7:	c7 05 a0 f5 b3 00 0e 	movl   $0xe,0xb3f5a0
  8036de:	00 00 00 
  8036e1:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
    return -1;
  8036e6:	e9 3f 01 00 00       	jmp    80382a <lwip_setsockopt+0x185>
  }

  /* Do length and type checks for the various options first, to keep it readable. */
  switch (level) {
  8036eb:	83 fe 06             	cmp    $0x6,%esi
  8036ee:	0f 84 8e 00 00 00    	je     803782 <lwip_setsockopt+0xdd>
  8036f4:	81 fe ff 0f 00 00    	cmp    $0xfff,%esi
  8036fa:	74 11                	je     80370d <lwip_setsockopt+0x68>
  8036fc:	85 f6                	test   %esi,%esi
  8036fe:	66 90                	xchg   %ax,%ax
  803700:	74 66                	je     803768 <lwip_setsockopt+0xc3>
  803702:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  803708:	e9 a0 00 00 00       	jmp    8037ad <lwip_setsockopt+0x108>

/* Level: SOL_SOCKET */
  case SOL_SOCKET:
    switch (optname) {
  80370d:	83 7d 10 20          	cmpl   $0x20,0x10(%ebp)
  803711:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  803718:	74 1c                	je     803736 <lwip_setsockopt+0x91>
  80371a:	81 7d 10 0a 10 00 00 	cmpl   $0x100a,0x10(%ebp)
  803721:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  803728:	74 1b                	je     803745 <lwip_setsockopt+0xa0>
  80372a:	83 7d 10 08          	cmpl   $0x8,0x10(%ebp)
  80372e:	66 90                	xchg   %ax,%ax
  803730:	0f 85 77 00 00 00    	jne    8037ad <lwip_setsockopt+0x108>
#if SO_REUSE
    case SO_REUSEADDR:
    case SO_REUSEPORT:
#endif /* SO_REUSE */
    /* UNIMPL case SO_USELOOPBACK: */
      if (optlen < sizeof(int)) {
  803736:	83 7d 18 03          	cmpl   $0x3,0x18(%ebp)
  80373a:	0f 86 f7 00 00 00    	jbe    803837 <lwip_setsockopt+0x192>
  803740:	e9 80 00 00 00       	jmp    8037c5 <lwip_setsockopt+0x120>
        err = EINVAL;
      }
      break;
    case SO_NO_CHECK:
      if (optlen < sizeof(int)) {
  803745:	83 7d 18 04          	cmpl   $0x4,0x18(%ebp)
  803749:	19 c0                	sbb    %eax,%eax
  80374b:	83 e0 16             	and    $0x16,%eax
        err = EINVAL;
      }
#if LWIP_UDP
      if ((sock->conn->type != NETCONN_UDP) ||
  80374e:	8b 13                	mov    (%ebx),%edx
  803750:	83 3a 20             	cmpl   $0x20,(%edx)
  803753:	0f 85 e8 00 00 00    	jne    803841 <lwip_setsockopt+0x19c>
          ((udp_flags(sock->conn->pcb.udp) & UDP_FLAGS_UDPLITE) != 0)) {
  803759:	8b 52 08             	mov    0x8(%edx),%edx
  80375c:	f6 42 10 02          	testb  $0x2,0x10(%edx)
  803760:	0f 85 db 00 00 00    	jne    803841 <lwip_setsockopt+0x19c>
  803766:	eb 4a                	jmp    8037b2 <lwip_setsockopt+0x10d>
    }  /* switch (optname) */
    break;

/* Level: IPPROTO_IP */
  case IPPROTO_IP:
    switch (optname) {
  803768:	8b 45 10             	mov    0x10(%ebp),%eax
  80376b:	83 e8 01             	sub    $0x1,%eax
  80376e:	83 f8 01             	cmp    $0x1,%eax
  803771:	77 3a                	ja     8037ad <lwip_setsockopt+0x108>
    /* UNIMPL case IP_HDRINCL: */
    /* UNIMPL case IP_RCVDSTADDR: */
    /* UNIMPL case IP_RCVIF: */
    case IP_TTL:
    case IP_TOS:
      if (optlen < sizeof(int)) {
  803773:	83 7d 18 03          	cmpl   $0x3,0x18(%ebp)
  803777:	0f 86 ba 00 00 00    	jbe    803837 <lwip_setsockopt+0x192>
  80377d:	8d 76 00             	lea    0x0(%esi),%esi
  803780:	eb 43                	jmp    8037c5 <lwip_setsockopt+0x120>
    break;

#if LWIP_TCP
/* Level: IPPROTO_TCP */
  case IPPROTO_TCP:
    if (optlen < sizeof(int)) {
  803782:	83 7d 18 03          	cmpl   $0x3,0x18(%ebp)
  803786:	66 90                	xchg   %ax,%ax
  803788:	0f 86 a9 00 00 00    	jbe    803837 <lwip_setsockopt+0x192>
      err = EINVAL;
      break;
    }

    /* If this is no TCP socket, ignore any options. */
    if (sock->conn->type != NETCONN_TCP)
  80378e:	8b 00                	mov    (%eax),%eax
  803790:	83 38 10             	cmpl   $0x10,(%eax)
  803793:	0f 85 8c 00 00 00    	jne    803825 <lwip_setsockopt+0x180>
      return 0;

    switch (optname) {
  803799:	8b 55 10             	mov    0x10(%ebp),%edx
  80379c:	83 ea 01             	sub    $0x1,%edx
  80379f:	b8 5c 00 00 00       	mov    $0x5c,%eax
  8037a4:	83 fa 01             	cmp    $0x1,%edx
  8037a7:	77 0d                	ja     8037b6 <lwip_setsockopt+0x111>
  8037a9:	b0 00                	mov    $0x0,%al
  8037ab:	eb 05                	jmp    8037b2 <lwip_setsockopt+0x10d>
  8037ad:	b8 5c 00 00 00       	mov    $0x5c,%eax
                s, level, optname));
    err = ENOPROTOOPT;
  }  /* switch (level) */


  if (err != ERR_OK) {
  8037b2:	85 c0                	test   %eax,%eax
  8037b4:	74 0f                	je     8037c5 <lwip_setsockopt+0x120>
    sock_set_errno(sock, err);
  8037b6:	89 43 10             	mov    %eax,0x10(%ebx)
  8037b9:	a3 a0 f5 b3 00       	mov    %eax,0xb3f5a0
  8037be:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
    return -1;
  8037c3:	eb 65                	jmp    80382a <lwip_setsockopt+0x185>
  }


  /* Now do the actual option processing */
  data.sock = sock;
  8037c5:	89 5d cc             	mov    %ebx,-0x34(%ebp)
  data.level = level;
  8037c8:	89 75 d4             	mov    %esi,-0x2c(%ebp)
  data.optname = optname;
  8037cb:	8b 45 10             	mov    0x10(%ebp),%eax
  8037ce:	89 45 d8             	mov    %eax,-0x28(%ebp)
  data.optval = (void*)optval;
  8037d1:	89 7d dc             	mov    %edi,-0x24(%ebp)
  data.optlen = &optlen;
  8037d4:	8d 45 18             	lea    0x18(%ebp),%eax
  8037d7:	89 45 e0             	mov    %eax,-0x20(%ebp)
  data.err = err;
  8037da:	c6 45 e4 00          	movb   $0x0,-0x1c(%ebp)
  tcpip_callback(lwip_setsockopt_internal, &data);
  8037de:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
  8037e5:	00 
  8037e6:	8d 45 cc             	lea    -0x34(%ebp),%eax
  8037e9:	89 44 24 04          	mov    %eax,0x4(%esp)
  8037ed:	c7 04 24 2d 3a 80 00 	movl   $0x803a2d,(%esp)
  8037f4:	e8 bd 1a 00 00       	call   8052b6 <tcpip_callback_with_block>
  sys_arch_sem_wait(sock->conn->op_completed, 0);
  8037f9:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  803800:	00 
  803801:	8b 03                	mov    (%ebx),%eax
  803803:	8b 40 10             	mov    0x10(%eax),%eax
  803806:	89 04 24             	mov    %eax,(%esp)
  803809:	e8 e8 a0 00 00       	call   80d8f6 <sys_arch_sem_wait>
  /* maybe lwip_setsockopt_internal has changed err */
  err = data.err;
  80380e:	0f be 45 e4          	movsbl -0x1c(%ebp),%eax

  sock_set_errno(sock, err);
  803812:	89 43 10             	mov    %eax,0x10(%ebx)
  803815:	a3 a0 f5 b3 00       	mov    %eax,0xb3f5a0
  return err ? -1 : 0;
  80381a:	85 c0                	test   %eax,%eax
  80381c:	74 07                	je     803825 <lwip_setsockopt+0x180>
  80381e:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  803823:	eb 05                	jmp    80382a <lwip_setsockopt+0x185>
  803825:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80382a:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  80382d:	8b 75 f8             	mov    -0x8(%ebp),%esi
  803830:	8b 7d fc             	mov    -0x4(%ebp),%edi
  803833:	89 ec                	mov    %ebp,%esp
  803835:	5d                   	pop    %ebp
  803836:	c3                   	ret    
  sys_arch_sem_wait(sock->conn->op_completed, 0);
  /* maybe lwip_setsockopt_internal has changed err */
  err = data.err;

  sock_set_errno(sock, err);
  return err ? -1 : 0;
  803837:	b8 16 00 00 00       	mov    $0x16,%eax
  80383c:	e9 75 ff ff ff       	jmp    8037b6 <lwip_setsockopt+0x111>
  803841:	b8 61 00 00 00       	mov    $0x61,%eax
  803846:	e9 6b ff ff ff       	jmp    8037b6 <lwip_setsockopt+0x111>

0080384b <lwip_getsockopt>:
  return lwip_getaddrname(s, name, namelen, 1);
}

int
lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen)
{
  80384b:	55                   	push   %ebp
  80384c:	89 e5                	mov    %esp,%ebp
  80384e:	57                   	push   %edi
  80384f:	56                   	push   %esi
  803850:	53                   	push   %ebx
  803851:	83 ec 3c             	sub    $0x3c,%esp
  803854:	8b 75 0c             	mov    0xc(%ebp),%esi
  803857:	8b 7d 18             	mov    0x18(%ebp),%edi
  err_t err = ERR_OK;
  struct lwip_socket *sock = get_socket(s);
  80385a:	8b 45 08             	mov    0x8(%ebp),%eax
  80385d:	e8 3e fd ff ff       	call   8035a0 <get_socket>
  803862:	89 c3                	mov    %eax,%ebx
  struct lwip_setgetsockopt_data data;

  if (!sock)
  803864:	85 c0                	test   %eax,%eax
  803866:	0f 84 99 01 00 00    	je     803a05 <lwip_getsockopt+0x1ba>
    return -1;

  if ((NULL == optval) || (NULL == optlen)) {
  80386c:	83 7d 14 00          	cmpl   $0x0,0x14(%ebp)
  803870:	74 04                	je     803876 <lwip_getsockopt+0x2b>
  803872:	85 ff                	test   %edi,%edi
  803874:	75 1b                	jne    803891 <lwip_getsockopt+0x46>
    sock_set_errno(sock, EFAULT);
  803876:	c7 43 10 0e 00 00 00 	movl   $0xe,0x10(%ebx)
  80387d:	c7 05 a0 f5 b3 00 0e 	movl   $0xe,0xb3f5a0
  803884:	00 00 00 
  803887:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
    return -1;
  80388c:	e9 80 01 00 00       	jmp    803a11 <lwip_getsockopt+0x1c6>
  }

  /* Do length and type checks for the various options first, to keep it readable. */
  switch (level) {
  803891:	83 fe 06             	cmp    $0x6,%esi
  803894:	0f 84 c3 00 00 00    	je     80395d <lwip_getsockopt+0x112>
  80389a:	81 fe ff 0f 00 00    	cmp    $0xfff,%esi
  8038a0:	74 13                	je     8038b5 <lwip_getsockopt+0x6a>
  8038a2:	85 f6                	test   %esi,%esi
  8038a4:	0f 84 9d 00 00 00    	je     803947 <lwip_getsockopt+0xfc>
  8038aa:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  8038b0:	e9 d8 00 00 00       	jmp    80398d <lwip_getsockopt+0x142>
   
/* Level: SOL_SOCKET */
  case SOL_SOCKET:
    switch (optname) {
  8038b5:	83 7d 10 20          	cmpl   $0x20,0x10(%ebp)
  8038b9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  8038c0:	74 50                	je     803912 <lwip_getsockopt+0xc7>
  8038c2:	83 7d 10 20          	cmpl   $0x20,0x10(%ebp)
  8038c6:	66 90                	xchg   %ax,%ax
  8038c8:	7f 18                	jg     8038e2 <lwip_getsockopt+0x97>
  8038ca:	83 7d 10 02          	cmpl   $0x2,0x10(%ebp)
  8038ce:	66 90                	xchg   %ax,%ax
  8038d0:	74 40                	je     803912 <lwip_getsockopt+0xc7>
  8038d2:	83 7d 10 08          	cmpl   $0x8,0x10(%ebp)
  8038d6:	0f 85 b1 00 00 00    	jne    80398d <lwip_getsockopt+0x142>
  8038dc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  8038e0:	eb 30                	jmp    803912 <lwip_getsockopt+0xc7>
  8038e2:	81 7d 10 07 10 00 00 	cmpl   $0x1007,0x10(%ebp)
  8038e9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  8038f0:	0f 8c 97 00 00 00    	jl     80398d <lwip_getsockopt+0x142>
  8038f6:	81 7d 10 08 10 00 00 	cmpl   $0x1008,0x10(%ebp)
  8038fd:	8d 76 00             	lea    0x0(%esi),%esi
  803900:	7e 10                	jle    803912 <lwip_getsockopt+0xc7>
  803902:	81 7d 10 0a 10 00 00 	cmpl   $0x100a,0x10(%ebp)
  803909:	0f 85 7e 00 00 00    	jne    80398d <lwip_getsockopt+0x142>
  80390f:	90                   	nop
  803910:	eb 13                	jmp    803925 <lwip_getsockopt+0xda>
    case SO_REUSEADDR:
    case SO_REUSEPORT:
#endif /* SO_REUSE */
    case SO_TYPE:
    /* UNIMPL case SO_USELOOPBACK: */
      if (*optlen < sizeof(int)) {
  803912:	83 3f 03             	cmpl   $0x3,(%edi)
  803915:	8d 76 00             	lea    0x0(%esi),%esi
  803918:	0f 86 fb 00 00 00    	jbe    803a19 <lwip_getsockopt+0x1ce>
  80391e:	66 90                	xchg   %ax,%ax
  803920:	e9 83 00 00 00       	jmp    8039a8 <lwip_getsockopt+0x15d>
        err = EINVAL;
      }
      break;

    case SO_NO_CHECK:
      if (*optlen < sizeof(int)) {
  803925:	83 3f 04             	cmpl   $0x4,(%edi)
  803928:	19 c0                	sbb    %eax,%eax
  80392a:	83 e0 16             	and    $0x16,%eax
        err = EINVAL;
      }
#if LWIP_UDP
      if ((sock->conn->type != NETCONN_UDP) ||
  80392d:	8b 13                	mov    (%ebx),%edx
  80392f:	83 3a 20             	cmpl   $0x20,(%edx)
  803932:	0f 85 eb 00 00 00    	jne    803a23 <lwip_getsockopt+0x1d8>
          ((udp_flags(sock->conn->pcb.udp) & UDP_FLAGS_UDPLITE) != 0)) {
  803938:	8b 52 08             	mov    0x8(%edx),%edx
  80393b:	f6 42 10 02          	testb  $0x2,0x10(%edx)
  80393f:	0f 85 de 00 00 00    	jne    803a23 <lwip_getsockopt+0x1d8>
  803945:	eb 4b                	jmp    803992 <lwip_getsockopt+0x147>
    }  /* switch (optname) */
    break;
                     
/* Level: IPPROTO_IP */
  case IPPROTO_IP:
    switch (optname) {
  803947:	8b 45 10             	mov    0x10(%ebp),%eax
  80394a:	83 e8 01             	sub    $0x1,%eax
  80394d:	83 f8 01             	cmp    $0x1,%eax
  803950:	77 3b                	ja     80398d <lwip_getsockopt+0x142>
    /* UNIMPL case IP_HDRINCL: */
    /* UNIMPL case IP_RCVDSTADDR: */
    /* UNIMPL case IP_RCVIF: */
    case IP_TTL:
    case IP_TOS:
      if (*optlen < sizeof(int)) {
  803952:	83 3f 03             	cmpl   $0x3,(%edi)
  803955:	0f 86 be 00 00 00    	jbe    803a19 <lwip_getsockopt+0x1ce>
  80395b:	eb 4b                	jmp    8039a8 <lwip_getsockopt+0x15d>
    break;
         
#if LWIP_TCP
/* Level: IPPROTO_TCP */
  case IPPROTO_TCP:
    if (*optlen < sizeof(int)) {
  80395d:	83 3f 03             	cmpl   $0x3,(%edi)
  803960:	0f 86 b3 00 00 00    	jbe    803a19 <lwip_getsockopt+0x1ce>
      err = EINVAL;
      break;
    }
    
    /* If this is no TCP socket, ignore any options. */
    if (sock->conn->type != NETCONN_TCP)
  803966:	8b 00                	mov    (%eax),%eax
  803968:	83 38 10             	cmpl   $0x10,(%eax)
  80396b:	90                   	nop
  80396c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  803970:	0f 85 96 00 00 00    	jne    803a0c <lwip_getsockopt+0x1c1>
      return 0;

    switch (optname) {
  803976:	8b 55 10             	mov    0x10(%ebp),%edx
  803979:	83 ea 01             	sub    $0x1,%edx
  80397c:	b8 5c 00 00 00       	mov    $0x5c,%eax
  803981:	83 fa 01             	cmp    $0x1,%edx
  803984:	77 10                	ja     803996 <lwip_getsockopt+0x14b>
  803986:	b8 00 00 00 00       	mov    $0x0,%eax
  80398b:	eb 05                	jmp    803992 <lwip_getsockopt+0x147>
  80398d:	b8 5c 00 00 00       	mov    $0x5c,%eax
                                  s, level, optname));
      err = ENOPROTOOPT;
  }  /* switch */

   
  if (err != ERR_OK) {
  803992:	84 c0                	test   %al,%al
  803994:	74 12                	je     8039a8 <lwip_getsockopt+0x15d>
    sock_set_errno(sock, err);
  803996:	0f be c0             	movsbl %al,%eax
  803999:	89 43 10             	mov    %eax,0x10(%ebx)
  80399c:	a3 a0 f5 b3 00       	mov    %eax,0xb3f5a0
  8039a1:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
    return -1;
  8039a6:	eb 69                	jmp    803a11 <lwip_getsockopt+0x1c6>
  }

  /* Now do the actual option processing */
  data.sock = sock;
  8039a8:	89 5d cc             	mov    %ebx,-0x34(%ebp)
  data.level = level;
  8039ab:	89 75 d4             	mov    %esi,-0x2c(%ebp)
  data.optname = optname;
  8039ae:	8b 45 10             	mov    0x10(%ebp),%eax
  8039b1:	89 45 d8             	mov    %eax,-0x28(%ebp)
  data.optval = optval;
  8039b4:	8b 45 14             	mov    0x14(%ebp),%eax
  8039b7:	89 45 dc             	mov    %eax,-0x24(%ebp)
  data.optlen = optlen;
  8039ba:	89 7d e0             	mov    %edi,-0x20(%ebp)
  data.err = err;
  8039bd:	c6 45 e4 00          	movb   $0x0,-0x1c(%ebp)
  tcpip_callback(lwip_getsockopt_internal, &data);
  8039c1:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
  8039c8:	00 
  8039c9:	8d 45 cc             	lea    -0x34(%ebp),%eax
  8039cc:	89 44 24 04          	mov    %eax,0x4(%esp)
  8039d0:	c7 04 24 40 3b 80 00 	movl   $0x803b40,(%esp)
  8039d7:	e8 da 18 00 00       	call   8052b6 <tcpip_callback_with_block>
  sys_arch_sem_wait(sock->conn->op_completed, 0);
  8039dc:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  8039e3:	00 
  8039e4:	8b 03                	mov    (%ebx),%eax
  8039e6:	8b 40 10             	mov    0x10(%eax),%eax
  8039e9:	89 04 24             	mov    %eax,(%esp)
  8039ec:	e8 05 9f 00 00       	call   80d8f6 <sys_arch_sem_wait>
  /* maybe lwip_getsockopt_internal has changed err */
  err = data.err;
  8039f1:	0f b6 45 e4          	movzbl -0x1c(%ebp),%eax

  sock_set_errno(sock, err);
  8039f5:	0f be d0             	movsbl %al,%edx
  8039f8:	89 53 10             	mov    %edx,0x10(%ebx)
  8039fb:	89 15 a0 f5 b3 00    	mov    %edx,0xb3f5a0
  return err ? -1 : 0;
  803a01:	84 c0                	test   %al,%al
  803a03:	74 07                	je     803a0c <lwip_getsockopt+0x1c1>
  803a05:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  803a0a:	eb 05                	jmp    803a11 <lwip_getsockopt+0x1c6>
  803a0c:	b8 00 00 00 00       	mov    $0x0,%eax
}
  803a11:	83 c4 3c             	add    $0x3c,%esp
  803a14:	5b                   	pop    %ebx
  803a15:	5e                   	pop    %esi
  803a16:	5f                   	pop    %edi
  803a17:	5d                   	pop    %ebp
  803a18:	c3                   	ret    
  sys_arch_sem_wait(sock->conn->op_completed, 0);
  /* maybe lwip_getsockopt_internal has changed err */
  err = data.err;

  sock_set_errno(sock, err);
  return err ? -1 : 0;
  803a19:	b8 16 00 00 00       	mov    $0x16,%eax
  803a1e:	e9 73 ff ff ff       	jmp    803996 <lwip_getsockopt+0x14b>
  803a23:	b8 61 00 00 00       	mov    $0x61,%eax
  803a28:	e9 69 ff ff ff       	jmp    803996 <lwip_getsockopt+0x14b>

00803a2d <lwip_setsockopt_internal>:
  return err ? -1 : 0;
}

static void
lwip_setsockopt_internal(void *arg)
{
  803a2d:	55                   	push   %ebp
  803a2e:	89 e5                	mov    %esp,%ebp
  803a30:	53                   	push   %ebx
  803a31:	83 ec 14             	sub    $0x14,%esp
  803a34:	8b 45 08             	mov    0x8(%ebp),%eax
#endif /* LWIP_DEBUG */
  int level, optname;
  const void *optval;
  struct lwip_setgetsockopt_data *data;

  LWIP_ASSERT("arg != NULL", arg != NULL);
  803a37:	85 c0                	test   %eax,%eax
  803a39:	75 1c                	jne    803a57 <lwip_setsockopt_internal+0x2a>
  803a3b:	c7 44 24 08 3a 2e 81 	movl   $0x812e3a,0x8(%esp)
  803a42:	00 
  803a43:	c7 44 24 04 ae 06 00 	movl   $0x6ae,0x4(%esp)
  803a4a:	00 
  803a4b:	c7 04 24 46 2e 81 00 	movl   $0x812e46,(%esp)
  803a52:	e8 45 cf ff ff       	call   80099c <_panic>

  data = (struct lwip_setgetsockopt_data*)arg;
  sock = data->sock;
  803a57:	8b 10                	mov    (%eax),%edx
#ifdef LWIP_DEBUG
  s = data->s;
#endif /* LWIP_DEBUG */
  level = data->level;
  optname = data->optname;
  803a59:	8b 48 0c             	mov    0xc(%eax),%ecx
  optval = data->optval;
  803a5c:	8b 58 10             	mov    0x10(%eax),%ebx

  switch (level) {
  803a5f:	8b 40 08             	mov    0x8(%eax),%eax
  803a62:	83 f8 06             	cmp    $0x6,%eax
  803a65:	0f 84 88 00 00 00    	je     803af3 <lwip_setsockopt_internal+0xc6>
  803a6b:	3d ff 0f 00 00       	cmp    $0xfff,%eax
  803a70:	74 0b                	je     803a7d <lwip_setsockopt_internal+0x50>
  803a72:	85 c0                	test   %eax,%eax
  803a74:	74 5b                	je     803ad1 <lwip_setsockopt_internal+0xa4>
  803a76:	66 90                	xchg   %ax,%ax
  803a78:	e9 b0 00 00 00       	jmp    803b2d <lwip_setsockopt_internal+0x100>

/* Level: SOL_SOCKET */
  case SOL_SOCKET:
    switch (optname) {
  803a7d:	83 f9 20             	cmp    $0x20,%ecx
  803a80:	74 14                	je     803a96 <lwip_setsockopt_internal+0x69>
  803a82:	81 f9 0a 10 00 00    	cmp    $0x100a,%ecx
  803a88:	74 2c                	je     803ab6 <lwip_setsockopt_internal+0x89>
  803a8a:	83 f9 08             	cmp    $0x8,%ecx
  803a8d:	8d 76 00             	lea    0x0(%esi),%esi
  803a90:	0f 85 97 00 00 00    	jne    803b2d <lwip_setsockopt_internal+0x100>
#if SO_REUSE
    case SO_REUSEADDR:
    case SO_REUSEPORT:
#endif /* SO_REUSE */
    /* UNIMPL case SO_USELOOPBACK: */
      if (*(int*)optval) {
  803a96:	83 3b 00             	cmpl   $0x0,(%ebx)
  803a99:	74 0e                	je     803aa9 <lwip_setsockopt_internal+0x7c>
        sock->conn->pcb.ip->so_options |= optname;
  803a9b:	8b 02                	mov    (%edx),%eax
  803a9d:	8b 40 08             	mov    0x8(%eax),%eax
  803aa0:	66 09 48 08          	or     %cx,0x8(%eax)
  803aa4:	e9 84 00 00 00       	jmp    803b2d <lwip_setsockopt_internal+0x100>
      } else {
        sock->conn->pcb.ip->so_options &= ~optname;
  803aa9:	8b 02                	mov    (%edx),%eax
  803aab:	8b 40 08             	mov    0x8(%eax),%eax
  803aae:	f7 d1                	not    %ecx
  803ab0:	66 21 48 08          	and    %cx,0x8(%eax)
  803ab4:	eb 77                	jmp    803b2d <lwip_setsockopt_internal+0x100>
      sock->conn->recv_bufsize = ( *(int*)optval );
      break;
#endif /* LWIP_SO_RCVBUF */
#if LWIP_UDP
    case SO_NO_CHECK:
      if (*(int*)optval) {
  803ab6:	83 3b 00             	cmpl   $0x0,(%ebx)
  803ab9:	74 0b                	je     803ac6 <lwip_setsockopt_internal+0x99>
        udp_setflags(sock->conn->pcb.udp, udp_flags(sock->conn->pcb.udp) | UDP_FLAGS_NOCHKSUM);
  803abb:	8b 02                	mov    (%edx),%eax
  803abd:	8b 40 08             	mov    0x8(%eax),%eax
  803ac0:	80 48 10 01          	orb    $0x1,0x10(%eax)
  803ac4:	eb 67                	jmp    803b2d <lwip_setsockopt_internal+0x100>
      } else {
        udp_setflags(sock->conn->pcb.udp, udp_flags(sock->conn->pcb.udp) & ~UDP_FLAGS_NOCHKSUM);
  803ac6:	8b 02                	mov    (%edx),%eax
  803ac8:	8b 40 08             	mov    0x8(%eax),%eax
  803acb:	80 60 10 fe          	andb   $0xfe,0x10(%eax)
  803acf:	eb 5c                	jmp    803b2d <lwip_setsockopt_internal+0x100>
    }  /* switch (optname) */
    break;

/* Level: IPPROTO_IP */
  case IPPROTO_IP:
    switch (optname) {
  803ad1:	83 f9 01             	cmp    $0x1,%ecx
  803ad4:	74 11                	je     803ae7 <lwip_setsockopt_internal+0xba>
  803ad6:	83 f9 02             	cmp    $0x2,%ecx
  803ad9:	75 52                	jne    803b2d <lwip_setsockopt_internal+0x100>
    case IP_TTL:
      sock->conn->pcb.ip->ttl = (u8_t)(*(int*)optval);
  803adb:	8b 02                	mov    (%edx),%eax
  803add:	8b 40 08             	mov    0x8(%eax),%eax
  803ae0:	8b 0b                	mov    (%ebx),%ecx
  803ae2:	88 48 0b             	mov    %cl,0xb(%eax)
      LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_IP, IP_TTL, ..) -> %u\n",
                  s, sock->conn->pcb.ip->ttl));
      break;
  803ae5:	eb 46                	jmp    803b2d <lwip_setsockopt_internal+0x100>
    case IP_TOS:
      sock->conn->pcb.ip->tos = (u8_t)(*(int*)optval);
  803ae7:	8b 02                	mov    (%edx),%eax
  803ae9:	8b 40 08             	mov    0x8(%eax),%eax
  803aec:	8b 0b                	mov    (%ebx),%ecx
  803aee:	88 48 0a             	mov    %cl,0xa(%eax)
      LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_IP, IP_TOS, ..)-> %u\n",
  803af1:	eb 3a                	jmp    803b2d <lwip_setsockopt_internal+0x100>
    break;

#if LWIP_TCP
/* Level: IPPROTO_TCP */
  case IPPROTO_TCP:
    switch (optname) {
  803af3:	83 f9 01             	cmp    $0x1,%ecx
  803af6:	74 0a                	je     803b02 <lwip_setsockopt_internal+0xd5>
  803af8:	83 f9 02             	cmp    $0x2,%ecx
  803afb:	75 30                	jne    803b2d <lwip_setsockopt_internal+0x100>
  803afd:	8d 76 00             	lea    0x0(%esi),%esi
  803b00:	eb 1e                	jmp    803b20 <lwip_setsockopt_internal+0xf3>
    case TCP_NODELAY:
      if (*(int*)optval) {
  803b02:	83 3b 00             	cmpl   $0x0,(%ebx)
  803b05:	8d 76 00             	lea    0x0(%esi),%esi
  803b08:	74 0b                	je     803b15 <lwip_setsockopt_internal+0xe8>
        sock->conn->pcb.tcp->flags |= TF_NODELAY;
  803b0a:	8b 02                	mov    (%edx),%eax
  803b0c:	8b 40 08             	mov    0x8(%eax),%eax
  803b0f:	80 48 20 40          	orb    $0x40,0x20(%eax)
  803b13:	eb 18                	jmp    803b2d <lwip_setsockopt_internal+0x100>
      } else {
        sock->conn->pcb.tcp->flags &= ~TF_NODELAY;
  803b15:	8b 02                	mov    (%edx),%eax
  803b17:	8b 40 08             	mov    0x8(%eax),%eax
  803b1a:	80 60 20 bf          	andb   $0xbf,0x20(%eax)
  803b1e:	eb 0d                	jmp    803b2d <lwip_setsockopt_internal+0x100>
      }
      LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_TCP, TCP_NODELAY) -> %s\n",
                  s, (*(int *)optval)?"on":"off") );
      break;
    case TCP_KEEPALIVE:
      sock->conn->pcb.tcp->keep_idle = (u32_t)(*(int*)optval);
  803b20:	8b 02                	mov    (%edx),%eax
  803b22:	8b 40 08             	mov    0x8(%eax),%eax
  803b25:	8b 0b                	mov    (%ebx),%ecx
  803b27:	89 88 9c 00 00 00    	mov    %ecx,0x9c(%eax)
      break;
    }  /* switch (optname) */
    break;
#endif /* LWIP_UDP */
  }  /* switch (level) */
  sys_sem_signal(sock->conn->op_completed);
  803b2d:	8b 02                	mov    (%edx),%eax
  803b2f:	8b 40 10             	mov    0x10(%eax),%eax
  803b32:	89 04 24             	mov    %eax,(%esp)
  803b35:	e8 ad a0 00 00       	call   80dbe7 <sys_sem_signal>
}
  803b3a:	83 c4 14             	add    $0x14,%esp
  803b3d:	5b                   	pop    %ebx
  803b3e:	5d                   	pop    %ebp
  803b3f:	c3                   	ret    

00803b40 <lwip_getsockopt_internal>:
  return err ? -1 : 0;
}

static void
lwip_getsockopt_internal(void *arg)
{
  803b40:	55                   	push   %ebp
  803b41:	89 e5                	mov    %esp,%ebp
  803b43:	53                   	push   %ebx
  803b44:	83 ec 14             	sub    $0x14,%esp
  803b47:	8b 45 08             	mov    0x8(%ebp),%eax
#endif /* LWIP_DEBUG */
  int level, optname;
  void *optval;
  struct lwip_setgetsockopt_data *data;

  LWIP_ASSERT("arg != NULL", arg != NULL);
  803b4a:	85 c0                	test   %eax,%eax
  803b4c:	75 1c                	jne    803b6a <lwip_getsockopt_internal+0x2a>
  803b4e:	c7 44 24 08 3a 2e 81 	movl   $0x812e3a,0x8(%esp)
  803b55:	00 
  803b56:	c7 44 24 04 38 05 00 	movl   $0x538,0x4(%esp)
  803b5d:	00 
  803b5e:	c7 04 24 46 2e 81 00 	movl   $0x812e46,(%esp)
  803b65:	e8 32 ce ff ff       	call   80099c <_panic>

  data = (struct lwip_setgetsockopt_data*)arg;
  sock = data->sock;
  803b6a:	8b 10                	mov    (%eax),%edx
#ifdef LWIP_DEBUG
  s = data->s;
#endif /* LWIP_DEBUG */
  level = data->level;
  optname = data->optname;
  803b6c:	8b 48 0c             	mov    0xc(%eax),%ecx
  optval = data->optval;
  803b6f:	8b 58 10             	mov    0x10(%eax),%ebx

  switch (level) {
  803b72:	8b 40 08             	mov    0x8(%eax),%eax
  803b75:	83 f8 06             	cmp    $0x6,%eax
  803b78:	0f 84 17 01 00 00    	je     803c95 <lwip_getsockopt_internal+0x155>
  803b7e:	3d ff 0f 00 00       	cmp    $0xfff,%eax
  803b83:	74 10                	je     803b95 <lwip_getsockopt_internal+0x55>
  803b85:	85 c0                	test   %eax,%eax
  803b87:	0f 84 e4 00 00 00    	je     803c71 <lwip_getsockopt_internal+0x131>
  803b8d:	8d 76 00             	lea    0x0(%esi),%esi
  803b90:	e9 2a 01 00 00       	jmp    803cbf <lwip_getsockopt_internal+0x17f>
   
/* Level: SOL_SOCKET */
  case SOL_SOCKET:
    switch (optname) {
  803b95:	83 f9 20             	cmp    $0x20,%ecx
  803b98:	74 40                	je     803bda <lwip_getsockopt_internal+0x9a>
  803b9a:	83 f9 20             	cmp    $0x20,%ecx
  803b9d:	8d 76 00             	lea    0x0(%esi),%esi
  803ba0:	7f 10                	jg     803bb2 <lwip_getsockopt_internal+0x72>
  803ba2:	83 f9 02             	cmp    $0x2,%ecx
  803ba5:	74 33                	je     803bda <lwip_getsockopt_internal+0x9a>
  803ba7:	83 f9 08             	cmp    $0x8,%ecx
  803baa:	0f 85 0f 01 00 00    	jne    803cbf <lwip_getsockopt_internal+0x17f>
  803bb0:	eb 28                	jmp    803bda <lwip_getsockopt_internal+0x9a>
  803bb2:	81 f9 08 10 00 00    	cmp    $0x1008,%ecx
  803bb8:	74 32                	je     803bec <lwip_getsockopt_internal+0xac>
  803bba:	81 f9 0a 10 00 00    	cmp    $0x100a,%ecx
  803bc0:	0f 84 9b 00 00 00    	je     803c61 <lwip_getsockopt_internal+0x121>
  803bc6:	81 f9 07 10 00 00    	cmp    $0x1007,%ecx
  803bcc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  803bd0:	0f 85 e9 00 00 00    	jne    803cbf <lwip_getsockopt_internal+0x17f>
  803bd6:	66 90                	xchg   %ax,%ax
  803bd8:	eb 4f                	jmp    803c29 <lwip_getsockopt_internal+0xe9>
#if SO_REUSE
    case SO_REUSEADDR:
    case SO_REUSEPORT:
#endif /* SO_REUSE */
    /*case SO_USELOOPBACK: UNIMPL */
      *(int*)optval = sock->conn->pcb.ip->so_options & optname;
  803bda:	8b 02                	mov    (%edx),%eax
  803bdc:	8b 40 08             	mov    0x8(%eax),%eax
  803bdf:	0f b7 40 08          	movzwl 0x8(%eax),%eax
  803be3:	21 c1                	and    %eax,%ecx
  803be5:	89 0b                	mov    %ecx,(%ebx)
      LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, SOL_SOCKET, optname=0x%x, ..) = %s\n",
                                  s, optname, (*(int*)optval?"on":"off")));
      break;
  803be7:	e9 d3 00 00 00       	jmp    803cbf <lwip_getsockopt_internal+0x17f>

    case SO_TYPE:
      switch (NETCONNTYPE_GROUP(sock->conn->type)) {
  803bec:	8b 02                	mov    (%edx),%eax
  803bee:	8b 08                	mov    (%eax),%ecx
  803bf0:	89 c8                	mov    %ecx,%eax
  803bf2:	25 f0 00 00 00       	and    $0xf0,%eax
  803bf7:	83 f8 20             	cmp    $0x20,%eax
  803bfa:	74 22                	je     803c1e <lwip_getsockopt_internal+0xde>
  803bfc:	83 f8 40             	cmp    $0x40,%eax
  803bff:	74 12                	je     803c13 <lwip_getsockopt_internal+0xd3>
        break;
      case NETCONN_UDP:
        *(int*)optval = SOCK_DGRAM;
        break;
      default: /* unrecognized socket type */
        *(int*)optval = sock->conn->type;
  803c01:	83 f8 10             	cmp    $0x10,%eax
  803c04:	b8 01 00 00 00       	mov    $0x1,%eax
  803c09:	0f 44 c8             	cmove  %eax,%ecx
  803c0c:	89 0b                	mov    %ecx,(%ebx)
  803c0e:	e9 ac 00 00 00       	jmp    803cbf <lwip_getsockopt_internal+0x17f>
      break;

    case SO_TYPE:
      switch (NETCONNTYPE_GROUP(sock->conn->type)) {
      case NETCONN_RAW:
        *(int*)optval = SOCK_RAW;
  803c13:	c7 03 03 00 00 00    	movl   $0x3,(%ebx)
        break;
  803c19:	e9 a1 00 00 00       	jmp    803cbf <lwip_getsockopt_internal+0x17f>
      case NETCONN_TCP:
        *(int*)optval = SOCK_STREAM;
        break;
      case NETCONN_UDP:
        *(int*)optval = SOCK_DGRAM;
  803c1e:	c7 03 02 00 00 00    	movl   $0x2,(%ebx)
        break;
  803c24:	e9 96 00 00 00       	jmp    803cbf <lwip_getsockopt_internal+0x17f>
      LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, SOL_SOCKET, SO_TYPE) = %d\n",
                  s, *(int *)optval));
      break;

    case SO_ERROR:
      if (sock->err == 0) {
  803c29:	83 7a 10 00          	cmpl   $0x0,0x10(%edx)
  803c2d:	8d 76 00             	lea    0x0(%esi),%esi
  803c30:	75 21                	jne    803c53 <lwip_getsockopt_internal+0x113>
        sock_set_errno(sock, err_to_errno(sock->conn->err));
  803c32:	8b 02                	mov    (%edx),%eax
  803c34:	0f be 48 0c          	movsbl 0xc(%eax),%ecx
  803c38:	f7 d9                	neg    %ecx
  803c3a:	b8 05 00 00 00       	mov    $0x5,%eax
  803c3f:	83 f9 0e             	cmp    $0xe,%ecx
  803c42:	77 07                	ja     803c4b <lwip_getsockopt_internal+0x10b>
  803c44:	8b 04 8d 20 2f 81 00 	mov    0x812f20(,%ecx,4),%eax
  803c4b:	89 42 10             	mov    %eax,0x10(%edx)
  803c4e:	a3 a0 f5 b3 00       	mov    %eax,0xb3f5a0
      } 
      *(int *)optval = sock->err;
  803c53:	8b 42 10             	mov    0x10(%edx),%eax
  803c56:	89 03                	mov    %eax,(%ebx)
      sock->err = 0;
  803c58:	c7 42 10 00 00 00 00 	movl   $0x0,0x10(%edx)
      LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, SOL_SOCKET, SO_ERROR) = %d\n",
                  s, *(int *)optval));
      break;
  803c5f:	eb 5e                	jmp    803cbf <lwip_getsockopt_internal+0x17f>
      *(int *)optval = sock->conn->recv_bufsize;
      break;
#endif /* LWIP_SO_RCVBUF */
#if LWIP_UDP
    case SO_NO_CHECK:
      *(int*)optval = (udp_flags(sock->conn->pcb.udp) & UDP_FLAGS_NOCHKSUM) ? 1 : 0;
  803c61:	8b 02                	mov    (%edx),%eax
  803c63:	8b 40 08             	mov    0x8(%eax),%eax
  803c66:	0f b6 40 10          	movzbl 0x10(%eax),%eax
  803c6a:	83 e0 01             	and    $0x1,%eax
  803c6d:	89 03                	mov    %eax,(%ebx)
  803c6f:	eb 4e                	jmp    803cbf <lwip_getsockopt_internal+0x17f>
    }  /* switch (optname) */
    break;

/* Level: IPPROTO_IP */
  case IPPROTO_IP:
    switch (optname) {
  803c71:	83 f9 01             	cmp    $0x1,%ecx
  803c74:	74 12                	je     803c88 <lwip_getsockopt_internal+0x148>
  803c76:	83 f9 02             	cmp    $0x2,%ecx
  803c79:	75 44                	jne    803cbf <lwip_getsockopt_internal+0x17f>
    case IP_TTL:
      *(int*)optval = sock->conn->pcb.ip->ttl;
  803c7b:	8b 02                	mov    (%edx),%eax
  803c7d:	8b 40 08             	mov    0x8(%eax),%eax
  803c80:	0f b6 40 0b          	movzbl 0xb(%eax),%eax
  803c84:	89 03                	mov    %eax,(%ebx)
      LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_IP, IP_TTL) = %d\n",
                  s, *(int *)optval));
      break;
  803c86:	eb 37                	jmp    803cbf <lwip_getsockopt_internal+0x17f>
    case IP_TOS:
      *(int*)optval = sock->conn->pcb.ip->tos;
  803c88:	8b 02                	mov    (%edx),%eax
  803c8a:	8b 40 08             	mov    0x8(%eax),%eax
  803c8d:	0f b6 40 0a          	movzbl 0xa(%eax),%eax
  803c91:	89 03                	mov    %eax,(%ebx)
      LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_IP, IP_TOS) = %d\n",
  803c93:	eb 2a                	jmp    803cbf <lwip_getsockopt_internal+0x17f>
    break;

#if LWIP_TCP
/* Level: IPPROTO_TCP */
  case IPPROTO_TCP:
    switch (optname) {
  803c95:	83 f9 01             	cmp    $0x1,%ecx
  803c98:	74 08                	je     803ca2 <lwip_getsockopt_internal+0x162>
  803c9a:	83 f9 02             	cmp    $0x2,%ecx
  803c9d:	75 20                	jne    803cbf <lwip_getsockopt_internal+0x17f>
  803c9f:	90                   	nop
  803ca0:	eb 10                	jmp    803cb2 <lwip_getsockopt_internal+0x172>
    case TCP_NODELAY:
      *(int*)optval = (sock->conn->pcb.tcp->flags & TF_NODELAY);
  803ca2:	8b 02                	mov    (%edx),%eax
  803ca4:	8b 40 08             	mov    0x8(%eax),%eax
  803ca7:	0f b6 40 20          	movzbl 0x20(%eax),%eax
  803cab:	83 e0 40             	and    $0x40,%eax
  803cae:	89 03                	mov    %eax,(%ebx)
      LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_TCP, TCP_NODELAY) = %s\n",
                  s, (*(int*)optval)?"on":"off") );
      break;
  803cb0:	eb 0d                	jmp    803cbf <lwip_getsockopt_internal+0x17f>
    case TCP_KEEPALIVE:
      *(int*)optval = (int)sock->conn->pcb.tcp->keep_idle;
  803cb2:	8b 02                	mov    (%edx),%eax
  803cb4:	8b 40 08             	mov    0x8(%eax),%eax
  803cb7:	8b 80 9c 00 00 00    	mov    0x9c(%eax),%eax
  803cbd:	89 03                	mov    %eax,(%ebx)
      break;
    }  /* switch (optname) */
    break;
#endif /* LWIP_UDP */
  } /* switch (level) */
  sys_sem_signal(sock->conn->op_completed);
  803cbf:	8b 02                	mov    (%edx),%eax
  803cc1:	8b 40 10             	mov    0x10(%eax),%eax
  803cc4:	89 04 24             	mov    %eax,(%esp)
  803cc7:	e8 1b 9f 00 00       	call   80dbe7 <sys_sem_signal>
}
  803ccc:	83 c4 14             	add    $0x14,%esp
  803ccf:	5b                   	pop    %ebx
  803cd0:	5d                   	pop    %ebp
  803cd1:	c3                   	ret    

00803cd2 <lwip_selscan>:
 * @param exceptset not yet implemented
 * @return number of sockets that had events (read+write)
 */
static int
lwip_selscan(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset)
{
  803cd2:	55                   	push   %ebp
  803cd3:	89 e5                	mov    %esp,%ebp
  803cd5:	57                   	push   %edi
  803cd6:	56                   	push   %esi
  803cd7:	53                   	push   %ebx
  803cd8:	83 ec 3c             	sub    $0x3c,%esp
  803cdb:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  803cde:	89 55 d0             	mov    %edx,-0x30(%ebp)
  803ce1:	89 4d cc             	mov    %ecx,-0x34(%ebp)
  int i, nready = 0;
  fd_set lreadset, lwriteset, lexceptset;
  struct lwip_socket *p_sock;
  
  FD_ZERO(&lreadset);
  803ce4:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  803ceb:	00 
  803cec:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  803cf3:	00 
  803cf4:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  803cf7:	89 04 24             	mov    %eax,(%esp)
  803cfa:	e8 87 d5 ff ff       	call   801286 <memset>
  FD_ZERO(&lwriteset);
  803cff:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  803d06:	00 
  803d07:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  803d0e:	00 
  803d0f:	8d 45 e0             	lea    -0x20(%ebp),%eax
  803d12:	89 04 24             	mov    %eax,(%esp)
  803d15:	e8 6c d5 ff ff       	call   801286 <memset>
  FD_ZERO(&lexceptset);
  803d1a:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  803d21:	00 
  803d22:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  803d29:	00 
  803d2a:	8d 45 dc             	lea    -0x24(%ebp),%eax
  803d2d:	89 04 24             	mov    %eax,(%esp)
  803d30:	e8 51 d5 ff ff       	call   801286 <memset>
  
  /* Go through each socket in each list to count number of sockets which
  currently match */
  for(i = 0; i < maxfdp1; i++) {
  803d35:	c7 45 c8 00 00 00 00 	movl   $0x0,-0x38(%ebp)
  803d3c:	bb 00 00 00 00       	mov    $0x0,%ebx
  803d41:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  803d45:	7e 7c                	jle    803dc3 <lwip_selscan+0xf1>
    if (FD_ISSET(i, readset)) {
  803d47:	8d 73 07             	lea    0x7(%ebx),%esi
  803d4a:	85 db                	test   %ebx,%ebx
  803d4c:	0f 49 f3             	cmovns %ebx,%esi
  803d4f:	c1 fe 03             	sar    $0x3,%esi
  803d52:	89 df                	mov    %ebx,%edi
  803d54:	83 e7 07             	and    $0x7,%edi
  803d57:	8b 55 d0             	mov    -0x30(%ebp),%edx
  803d5a:	0f b6 04 32          	movzbl (%edx,%esi,1),%eax
  803d5e:	0f a3 f8             	bt     %edi,%eax
  803d61:	73 29                	jae    803d8c <lwip_selscan+0xba>
      /* See if netconn of this socket is ready for read */
      p_sock = get_socket(i);
  803d63:	89 d8                	mov    %ebx,%eax
  803d65:	e8 36 f8 ff ff       	call   8035a0 <get_socket>
      if (p_sock && (p_sock->lastdata || p_sock->rcvevent)) {
  803d6a:	85 c0                	test   %eax,%eax
  803d6c:	74 1e                	je     803d8c <lwip_selscan+0xba>
  803d6e:	83 78 04 00          	cmpl   $0x0,0x4(%eax)
  803d72:	75 07                	jne    803d7b <lwip_selscan+0xa9>
  803d74:	66 83 78 0a 00       	cmpw   $0x0,0xa(%eax)
  803d79:	74 11                	je     803d8c <lwip_selscan+0xba>
        FD_SET(i, &lreadset);
  803d7b:	b8 01 00 00 00       	mov    $0x1,%eax
  803d80:	89 f9                	mov    %edi,%ecx
  803d82:	d3 e0                	shl    %cl,%eax
  803d84:	08 44 35 e4          	or     %al,-0x1c(%ebp,%esi,1)
        LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_selscan: fd=%d ready for reading\n", i));
        nready++;
  803d88:	83 45 c8 01          	addl   $0x1,-0x38(%ebp)
      }
    }
    if (FD_ISSET(i, writeset)) {
  803d8c:	8b 55 cc             	mov    -0x34(%ebp),%edx
  803d8f:	0f b6 04 32          	movzbl (%edx,%esi,1),%eax
  803d93:	0f a3 f8             	bt     %edi,%eax
  803d96:	73 23                	jae    803dbb <lwip_selscan+0xe9>
      /* See if netconn of this socket is ready for write */
      p_sock = get_socket(i);
  803d98:	89 d8                	mov    %ebx,%eax
  803d9a:	e8 01 f8 ff ff       	call   8035a0 <get_socket>
      if (p_sock && p_sock->sendevent) {
  803d9f:	85 c0                	test   %eax,%eax
  803da1:	74 18                	je     803dbb <lwip_selscan+0xe9>
  803da3:	66 83 78 0c 00       	cmpw   $0x0,0xc(%eax)
  803da8:	74 11                	je     803dbb <lwip_selscan+0xe9>
        FD_SET(i, &lwriteset);
  803daa:	b8 01 00 00 00       	mov    $0x1,%eax
  803daf:	89 f9                	mov    %edi,%ecx
  803db1:	d3 e0                	shl    %cl,%eax
  803db3:	08 44 35 e0          	or     %al,-0x20(%ebp,%esi,1)
        LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_selscan: fd=%d ready for writing\n", i));
        nready++;
  803db7:	83 45 c8 01          	addl   $0x1,-0x38(%ebp)
  FD_ZERO(&lwriteset);
  FD_ZERO(&lexceptset);
  
  /* Go through each socket in each list to count number of sockets which
  currently match */
  for(i = 0; i < maxfdp1; i++) {
  803dbb:	83 c3 01             	add    $0x1,%ebx
  803dbe:	39 5d d4             	cmp    %ebx,-0x2c(%ebp)
  803dc1:	7f 84                	jg     803d47 <lwip_selscan+0x75>
        LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_selscan: fd=%d ready for writing\n", i));
        nready++;
      }
    }
  }
  *readset = lreadset;
  803dc3:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  803dc6:	8b 55 d0             	mov    -0x30(%ebp),%edx
  803dc9:	89 02                	mov    %eax,(%edx)
  *writeset = lwriteset;
  803dcb:	8b 45 e0             	mov    -0x20(%ebp),%eax
  803dce:	8b 4d cc             	mov    -0x34(%ebp),%ecx
  803dd1:	89 01                	mov    %eax,(%ecx)
  FD_ZERO(exceptset);
  803dd3:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  803dda:	00 
  803ddb:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  803de2:	00 
  803de3:	8b 45 08             	mov    0x8(%ebp),%eax
  803de6:	89 04 24             	mov    %eax,(%esp)
  803de9:	e8 98 d4 ff ff       	call   801286 <memset>
  
  return nready;
}
  803dee:	8b 45 c8             	mov    -0x38(%ebp),%eax
  803df1:	83 c4 3c             	add    $0x3c,%esp
  803df4:	5b                   	pop    %ebx
  803df5:	5e                   	pop    %esi
  803df6:	5f                   	pop    %edi
  803df7:	5d                   	pop    %ebp
  803df8:	c3                   	ret    

00803df9 <lwip_getaddrname>:
  return lwip_close(s); /* XXX temporary hack until proper implementation */
}

static int
lwip_getaddrname(int s, struct sockaddr *name, socklen_t *namelen, u8_t local)
{
  803df9:	55                   	push   %ebp
  803dfa:	89 e5                	mov    %esp,%ebp
  803dfc:	83 ec 58             	sub    $0x58,%esp
  803dff:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  803e02:	89 75 f8             	mov    %esi,-0x8(%ebp)
  803e05:	89 7d fc             	mov    %edi,-0x4(%ebp)
  803e08:	89 d7                	mov    %edx,%edi
  803e0a:	89 ce                	mov    %ecx,%esi
  803e0c:	0f b6 55 08          	movzbl 0x8(%ebp),%edx
  803e10:	88 55 c7             	mov    %dl,-0x39(%ebp)
  struct lwip_socket *sock;
  struct sockaddr_in sin;
  struct ip_addr naddr;

  sock = get_socket(s);
  803e13:	e8 88 f7 ff ff       	call   8035a0 <get_socket>
  803e18:	89 c3                	mov    %eax,%ebx
  if (!sock)
  803e1a:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  803e1f:	85 db                	test   %ebx,%ebx
  803e21:	0f 84 8f 00 00 00    	je     803eb6 <lwip_getaddrname+0xbd>
    return -1;

  memset(&sin, 0, sizeof(sin));
  803e27:	c7 44 24 08 10 00 00 	movl   $0x10,0x8(%esp)
  803e2e:	00 
  803e2f:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  803e36:	00 
  803e37:	8d 45 d8             	lea    -0x28(%ebp),%eax
  803e3a:	89 04 24             	mov    %eax,(%esp)
  803e3d:	e8 44 d4 ff ff       	call   801286 <memset>
  sin.sin_len = sizeof(sin);
  803e42:	c6 45 d8 10          	movb   $0x10,-0x28(%ebp)
  sin.sin_family = AF_INET;
  803e46:	c6 45 d9 02          	movb   $0x2,-0x27(%ebp)

  /* get the IP address and port */
  netconn_getaddr(sock->conn, &naddr, &sin.sin_port, local);
  803e4a:	0f b6 45 c7          	movzbl -0x39(%ebp),%eax
  803e4e:	89 44 24 0c          	mov    %eax,0xc(%esp)
  803e52:	8d 45 da             	lea    -0x26(%ebp),%eax
  803e55:	89 44 24 08          	mov    %eax,0x8(%esp)
  803e59:	8d 45 d4             	lea    -0x2c(%ebp),%eax
  803e5c:	89 44 24 04          	mov    %eax,0x4(%esp)
  803e60:	8b 03                	mov    (%ebx),%eax
  803e62:	89 04 24             	mov    %eax,(%esp)
  803e65:	e8 39 aa 00 00       	call   80e8a3 <netconn_getaddr>

  LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getaddrname(%d, addr=", s));
  //ip_addr_debug_print(SOCKETS_DEBUG, &naddr);
  LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%d)\n", sin.sin_port));

  sin.sin_port = htons(sin.sin_port);
  803e6a:	0f b7 45 da          	movzwl -0x26(%ebp),%eax
  803e6e:	89 04 24             	mov    %eax,(%esp)
  803e71:	e8 7d 6e 00 00       	call   80acf3 <htons>
  803e76:	66 89 45 da          	mov    %ax,-0x26(%ebp)
  sin.sin_addr.s_addr = naddr.addr;
  803e7a:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  803e7d:	89 45 dc             	mov    %eax,-0x24(%ebp)

  if (*namelen > sizeof(sin))
  803e80:	83 3e 10             	cmpl   $0x10,(%esi)
  803e83:	76 06                	jbe    803e8b <lwip_getaddrname+0x92>
    *namelen = sizeof(sin);
  803e85:	c7 06 10 00 00 00    	movl   $0x10,(%esi)

  SMEMCPY(name, &sin, *namelen);
  803e8b:	8b 06                	mov    (%esi),%eax
  803e8d:	89 44 24 08          	mov    %eax,0x8(%esp)
  803e91:	8d 45 d8             	lea    -0x28(%ebp),%eax
  803e94:	89 44 24 04          	mov    %eax,0x4(%esp)
  803e98:	89 3c 24             	mov    %edi,(%esp)
  803e9b:	e8 c1 d4 ff ff       	call   801361 <memcpy>
  sock_set_errno(sock, 0);
  803ea0:	c7 43 10 00 00 00 00 	movl   $0x0,0x10(%ebx)
  803ea7:	c7 05 a0 f5 b3 00 00 	movl   $0x0,0xb3f5a0
  803eae:	00 00 00 
  803eb1:	b8 00 00 00 00       	mov    $0x0,%eax
  return 0;
}
  803eb6:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  803eb9:	8b 75 f8             	mov    -0x8(%ebp),%esi
  803ebc:	8b 7d fc             	mov    -0x4(%ebp),%edi
  803ebf:	89 ec                	mov    %ebp,%esp
  803ec1:	5d                   	pop    %ebp
  803ec2:	c3                   	ret    

00803ec3 <lwip_getsockname>:
  return lwip_getaddrname(s, name, namelen, 0);
}

int
lwip_getsockname(int s, struct sockaddr *name, socklen_t *namelen)
{
  803ec3:	55                   	push   %ebp
  803ec4:	89 e5                	mov    %esp,%ebp
  803ec6:	83 ec 18             	sub    $0x18,%esp
  return lwip_getaddrname(s, name, namelen, 1);
  803ec9:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  803ed0:	8b 4d 10             	mov    0x10(%ebp),%ecx
  803ed3:	8b 55 0c             	mov    0xc(%ebp),%edx
  803ed6:	8b 45 08             	mov    0x8(%ebp),%eax
  803ed9:	e8 1b ff ff ff       	call   803df9 <lwip_getaddrname>
}
  803ede:	c9                   	leave  
  803edf:	c3                   	ret    

00803ee0 <lwip_getpeername>:
  return 0;
}

int
lwip_getpeername(int s, struct sockaddr *name, socklen_t *namelen)
{
  803ee0:	55                   	push   %ebp
  803ee1:	89 e5                	mov    %esp,%ebp
  803ee3:	83 ec 18             	sub    $0x18,%esp
  return lwip_getaddrname(s, name, namelen, 0);
  803ee6:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  803eed:	8b 4d 10             	mov    0x10(%ebp),%ecx
  803ef0:	8b 55 0c             	mov    0xc(%ebp),%edx
  803ef3:	8b 45 08             	mov    0x8(%ebp),%eax
  803ef6:	e8 fe fe ff ff       	call   803df9 <lwip_getaddrname>
}
  803efb:	c9                   	leave  
  803efc:	c3                   	ret    

00803efd <alloc_socket>:
 * @param newconn the netconn for which to allocate a socket
 * @return the index of the new socket; -1 on error
 */
static int
alloc_socket(struct netconn *newconn)
{
  803efd:	55                   	push   %ebp
  803efe:	89 e5                	mov    %esp,%ebp
  803f00:	56                   	push   %esi
  803f01:	53                   	push   %ebx
  803f02:	83 ec 10             	sub    $0x10,%esp
  803f05:	89 c6                	mov    %eax,%esi
  int i;

  /* Protect socket array */
  sys_sem_wait(socksem);
  803f07:	a1 a4 96 81 00       	mov    0x8196a4,%eax
  803f0c:	89 04 24             	mov    %eax,(%esp)
  803f0f:	e8 b6 46 00 00       	call   8085ca <sys_sem_wait>

  /* allocate a new socket identifier */
  for (i = 0; i < NUM_SOCKETS; ++i) {
    if (!sockets[i].conn) {
  803f14:	b8 34 94 81 00       	mov    $0x819434,%eax
  803f19:	bb 01 00 00 00       	mov    $0x1,%ebx
  803f1e:	83 3d 20 94 81 00 00 	cmpl   $0x0,0x819420
  803f25:	75 04                	jne    803f2b <alloc_socket+0x2e>
  803f27:	b3 00                	mov    $0x0,%bl
  803f29:	eb 05                	jmp    803f30 <alloc_socket+0x33>
  803f2b:	83 38 00             	cmpl   $0x0,(%eax)
  803f2e:	75 50                	jne    803f80 <alloc_socket+0x83>
      sockets[i].conn       = newconn;
  803f30:	ba 20 94 81 00       	mov    $0x819420,%edx
  803f35:	8d 04 9d 00 00 00 00 	lea    0x0(,%ebx,4),%eax
  803f3c:	8d 0c 18             	lea    (%eax,%ebx,1),%ecx
  803f3f:	89 34 8a             	mov    %esi,(%edx,%ecx,4)
      sockets[i].lastdata   = NULL;
  803f42:	c7 44 8a 04 00 00 00 	movl   $0x0,0x4(%edx,%ecx,4)
  803f49:	00 
      sockets[i].lastoffset = 0;
  803f4a:	66 c7 44 8a 08 00 00 	movw   $0x0,0x8(%edx,%ecx,4)
      sockets[i].rcvevent   = 0;
  803f51:	66 c7 44 8a 0a 00 00 	movw   $0x0,0xa(%edx,%ecx,4)
      sockets[i].sendevent  = 1; /* TCP send buf is empty */
  803f58:	66 c7 44 8a 0c 01 00 	movw   $0x1,0xc(%edx,%ecx,4)
      sockets[i].flags      = 0;
  803f5f:	66 c7 44 8a 0e 00 00 	movw   $0x0,0xe(%edx,%ecx,4)
      sockets[i].err        = 0;
  803f66:	c7 04 8d 30 94 81 00 	movl   $0x0,0x819430(,%ecx,4)
  803f6d:	00 00 00 00 
      sys_sem_signal(socksem);
  803f71:	a1 a4 96 81 00       	mov    0x8196a4,%eax
  803f76:	89 04 24             	mov    %eax,(%esp)
  803f79:	e8 69 9c 00 00       	call   80dbe7 <sys_sem_signal>
      return i;
  803f7e:	eb 1d                	jmp    803f9d <alloc_socket+0xa0>

  /* Protect socket array */
  sys_sem_wait(socksem);

  /* allocate a new socket identifier */
  for (i = 0; i < NUM_SOCKETS; ++i) {
  803f80:	83 c3 01             	add    $0x1,%ebx
  803f83:	83 c0 14             	add    $0x14,%eax
  803f86:	83 fb 20             	cmp    $0x20,%ebx
  803f89:	75 a0                	jne    803f2b <alloc_socket+0x2e>
      sockets[i].err        = 0;
      sys_sem_signal(socksem);
      return i;
    }
  }
  sys_sem_signal(socksem);
  803f8b:	a1 a4 96 81 00       	mov    0x8196a4,%eax
  803f90:	89 04 24             	mov    %eax,(%esp)
  803f93:	e8 4f 9c 00 00       	call   80dbe7 <sys_sem_signal>
  803f98:	bb ff ff ff ff       	mov    $0xffffffff,%ebx
  return -1;
}
  803f9d:	89 d8                	mov    %ebx,%eax
  803f9f:	83 c4 10             	add    $0x10,%esp
  803fa2:	5b                   	pop    %ebx
  803fa3:	5e                   	pop    %esi
  803fa4:	5d                   	pop    %ebp
  803fa5:	c3                   	ret    

00803fa6 <event_callback>:
 * Callback registered in the netconn layer for each socket-netconn.
 * Processes recvevent (data available) and wakes up tasks waiting for select.
 */
static void
event_callback(struct netconn *conn, enum netconn_evt evt, u16_t len)
{
  803fa6:	55                   	push   %ebp
  803fa7:	89 e5                	mov    %esp,%ebp
  803fa9:	57                   	push   %edi
  803faa:	56                   	push   %esi
  803fab:	53                   	push   %ebx
  803fac:	83 ec 2c             	sub    $0x2c,%esp
  803faf:	8b 75 08             	mov    0x8(%ebp),%esi
  803fb2:	8b 7d 0c             	mov    0xc(%ebp),%edi
  struct lwip_select_cb *scb;

  LWIP_UNUSED_ARG(len);

  /* Get socket */
  if (conn) {
  803fb5:	85 f6                	test   %esi,%esi
  803fb7:	0f 84 73 01 00 00    	je     804130 <event_callback+0x18a>
    s = conn->socket;
  803fbd:	8b 5e 1c             	mov    0x1c(%esi),%ebx
    if (s < 0) {
  803fc0:	85 db                	test   %ebx,%ebx
  803fc2:	79 3d                	jns    804001 <event_callback+0x5b>
      /* Data comes in right away after an accept, even though
       * the server task might not have created a new socket yet.
       * Just count down (or up) if that's the case and we
       * will use the data later. Note that only receive events
       * can happen before the new socket is set up. */
      sys_sem_wait(socksem);
  803fc4:	a1 a4 96 81 00       	mov    0x8196a4,%eax
  803fc9:	89 04 24             	mov    %eax,(%esp)
  803fcc:	e8 f9 45 00 00       	call   8085ca <sys_sem_wait>
      if (conn->socket < 0) {
  803fd1:	8b 46 1c             	mov    0x1c(%esi),%eax
  803fd4:	85 c0                	test   %eax,%eax
  803fd6:	79 1c                	jns    803ff4 <event_callback+0x4e>
        if (evt == NETCONN_EVT_RCVPLUS) {
  803fd8:	85 ff                	test   %edi,%edi
  803fda:	75 06                	jne    803fe2 <event_callback+0x3c>
          conn->socket--;
  803fdc:	83 e8 01             	sub    $0x1,%eax
  803fdf:	89 46 1c             	mov    %eax,0x1c(%esi)
        }
        sys_sem_signal(socksem);
  803fe2:	a1 a4 96 81 00       	mov    0x8196a4,%eax
  803fe7:	89 04 24             	mov    %eax,(%esp)
  803fea:	e8 f8 9b 00 00       	call   80dbe7 <sys_sem_signal>
        return;
  803fef:	e9 3c 01 00 00       	jmp    804130 <event_callback+0x18a>
      }
      sys_sem_signal(socksem);
  803ff4:	a1 a4 96 81 00       	mov    0x8196a4,%eax
  803ff9:	89 04 24             	mov    %eax,(%esp)
  803ffc:	e8 e6 9b 00 00       	call   80dbe7 <sys_sem_signal>
    }

    sock = get_socket(s);
  804001:	89 d8                	mov    %ebx,%eax
  804003:	e8 98 f5 ff ff       	call   8035a0 <get_socket>
  804008:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    if (!sock) {
  80400b:	85 c0                	test   %eax,%eax
  80400d:	0f 84 1d 01 00 00    	je     804130 <event_callback+0x18a>
    }
  } else {
    return;
  }

  sys_sem_wait(selectsem);
  804013:	a1 a8 96 81 00       	mov    0x8196a8,%eax
  804018:	89 04 24             	mov    %eax,(%esp)
  80401b:	e8 aa 45 00 00       	call   8085ca <sys_sem_wait>
  /* Set event as required */
  switch (evt) {
  804020:	83 ff 01             	cmp    $0x1,%edi
  804023:	74 1f                	je     804044 <event_callback+0x9e>
  804025:	83 ff 01             	cmp    $0x1,%edi
  804028:	72 10                	jb     80403a <event_callback+0x94>
  80402a:	83 ff 02             	cmp    $0x2,%edi
  80402d:	8d 76 00             	lea    0x0(%esi),%esi
  804030:	74 1c                	je     80404e <event_callback+0xa8>
  804032:	83 ff 03             	cmp    $0x3,%edi
  804035:	75 2d                	jne    804064 <event_callback+0xbe>
  804037:	90                   	nop
  804038:	eb 1f                	jmp    804059 <event_callback+0xb3>
    case NETCONN_EVT_RCVPLUS:
      sock->rcvevent++;
  80403a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80403d:	66 83 40 0a 01       	addw   $0x1,0xa(%eax)
      break;
  804042:	eb 3c                	jmp    804080 <event_callback+0xda>
    case NETCONN_EVT_RCVMINUS:
      sock->rcvevent--;
  804044:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  804047:	66 83 68 0a 01       	subw   $0x1,0xa(%eax)
      break;
  80404c:	eb 32                	jmp    804080 <event_callback+0xda>
    case NETCONN_EVT_SENDPLUS:
      sock->sendevent = 1;
  80404e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  804051:	66 c7 40 0c 01 00    	movw   $0x1,0xc(%eax)
      break;
  804057:	eb 27                	jmp    804080 <event_callback+0xda>
    case NETCONN_EVT_SENDMINUS:
      sock->sendevent = 0;
  804059:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80405c:	66 c7 40 0c 00 00    	movw   $0x0,0xc(%eax)
      break;
  804062:	eb 1c                	jmp    804080 <event_callback+0xda>
    default:
      LWIP_ASSERT("unknown event", 0);
  804064:	c7 44 24 08 5d 2e 81 	movl   $0x812e5d,0x8(%esp)
  80406b:	00 
  80406c:	c7 44 24 04 17 04 00 	movl   $0x417,0x4(%esp)
  804073:	00 
  804074:	c7 04 24 46 2e 81 00 	movl   $0x812e46,(%esp)
  80407b:	e8 1c c9 ff ff       	call   80099c <_panic>
      break;
  }
  sys_sem_signal(selectsem);
  804080:	a1 a8 96 81 00       	mov    0x8196a8,%eax
  804085:	89 04 24             	mov    %eax,(%esp)
  804088:	e8 5a 9b 00 00       	call   80dbe7 <sys_sem_signal>
  while (1) {
    sys_sem_wait(selectsem);
    for (scb = select_cb_list; scb; scb = scb->next) {
      if (scb->sem_signalled == 0) {
        /* Test this select call for our socket */
        if (scb->readset && FD_ISSET(s, scb->readset))
  80408d:	8d 73 07             	lea    0x7(%ebx),%esi
  804090:	85 db                	test   %ebx,%ebx
  804092:	0f 49 f3             	cmovns %ebx,%esi
  804095:	c1 fe 03             	sar    $0x3,%esi
  804098:	89 d9                	mov    %ebx,%ecx
  80409a:	83 e1 07             	and    $0x7,%ecx
  80409d:	b8 01 00 00 00       	mov    $0x1,%eax
  8040a2:	89 c7                	mov    %eax,%edi
  8040a4:	d3 e7                	shl    %cl,%edi
     signalling for the select. This means we need to go through the list
     multiple times ONLY IF a select was actually waiting. We go through
     the list the number of waiting select calls + 1. This list is
     expected to be small. */
  while (1) {
    sys_sem_wait(selectsem);
  8040a6:	a1 a8 96 81 00       	mov    0x8196a8,%eax
  8040ab:	89 04 24             	mov    %eax,(%esp)
  8040ae:	e8 17 45 00 00       	call   8085ca <sys_sem_wait>
    for (scb = select_cb_list; scb; scb = scb->next) {
  8040b3:	8b 1d a0 96 81 00    	mov    0x8196a0,%ebx
  8040b9:	85 db                	test   %ebx,%ebx
  8040bb:	74 66                	je     804123 <event_callback+0x17d>
      if (scb->sem_signalled == 0) {
  8040bd:	83 7b 10 00          	cmpl   $0x0,0x10(%ebx)
  8040c1:	75 32                	jne    8040f5 <event_callback+0x14f>
        /* Test this select call for our socket */
        if (scb->readset && FD_ISSET(s, scb->readset))
  8040c3:	8b 43 04             	mov    0x4(%ebx),%eax
  8040c6:	85 c0                	test   %eax,%eax
  8040c8:	74 12                	je     8040dc <event_callback+0x136>
  8040ca:	0f b6 04 30          	movzbl (%eax,%esi,1),%eax
  8040ce:	85 f8                	test   %edi,%eax
  8040d0:	74 0a                	je     8040dc <event_callback+0x136>
          if (sock->rcvevent)
  8040d2:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  8040d5:	66 83 78 0a 00       	cmpw   $0x0,0xa(%eax)
  8040da:	75 21                	jne    8040fd <event_callback+0x157>
            break;
        if (scb->writeset && FD_ISSET(s, scb->writeset))
  8040dc:	8b 43 08             	mov    0x8(%ebx),%eax
  8040df:	85 c0                	test   %eax,%eax
  8040e1:	74 12                	je     8040f5 <event_callback+0x14f>
  8040e3:	0f b6 04 30          	movzbl (%eax,%esi,1),%eax
  8040e7:	85 f8                	test   %edi,%eax
  8040e9:	74 0a                	je     8040f5 <event_callback+0x14f>
          if (sock->sendevent)
  8040eb:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  8040ee:	66 83 78 0c 00       	cmpw   $0x0,0xc(%eax)
  8040f3:	75 08                	jne    8040fd <event_callback+0x157>
     multiple times ONLY IF a select was actually waiting. We go through
     the list the number of waiting select calls + 1. This list is
     expected to be small. */
  while (1) {
    sys_sem_wait(selectsem);
    for (scb = select_cb_list; scb; scb = scb->next) {
  8040f5:	8b 1b                	mov    (%ebx),%ebx
  8040f7:	85 db                	test   %ebx,%ebx
  8040f9:	75 c2                	jne    8040bd <event_callback+0x117>
  8040fb:	eb 26                	jmp    804123 <event_callback+0x17d>
        if (scb->writeset && FD_ISSET(s, scb->writeset))
          if (sock->sendevent)
            break;
      }
    }
    if (scb) {
  8040fd:	85 db                	test   %ebx,%ebx
  8040ff:	90                   	nop
  804100:	74 21                	je     804123 <event_callback+0x17d>
      scb->sem_signalled = 1;
  804102:	c7 43 10 01 00 00 00 	movl   $0x1,0x10(%ebx)
      sys_sem_signal(selectsem);
  804109:	a1 a8 96 81 00       	mov    0x8196a8,%eax
  80410e:	89 04 24             	mov    %eax,(%esp)
  804111:	e8 d1 9a 00 00       	call   80dbe7 <sys_sem_signal>
      sys_sem_signal(scb->sem);
  804116:	8b 43 14             	mov    0x14(%ebx),%eax
  804119:	89 04 24             	mov    %eax,(%esp)
  80411c:	e8 c6 9a 00 00       	call   80dbe7 <sys_sem_signal>
    } else {
      sys_sem_signal(selectsem);
      break;
    }
  }
  804121:	eb 83                	jmp    8040a6 <event_callback+0x100>
    if (scb) {
      scb->sem_signalled = 1;
      sys_sem_signal(selectsem);
      sys_sem_signal(scb->sem);
    } else {
      sys_sem_signal(selectsem);
  804123:	a1 a8 96 81 00       	mov    0x8196a8,%eax
  804128:	89 04 24             	mov    %eax,(%esp)
  80412b:	e8 b7 9a 00 00       	call   80dbe7 <sys_sem_signal>
      break;
    }
  }
}
  804130:	83 c4 2c             	add    $0x2c,%esp
  804133:	5b                   	pop    %ebx
  804134:	5e                   	pop    %esi
  804135:	5f                   	pop    %edi
  804136:	5d                   	pop    %ebp
  804137:	c3                   	ret    

00804138 <lwip_socket_init>:
 * Initialize this module. This function has to be called before any other
 * functions in this module!
 */
void
lwip_socket_init(void)
{
  804138:	55                   	push   %ebp
  804139:	89 e5                	mov    %esp,%ebp
  80413b:	83 ec 18             	sub    $0x18,%esp
  socksem   = sys_sem_new(1);
  80413e:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  804145:	e8 fb 98 00 00       	call   80da45 <sys_sem_new>
  80414a:	a3 a4 96 81 00       	mov    %eax,0x8196a4
  selectsem = sys_sem_new(1);
  80414f:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  804156:	e8 ea 98 00 00       	call   80da45 <sys_sem_new>
  80415b:	a3 a8 96 81 00       	mov    %eax,0x8196a8
}
  804160:	c9                   	leave  
  804161:	c3                   	ret    

00804162 <lwip_select>:
 * Processing exceptset is not yet implemented.
 */
int
lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset,
               struct timeval *timeout)
{
  804162:	55                   	push   %ebp
  804163:	89 e5                	mov    %esp,%ebp
  804165:	57                   	push   %edi
  804166:	56                   	push   %esi
  804167:	53                   	push   %ebx
  804168:	83 ec 5c             	sub    $0x5c,%esp
  80416b:	8b 7d 0c             	mov    0xc(%ebp),%edi
  80416e:	8b 75 10             	mov    0x10(%ebp),%esi
  804171:	8b 5d 14             	mov    0x14(%ebp),%ebx

  LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_select(%d, %p, %p, %p, tvsec=%ld tvusec=%ld)\n",
                  maxfdp1, (void *)readset, (void *) writeset, (void *) exceptset,
                  timeout ? timeout->tv_sec : -1L, timeout ? timeout->tv_usec : -1L));

  select_cb.next = 0;
  804174:	c7 45 c4 00 00 00 00 	movl   $0x0,-0x3c(%ebp)
  select_cb.readset = readset;
  80417b:	89 7d c8             	mov    %edi,-0x38(%ebp)
  select_cb.writeset = writeset;
  80417e:	89 75 cc             	mov    %esi,-0x34(%ebp)
  select_cb.exceptset = exceptset;
  804181:	89 5d d0             	mov    %ebx,-0x30(%ebp)
  select_cb.sem_signalled = 0;
  804184:	c7 45 d4 00 00 00 00 	movl   $0x0,-0x2c(%ebp)

  /* Protect ourselves searching through the list */
  sys_sem_wait(selectsem);
  80418b:	a1 a8 96 81 00       	mov    0x8196a8,%eax
  804190:	89 04 24             	mov    %eax,(%esp)
  804193:	e8 32 44 00 00       	call   8085ca <sys_sem_wait>

  if (readset)
  804198:	85 ff                	test   %edi,%edi
  80419a:	74 07                	je     8041a3 <lwip_select+0x41>
    lreadset = *readset;
  80419c:	8b 07                	mov    (%edi),%eax
  80419e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8041a1:	eb 1b                	jmp    8041be <lwip_select+0x5c>
  else
    FD_ZERO(&lreadset);
  8041a3:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  8041aa:	00 
  8041ab:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  8041b2:	00 
  8041b3:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  8041b6:	89 04 24             	mov    %eax,(%esp)
  8041b9:	e8 c8 d0 ff ff       	call   801286 <memset>
  if (writeset)
  8041be:	85 f6                	test   %esi,%esi
  8041c0:	74 07                	je     8041c9 <lwip_select+0x67>
    lwriteset = *writeset;
  8041c2:	8b 06                	mov    (%esi),%eax
  8041c4:	89 45 e0             	mov    %eax,-0x20(%ebp)
  8041c7:	eb 1b                	jmp    8041e4 <lwip_select+0x82>
  else
    FD_ZERO(&lwriteset);
  8041c9:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  8041d0:	00 
  8041d1:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  8041d8:	00 
  8041d9:	8d 45 e0             	lea    -0x20(%ebp),%eax
  8041dc:	89 04 24             	mov    %eax,(%esp)
  8041df:	e8 a2 d0 ff ff       	call   801286 <memset>
  if (exceptset)
  8041e4:	85 db                	test   %ebx,%ebx
  8041e6:	74 07                	je     8041ef <lwip_select+0x8d>
    lexceptset = *exceptset;
  8041e8:	8b 03                	mov    (%ebx),%eax
  8041ea:	89 45 dc             	mov    %eax,-0x24(%ebp)
  8041ed:	eb 1b                	jmp    80420a <lwip_select+0xa8>
  else
    FD_ZERO(&lexceptset);
  8041ef:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  8041f6:	00 
  8041f7:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  8041fe:	00 
  8041ff:	8d 45 dc             	lea    -0x24(%ebp),%eax
  804202:	89 04 24             	mov    %eax,(%esp)
  804205:	e8 7c d0 ff ff       	call   801286 <memset>

  /* Go through each socket in each list to count number of sockets which
     currently match */
  nready = lwip_selscan(maxfdp1, &lreadset, &lwriteset, &lexceptset);
  80420a:	8d 4d e0             	lea    -0x20(%ebp),%ecx
  80420d:	8d 55 e4             	lea    -0x1c(%ebp),%edx
  804210:	8d 45 dc             	lea    -0x24(%ebp),%eax
  804213:	89 04 24             	mov    %eax,(%esp)
  804216:	8b 45 08             	mov    0x8(%ebp),%eax
  804219:	e8 b4 fa ff ff       	call   803cd2 <lwip_selscan>
  80421e:	89 45 b0             	mov    %eax,-0x50(%ebp)

  /* If we don't have any current events, then suspend if we are supposed to */
  if (!nready) {
  804221:	85 c0                	test   %eax,%eax
  804223:	0f 85 28 02 00 00    	jne    804451 <lwip_select+0x2ef>
    if (timeout && timeout->tv_sec == 0 && timeout->tv_usec == 0) {
  804229:	83 7d 18 00          	cmpl   $0x0,0x18(%ebp)
  80422d:	0f 84 86 00 00 00    	je     8042b9 <lwip_select+0x157>
  804233:	8b 45 18             	mov    0x18(%ebp),%eax
  804236:	83 38 00             	cmpl   $0x0,(%eax)
  804239:	0f 85 4f 02 00 00    	jne    80448e <lwip_select+0x32c>
  80423f:	83 78 04 00          	cmpl   $0x0,0x4(%eax)
  804243:	0f 85 45 02 00 00    	jne    80448e <lwip_select+0x32c>
      sys_sem_signal(selectsem);
  804249:	a1 a8 96 81 00       	mov    0x8196a8,%eax
  80424e:	89 04 24             	mov    %eax,(%esp)
  804251:	e8 91 99 00 00       	call   80dbe7 <sys_sem_signal>
      if (readset)
  804256:	85 ff                	test   %edi,%edi
  804258:	74 18                	je     804272 <lwip_select+0x110>
        FD_ZERO(readset);
  80425a:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  804261:	00 
  804262:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  804269:	00 
  80426a:	89 3c 24             	mov    %edi,(%esp)
  80426d:	e8 14 d0 ff ff       	call   801286 <memset>
      if (writeset)
  804272:	85 f6                	test   %esi,%esi
  804274:	74 18                	je     80428e <lwip_select+0x12c>
        FD_ZERO(writeset);
  804276:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  80427d:	00 
  80427e:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  804285:	00 
  804286:	89 34 24             	mov    %esi,(%esp)
  804289:	e8 f8 cf ff ff       	call   801286 <memset>
      if (exceptset)
  80428e:	85 db                	test   %ebx,%ebx
  804290:	74 18                	je     8042aa <lwip_select+0x148>
        FD_ZERO(exceptset);
  804292:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  804299:	00 
  80429a:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  8042a1:	00 
  8042a2:	89 1c 24             	mov    %ebx,(%esp)
  8042a5:	e8 dc cf ff ff       	call   801286 <memset>
  
      LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_select: no timeout, returning 0\n"));
      set_errno(0);
  8042aa:	c7 05 a0 f5 b3 00 00 	movl   $0x0,0xb3f5a0
  8042b1:	00 00 00 
  
      return 0;
  8042b4:	e9 ca 01 00 00       	jmp    804483 <lwip_select+0x321>
    /* add our semaphore to list */
    /* We don't actually need any dynamic memory. Our entry on the
     * list is only valid while we are in this function, so it's ok
     * to use local variables */
    
    select_cb.sem = sys_sem_new(0);
  8042b9:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  8042c0:	e8 80 97 00 00       	call   80da45 <sys_sem_new>
  8042c5:	89 45 d8             	mov    %eax,-0x28(%ebp)
    /* Note that we are still protected */
    /* Put this select_cb on top of list */
    select_cb.next = select_cb_list;
  8042c8:	a1 a0 96 81 00       	mov    0x8196a0,%eax
  8042cd:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    select_cb_list = &select_cb;
  8042d0:	8d 45 c4             	lea    -0x3c(%ebp),%eax
  8042d3:	a3 a0 96 81 00       	mov    %eax,0x8196a0
    
    /* Now we can safely unprotect */
    sys_sem_signal(selectsem);
  8042d8:	a1 a8 96 81 00       	mov    0x8196a8,%eax
  8042dd:	89 04 24             	mov    %eax,(%esp)
  8042e0:	e8 02 99 00 00       	call   80dbe7 <sys_sem_signal>
  8042e5:	ba 00 00 00 00       	mov    $0x0,%edx
      msectimeout =  ((timeout->tv_sec * 1000) + ((timeout->tv_usec + 500)/1000));
      if(msectimeout == 0)
        msectimeout = 1;
    }
    
    i = sys_sem_wait_timeout(select_cb.sem, msectimeout);
  8042ea:	89 54 24 04          	mov    %edx,0x4(%esp)
  8042ee:	8b 45 d8             	mov    -0x28(%ebp),%eax
  8042f1:	89 04 24             	mov    %eax,(%esp)
  8042f4:	e8 60 43 00 00       	call   808659 <sys_sem_wait_timeout>
  8042f9:	89 45 b4             	mov    %eax,-0x4c(%ebp)
    
    /* Take us off the list */
    sys_sem_wait(selectsem);
  8042fc:	a1 a8 96 81 00       	mov    0x8196a8,%eax
  804301:	89 04 24             	mov    %eax,(%esp)
  804304:	e8 c1 42 00 00       	call   8085ca <sys_sem_wait>
    if (select_cb_list == &select_cb)
  804309:	a1 a0 96 81 00       	mov    0x8196a0,%eax
  80430e:	8d 55 c4             	lea    -0x3c(%ebp),%edx
  804311:	39 c2                	cmp    %eax,%edx
  804313:	75 1f                	jne    804334 <lwip_select+0x1d2>
      select_cb_list = select_cb.next;
  804315:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  804318:	a3 a0 96 81 00       	mov    %eax,0x8196a0
  80431d:	eb 26                	jmp    804345 <lwip_select+0x1e3>
    else
      for (p_selcb = select_cb_list; p_selcb; p_selcb = p_selcb->next) {
        if (p_selcb->next == &select_cb) {
  80431f:	8b 10                	mov    (%eax),%edx
  804321:	39 d1                	cmp    %edx,%ecx
  804323:	74 08                	je     80432d <lwip_select+0x1cb>
  804325:	89 d0                	mov    %edx,%eax
    /* Take us off the list */
    sys_sem_wait(selectsem);
    if (select_cb_list == &select_cb)
      select_cb_list = select_cb.next;
    else
      for (p_selcb = select_cb_list; p_selcb; p_selcb = p_selcb->next) {
  804327:	85 c0                	test   %eax,%eax
  804329:	75 f4                	jne    80431f <lwip_select+0x1bd>
  80432b:	eb 18                	jmp    804345 <lwip_select+0x1e3>
        if (p_selcb->next == &select_cb) {
          p_selcb->next = select_cb.next;
  80432d:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  804330:	89 10                	mov    %edx,(%eax)
          break;
  804332:	eb 11                	jmp    804345 <lwip_select+0x1e3>
    /* Take us off the list */
    sys_sem_wait(selectsem);
    if (select_cb_list == &select_cb)
      select_cb_list = select_cb.next;
    else
      for (p_selcb = select_cb_list; p_selcb; p_selcb = p_selcb->next) {
  804334:	85 c0                	test   %eax,%eax
  804336:	74 0d                	je     804345 <lwip_select+0x1e3>
        if (p_selcb->next == &select_cb) {
  804338:	8b 10                	mov    (%eax),%edx
  80433a:	8d 4d c4             	lea    -0x3c(%ebp),%ecx
  80433d:	39 d1                	cmp    %edx,%ecx
  80433f:	74 ec                	je     80432d <lwip_select+0x1cb>
  804341:	89 d0                	mov    %edx,%eax
  804343:	eb e2                	jmp    804327 <lwip_select+0x1c5>
          p_selcb->next = select_cb.next;
          break;
        }
      }
    
    sys_sem_signal(selectsem);
  804345:	a1 a8 96 81 00       	mov    0x8196a8,%eax
  80434a:	89 04 24             	mov    %eax,(%esp)
  80434d:	e8 95 98 00 00       	call   80dbe7 <sys_sem_signal>
    
    sys_sem_free(select_cb.sem);
  804352:	8b 45 d8             	mov    -0x28(%ebp),%eax
  804355:	89 04 24             	mov    %eax,(%esp)
  804358:	e8 26 92 00 00       	call   80d583 <sys_sem_free>
    if (i == 0)  {
  80435d:	83 7d b4 00          	cmpl   $0x0,-0x4c(%ebp)
  804361:	75 63                	jne    8043c6 <lwip_select+0x264>
      /* Timeout */
      if (readset)
  804363:	85 ff                	test   %edi,%edi
  804365:	74 18                	je     80437f <lwip_select+0x21d>
        FD_ZERO(readset);
  804367:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  80436e:	00 
  80436f:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  804376:	00 
  804377:	89 3c 24             	mov    %edi,(%esp)
  80437a:	e8 07 cf ff ff       	call   801286 <memset>
      if (writeset)
  80437f:	85 f6                	test   %esi,%esi
  804381:	74 18                	je     80439b <lwip_select+0x239>
        FD_ZERO(writeset);
  804383:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  80438a:	00 
  80438b:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  804392:	00 
  804393:	89 34 24             	mov    %esi,(%esp)
  804396:	e8 eb ce ff ff       	call   801286 <memset>
      if (exceptset)
  80439b:	85 db                	test   %ebx,%ebx
  80439d:	74 18                	je     8043b7 <lwip_select+0x255>
        FD_ZERO(exceptset);
  80439f:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  8043a6:	00 
  8043a7:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  8043ae:	00 
  8043af:	89 1c 24             	mov    %ebx,(%esp)
  8043b2:	e8 cf ce ff ff       	call   801286 <memset>
  
      LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_select: timeout expired\n"));
      set_errno(0);
  8043b7:	c7 05 a0 f5 b3 00 00 	movl   $0x0,0xb3f5a0
  8043be:	00 00 00 
  
      return 0;
  8043c1:	e9 bd 00 00 00       	jmp    804483 <lwip_select+0x321>
    }
    
    if (readset)
  8043c6:	85 ff                	test   %edi,%edi
  8043c8:	74 07                	je     8043d1 <lwip_select+0x26f>
      lreadset = *readset;
  8043ca:	8b 07                	mov    (%edi),%eax
  8043cc:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8043cf:	eb 1b                	jmp    8043ec <lwip_select+0x28a>
    else
      FD_ZERO(&lreadset);
  8043d1:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  8043d8:	00 
  8043d9:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  8043e0:	00 
  8043e1:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  8043e4:	89 04 24             	mov    %eax,(%esp)
  8043e7:	e8 9a ce ff ff       	call   801286 <memset>
    if (writeset)
  8043ec:	85 f6                	test   %esi,%esi
  8043ee:	74 07                	je     8043f7 <lwip_select+0x295>
      lwriteset = *writeset;
  8043f0:	8b 06                	mov    (%esi),%eax
  8043f2:	89 45 e0             	mov    %eax,-0x20(%ebp)
  8043f5:	eb 1b                	jmp    804412 <lwip_select+0x2b0>
    else
      FD_ZERO(&lwriteset);
  8043f7:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  8043fe:	00 
  8043ff:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  804406:	00 
  804407:	8d 45 e0             	lea    -0x20(%ebp),%eax
  80440a:	89 04 24             	mov    %eax,(%esp)
  80440d:	e8 74 ce ff ff       	call   801286 <memset>
    if (exceptset)
  804412:	85 db                	test   %ebx,%ebx
  804414:	74 07                	je     80441d <lwip_select+0x2bb>
      lexceptset = *exceptset;
  804416:	8b 03                	mov    (%ebx),%eax
  804418:	89 45 dc             	mov    %eax,-0x24(%ebp)
  80441b:	eb 1b                	jmp    804438 <lwip_select+0x2d6>
    else
      FD_ZERO(&lexceptset);
  80441d:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  804424:	00 
  804425:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80442c:	00 
  80442d:	8d 45 dc             	lea    -0x24(%ebp),%eax
  804430:	89 04 24             	mov    %eax,(%esp)
  804433:	e8 4e ce ff ff       	call   801286 <memset>
    
    /* See what's set */
    nready = lwip_selscan(maxfdp1, &lreadset, &lwriteset, &lexceptset);
  804438:	8d 4d e0             	lea    -0x20(%ebp),%ecx
  80443b:	8d 55 e4             	lea    -0x1c(%ebp),%edx
  80443e:	8d 45 dc             	lea    -0x24(%ebp),%eax
  804441:	89 04 24             	mov    %eax,(%esp)
  804444:	8b 45 08             	mov    0x8(%ebp),%eax
  804447:	e8 86 f8 ff ff       	call   803cd2 <lwip_selscan>
  80444c:	89 45 b0             	mov    %eax,-0x50(%ebp)
  80444f:	eb 0d                	jmp    80445e <lwip_select+0x2fc>
  } else
    sys_sem_signal(selectsem);
  804451:	a1 a8 96 81 00       	mov    0x8196a8,%eax
  804456:	89 04 24             	mov    %eax,(%esp)
  804459:	e8 89 97 00 00       	call   80dbe7 <sys_sem_signal>
  
  if (readset)
  80445e:	85 ff                	test   %edi,%edi
  804460:	74 05                	je     804467 <lwip_select+0x305>
    *readset = lreadset;
  804462:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  804465:	89 07                	mov    %eax,(%edi)
  if (writeset)
  804467:	85 f6                	test   %esi,%esi
  804469:	74 05                	je     804470 <lwip_select+0x30e>
    *writeset = lwriteset;
  80446b:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80446e:	89 06                	mov    %eax,(%esi)
  if (exceptset)
  804470:	85 db                	test   %ebx,%ebx
  804472:	74 05                	je     804479 <lwip_select+0x317>
    *exceptset = lexceptset;
  804474:	8b 45 dc             	mov    -0x24(%ebp),%eax
  804477:	89 03                	mov    %eax,(%ebx)
  
  LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_select: nready=%d\n", nready));
  set_errno(0);
  804479:	c7 05 a0 f5 b3 00 00 	movl   $0x0,0xb3f5a0
  804480:	00 00 00 
  
  return nready;
}
  804483:	8b 45 b0             	mov    -0x50(%ebp),%eax
  804486:	83 c4 5c             	add    $0x5c,%esp
  804489:	5b                   	pop    %ebx
  80448a:	5e                   	pop    %esi
  80448b:	5f                   	pop    %edi
  80448c:	5d                   	pop    %ebp
  80448d:	c3                   	ret    
    /* add our semaphore to list */
    /* We don't actually need any dynamic memory. Our entry on the
     * list is only valid while we are in this function, so it's ok
     * to use local variables */
    
    select_cb.sem = sys_sem_new(0);
  80448e:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  804495:	e8 ab 95 00 00       	call   80da45 <sys_sem_new>
  80449a:	89 45 d8             	mov    %eax,-0x28(%ebp)
    /* Note that we are still protected */
    /* Put this select_cb on top of list */
    select_cb.next = select_cb_list;
  80449d:	a1 a0 96 81 00       	mov    0x8196a0,%eax
  8044a2:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    select_cb_list = &select_cb;
  8044a5:	8d 45 c4             	lea    -0x3c(%ebp),%eax
  8044a8:	a3 a0 96 81 00       	mov    %eax,0x8196a0
    
    /* Now we can safely unprotect */
    sys_sem_signal(selectsem);
  8044ad:	a1 a8 96 81 00       	mov    0x8196a8,%eax
  8044b2:	89 04 24             	mov    %eax,(%esp)
  8044b5:	e8 2d 97 00 00       	call   80dbe7 <sys_sem_signal>
    /* Now just wait to be woken */
    if (timeout == 0)
      /* Wait forever */
      msectimeout = 0;
    else {
      msectimeout =  ((timeout->tv_sec * 1000) + ((timeout->tv_usec + 500)/1000));
  8044ba:	8b 45 18             	mov    0x18(%ebp),%eax
  8044bd:	8b 48 04             	mov    0x4(%eax),%ecx
  8044c0:	81 c1 f4 01 00 00    	add    $0x1f4,%ecx
  8044c6:	ba d3 4d 62 10       	mov    $0x10624dd3,%edx
  8044cb:	89 c8                	mov    %ecx,%eax
  8044cd:	f7 ea                	imul   %edx
  8044cf:	c1 fa 06             	sar    $0x6,%edx
  8044d2:	c1 f9 1f             	sar    $0x1f,%ecx
  8044d5:	29 ca                	sub    %ecx,%edx
  8044d7:	8b 45 18             	mov    0x18(%ebp),%eax
  8044da:	69 08 e8 03 00 00    	imul   $0x3e8,(%eax),%ecx
      if(msectimeout == 0)
  8044e0:	01 ca                	add    %ecx,%edx
  8044e2:	b8 01 00 00 00       	mov    $0x1,%eax
  8044e7:	0f 44 d0             	cmove  %eax,%edx
  8044ea:	e9 fb fd ff ff       	jmp    8042ea <lwip_select+0x188>

008044ef <lwip_socket>:
  return (err==ERR_OK?size:-1);
}

int
lwip_socket(int domain, int type, int protocol)
{
  8044ef:	55                   	push   %ebp
  8044f0:	89 e5                	mov    %esp,%ebp
  8044f2:	56                   	push   %esi
  8044f3:	53                   	push   %ebx
  8044f4:	83 ec 10             	sub    $0x10,%esp
  8044f7:	8b 45 0c             	mov    0xc(%ebp),%eax
  8044fa:	8b 55 10             	mov    0x10(%ebp),%edx
  int i;

  LWIP_UNUSED_ARG(domain);

  /* create a netconn */
  switch (type) {
  8044fd:	83 f8 02             	cmp    $0x2,%eax
  804500:	74 2f                	je     804531 <lwip_socket+0x42>
  804502:	83 f8 03             	cmp    $0x3,%eax
  804505:	74 0b                	je     804512 <lwip_socket+0x23>
  804507:	83 f8 01             	cmp    $0x1,%eax
  80450a:	75 70                	jne    80457c <lwip_socket+0x8d>
  80450c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  804510:	eb 4a                	jmp    80455c <lwip_socket+0x6d>
  case SOCK_RAW:
    conn = netconn_new_with_proto_and_callback(NETCONN_RAW, (u8_t)protocol, event_callback);
  804512:	c7 44 24 08 a6 3f 80 	movl   $0x803fa6,0x8(%esp)
  804519:	00 
  80451a:	0f b6 d2             	movzbl %dl,%edx
  80451d:	89 54 24 04          	mov    %edx,0x4(%esp)
  804521:	c7 04 24 40 00 00 00 	movl   $0x40,(%esp)
  804528:	e8 8b a6 00 00       	call   80ebb8 <netconn_new_with_proto_and_callback>
  80452d:	89 c6                	mov    %eax,%esi
    LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_socket(%s, SOCK_RAW, %d) = ",
                                 domain == PF_INET ? "PF_INET" : "UNKNOWN", protocol));
    break;
  80452f:	eb 5c                	jmp    80458d <lwip_socket+0x9e>
  case SOCK_DGRAM:
    conn = netconn_new_with_callback( (protocol == IPPROTO_UDPLITE) ?
  804531:	81 fa 88 00 00 00    	cmp    $0x88,%edx
  804537:	0f 94 c0             	sete   %al
  80453a:	0f b6 c0             	movzbl %al,%eax
  80453d:	83 c0 20             	add    $0x20,%eax
  804540:	c7 44 24 08 a6 3f 80 	movl   $0x803fa6,0x8(%esp)
  804547:	00 
  804548:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80454f:	00 
  804550:	89 04 24             	mov    %eax,(%esp)
  804553:	e8 60 a6 00 00       	call   80ebb8 <netconn_new_with_proto_and_callback>
  804558:	89 c6                	mov    %eax,%esi
                 NETCONN_UDPLITE : NETCONN_UDP, event_callback);
    LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_socket(%s, SOCK_DGRAM, %d) = ",
                                 domain == PF_INET ? "PF_INET" : "UNKNOWN", protocol));
    break;
  80455a:	eb 31                	jmp    80458d <lwip_socket+0x9e>
  case SOCK_STREAM:
    conn = netconn_new_with_callback(NETCONN_TCP, event_callback);
  80455c:	c7 44 24 08 a6 3f 80 	movl   $0x803fa6,0x8(%esp)
  804563:	00 
  804564:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80456b:	00 
  80456c:	c7 04 24 10 00 00 00 	movl   $0x10,(%esp)
  804573:	e8 40 a6 00 00       	call   80ebb8 <netconn_new_with_proto_and_callback>
  804578:	89 c6                	mov    %eax,%esi
    LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_socket(%s, SOCK_STREAM, %d) = ",
                                 domain == PF_INET ? "PF_INET" : "UNKNOWN", protocol));
    break;
  80457a:	eb 11                	jmp    80458d <lwip_socket+0x9e>
  default:
    LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_socket(%d, %d/UNKNOWN, %d) = -1\n",
                                 domain, type, protocol));
    set_errno(EINVAL);
  80457c:	c7 05 a0 f5 b3 00 16 	movl   $0x16,0xb3f5a0
  804583:	00 00 00 
  804586:	bb ff ff ff ff       	mov    $0xffffffff,%ebx
    return -1;
  80458b:	eb 44                	jmp    8045d1 <lwip_socket+0xe2>
  }

  if (!conn) {
  80458d:	85 f6                	test   %esi,%esi
  80458f:	75 11                	jne    8045a2 <lwip_socket+0xb3>
    LWIP_DEBUGF(SOCKETS_DEBUG, ("-1 / ENOBUFS (could not create netconn)\n"));
    set_errno(ENOBUFS);
  804591:	c7 05 a0 f5 b3 00 69 	movl   $0x69,0xb3f5a0
  804598:	00 00 00 
  80459b:	bb ff ff ff ff       	mov    $0xffffffff,%ebx
    return -1;
  8045a0:	eb 2f                	jmp    8045d1 <lwip_socket+0xe2>
  }

  i = alloc_socket(conn);
  8045a2:	89 f0                	mov    %esi,%eax
  8045a4:	e8 54 f9 ff ff       	call   803efd <alloc_socket>
  8045a9:	89 c3                	mov    %eax,%ebx

  if (i == -1) {
  8045ab:	83 f8 ff             	cmp    $0xffffffff,%eax
  8045ae:	75 14                	jne    8045c4 <lwip_socket+0xd5>
    netconn_delete(conn);
  8045b0:	89 34 24             	mov    %esi,(%esp)
  8045b3:	e8 c3 a5 00 00       	call   80eb7b <netconn_delete>
    set_errno(ENFILE);
  8045b8:	c7 05 a0 f5 b3 00 17 	movl   $0x17,0xb3f5a0
  8045bf:	00 00 00 
    return -1;
  8045c2:	eb 0d                	jmp    8045d1 <lwip_socket+0xe2>
  }
  conn->socket = i;
  8045c4:	89 46 1c             	mov    %eax,0x1c(%esi)
  LWIP_DEBUGF(SOCKETS_DEBUG, ("%d\n", i));
  set_errno(0);
  8045c7:	c7 05 a0 f5 b3 00 00 	movl   $0x0,0xb3f5a0
  8045ce:	00 00 00 
  return i;
}
  8045d1:	89 d8                	mov    %ebx,%eax
  8045d3:	83 c4 10             	add    $0x10,%esp
  8045d6:	5b                   	pop    %ebx
  8045d7:	5e                   	pop    %esi
  8045d8:	5d                   	pop    %ebp
  8045d9:	c3                   	ret    

008045da <lwip_send>:
  return lwip_recvfrom(s, mem, len, flags, NULL, NULL);
}

int
lwip_send(int s, const void *data, int size, unsigned int flags)
{
  8045da:	55                   	push   %ebp
  8045db:	89 e5                	mov    %esp,%ebp
  8045dd:	83 ec 38             	sub    $0x38,%esp
  8045e0:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  8045e3:	89 75 f8             	mov    %esi,-0x8(%ebp)
  8045e6:	89 7d fc             	mov    %edi,-0x4(%ebp)
  8045e9:	8b 7d 08             	mov    0x8(%ebp),%edi
  8045ec:	8b 75 10             	mov    0x10(%ebp),%esi
  err_t err;

  LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_send(%d, data=%p, size=%d, flags=0x%x)\n",
                              s, data, size, flags));

  sock = get_socket(s);
  8045ef:	89 f8                	mov    %edi,%eax
  8045f1:	e8 aa ef ff ff       	call   8035a0 <get_socket>
  8045f6:	89 c3                	mov    %eax,%ebx
  if (!sock)
  8045f8:	85 c0                	test   %eax,%eax
  8045fa:	0f 84 80 00 00 00    	je     804680 <lwip_send+0xa6>
    return -1;

  if (sock->conn->type!=NETCONN_TCP) {
  804600:	8b 00                	mov    (%eax),%eax
  804602:	83 38 10             	cmpl   $0x10,(%eax)
  804605:	74 2e                	je     804635 <lwip_send+0x5b>
#if (LWIP_UDP || LWIP_RAW)
    return lwip_sendto(s, data, size, flags, NULL, 0);
  804607:	c7 44 24 14 00 00 00 	movl   $0x0,0x14(%esp)
  80460e:	00 
  80460f:	c7 44 24 10 00 00 00 	movl   $0x0,0x10(%esp)
  804616:	00 
  804617:	8b 45 14             	mov    0x14(%ebp),%eax
  80461a:	89 44 24 0c          	mov    %eax,0xc(%esp)
  80461e:	89 74 24 08          	mov    %esi,0x8(%esp)
  804622:	8b 55 0c             	mov    0xc(%ebp),%edx
  804625:	89 54 24 04          	mov    %edx,0x4(%esp)
  804629:	89 3c 24             	mov    %edi,(%esp)
  80462c:	e8 8c 00 00 00       	call   8046bd <lwip_sendto>
  804631:	89 c6                	mov    %eax,%esi
  804633:	eb 50                	jmp    804685 <lwip_send+0xab>
    sock_set_errno(sock, err_to_errno(ERR_ARG));
    return -1;
#endif /* (LWIP_UDP || LWIP_RAW) */
  }

  err = netconn_write(sock->conn, data, size, NETCONN_COPY | ((flags & MSG_MORE)?NETCONN_MORE:0));
  804635:	8b 55 14             	mov    0x14(%ebp),%edx
  804638:	83 e2 10             	and    $0x10,%edx
  80463b:	83 fa 01             	cmp    $0x1,%edx
  80463e:	19 d2                	sbb    %edx,%edx
  804640:	83 e2 fe             	and    $0xfffffffe,%edx
  804643:	83 c2 03             	add    $0x3,%edx
  804646:	89 54 24 0c          	mov    %edx,0xc(%esp)
  80464a:	89 74 24 08          	mov    %esi,0x8(%esp)
  80464e:	8b 55 0c             	mov    0xc(%ebp),%edx
  804651:	89 54 24 04          	mov    %edx,0x4(%esp)
  804655:	89 04 24             	mov    %eax,(%esp)
  804658:	e8 09 a0 00 00       	call   80e666 <netconn_write>

  LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_send(%d) err=%d size=%d\n", s, err, size));
  sock_set_errno(sock, err_to_errno(err));
  80465d:	0f be c8             	movsbl %al,%ecx
  804660:	f7 d9                	neg    %ecx
  804662:	ba 05 00 00 00       	mov    $0x5,%edx
  804667:	83 f9 0e             	cmp    $0xe,%ecx
  80466a:	77 07                	ja     804673 <lwip_send+0x99>
  80466c:	8b 14 8d 20 2f 81 00 	mov    0x812f20(,%ecx,4),%edx
  804673:	89 53 10             	mov    %edx,0x10(%ebx)
  804676:	89 15 a0 f5 b3 00    	mov    %edx,0xb3f5a0
  return (err==ERR_OK?size:-1);
  80467c:	84 c0                	test   %al,%al
  80467e:	74 05                	je     804685 <lwip_send+0xab>
  804680:	be ff ff ff ff       	mov    $0xffffffff,%esi
}
  804685:	89 f0                	mov    %esi,%eax
  804687:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  80468a:	8b 75 f8             	mov    -0x8(%ebp),%esi
  80468d:	8b 7d fc             	mov    -0x4(%ebp),%edi
  804690:	89 ec                	mov    %ebp,%esp
  804692:	5d                   	pop    %ebp
  804693:	c3                   	ret    

00804694 <lwip_write>:
  return i;
}

int
lwip_write(int s, const void *data, int size)
{
  804694:	55                   	push   %ebp
  804695:	89 e5                	mov    %esp,%ebp
  804697:	83 ec 18             	sub    $0x18,%esp
  return lwip_send(s, data, size, 0);
  80469a:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  8046a1:	00 
  8046a2:	8b 45 10             	mov    0x10(%ebp),%eax
  8046a5:	89 44 24 08          	mov    %eax,0x8(%esp)
  8046a9:	8b 45 0c             	mov    0xc(%ebp),%eax
  8046ac:	89 44 24 04          	mov    %eax,0x4(%esp)
  8046b0:	8b 45 08             	mov    0x8(%ebp),%eax
  8046b3:	89 04 24             	mov    %eax,(%esp)
  8046b6:	e8 1f ff ff ff       	call   8045da <lwip_send>
}
  8046bb:	c9                   	leave  
  8046bc:	c3                   	ret    

008046bd <lwip_sendto>:
}

int
lwip_sendto(int s, const void *data, int size, unsigned int flags,
       struct sockaddr *to, socklen_t tolen)
{
  8046bd:	55                   	push   %ebp
  8046be:	89 e5                	mov    %esp,%ebp
  8046c0:	57                   	push   %edi
  8046c1:	56                   	push   %esi
  8046c2:	53                   	push   %ebx
  8046c3:	83 ec 3c             	sub    $0x3c,%esp
  8046c6:	8b 7d 10             	mov    0x10(%ebp),%edi
  8046c9:	8b 75 18             	mov    0x18(%ebp),%esi
#if !LWIP_TCPIP_CORE_LOCKING
  struct netbuf buf;
  u16_t remote_port;
#endif

  sock = get_socket(s);
  8046cc:	8b 45 08             	mov    0x8(%ebp),%eax
  8046cf:	e8 cc ee ff ff       	call   8035a0 <get_socket>
  8046d4:	89 c3                	mov    %eax,%ebx
  if (!sock)
  8046d6:	85 c0                	test   %eax,%eax
  8046d8:	0f 84 2e 01 00 00    	je     80480c <lwip_sendto+0x14f>
    return -1;

  if (sock->conn->type==NETCONN_TCP) {
  8046de:	8b 00                	mov    (%eax),%eax
  8046e0:	83 38 10             	cmpl   $0x10,(%eax)
  8046e3:	75 24                	jne    804709 <lwip_sendto+0x4c>
#if LWIP_TCP
    return lwip_send(s, data, size, flags);
  8046e5:	8b 45 14             	mov    0x14(%ebp),%eax
  8046e8:	89 44 24 0c          	mov    %eax,0xc(%esp)
  8046ec:	89 7c 24 08          	mov    %edi,0x8(%esp)
  8046f0:	8b 45 0c             	mov    0xc(%ebp),%eax
  8046f3:	89 44 24 04          	mov    %eax,0x4(%esp)
  8046f7:	8b 45 08             	mov    0x8(%ebp),%eax
  8046fa:	89 04 24             	mov    %eax,(%esp)
  8046fd:	e8 d8 fe ff ff       	call   8045da <lwip_send>
  804702:	89 c7                	mov    %eax,%edi
  804704:	e9 08 01 00 00       	jmp    804811 <lwip_sendto+0x154>
    sock_set_errno(sock, err_to_errno(ERR_ARG));
    return -1;
#endif /* LWIP_TCP */
  }

  LWIP_ASSERT("lwip_sendto: size must fit in u16_t",
  804709:	81 ff ff ff 00 00    	cmp    $0xffff,%edi
  80470f:	76 1c                	jbe    80472d <lwip_sendto+0x70>
  804711:	c7 44 24 08 f0 2e 81 	movl   $0x812ef0,0x8(%esp)
  804718:	00 
  804719:	c7 44 24 04 97 02 00 	movl   $0x297,0x4(%esp)
  804720:	00 
  804721:	c7 04 24 46 2e 81 00 	movl   $0x812e46,(%esp)
  804728:	e8 6f c2 ff ff       	call   80099c <_panic>
              ((size >= 0) && (size <= 0xffff)));
  LWIP_ERROR("lwip_sendto: invalid address", (((to == NULL) && (tolen == 0)) ||
  80472d:	85 f6                	test   %esi,%esi
  80472f:	0f 95 c0             	setne  %al
  804732:	75 06                	jne    80473a <lwip_sendto+0x7d>
  804734:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
  804738:	74 2a                	je     804764 <lwip_sendto+0xa7>
  80473a:	83 7d 1c 10          	cmpl   $0x10,0x1c(%ebp)
  80473e:	66 90                	xchg   %ax,%ax
  804740:	75 06                	jne    804748 <lwip_sendto+0x8b>
  804742:	80 7e 01 02          	cmpb   $0x2,0x1(%esi)
  804746:	74 1c                	je     804764 <lwip_sendto+0xa7>
  804748:	c7 44 24 08 6b 2e 81 	movl   $0x812e6b,0x8(%esp)
  80474f:	00 
  804750:	c7 44 24 04 9b 02 00 	movl   $0x29b,0x4(%esp)
  804757:	00 
  804758:	c7 04 24 46 2e 81 00 	movl   $0x812e46,(%esp)
  80475f:	e8 38 c2 ff ff       	call   80099c <_panic>
      pbuf_free(p);
    }
  }
#else
  /* initialize a buffer */
  buf.p = buf.ptr = NULL;
  804764:	c7 45 d8 00 00 00 00 	movl   $0x0,-0x28(%ebp)
  80476b:	c7 45 d4 00 00 00 00 	movl   $0x0,-0x2c(%ebp)
  if (to) {
  804772:	84 c0                	test   %al,%al
  804774:	74 1e                	je     804794 <lwip_sendto+0xd7>
    remote_addr.addr = ((struct sockaddr_in *)to)->sin_addr.s_addr;
  804776:	8b 46 04             	mov    0x4(%esi),%eax
  804779:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    remote_port      = ntohs(((struct sockaddr_in *)to)->sin_port);
  80477c:	0f b7 46 02          	movzwl 0x2(%esi),%eax
  804780:	89 04 24             	mov    %eax,(%esp)
  804783:	e8 78 65 00 00       	call   80ad00 <ntohs>
    buf.addr         = &remote_addr;
  804788:	8d 55 e4             	lea    -0x1c(%ebp),%edx
  80478b:	89 55 dc             	mov    %edx,-0x24(%ebp)
    buf.port         = remote_port;
  80478e:	66 89 45 e0          	mov    %ax,-0x20(%ebp)
  804792:	eb 14                	jmp    8047a8 <lwip_sendto+0xeb>
  } else {
    remote_addr.addr = 0;
  804794:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
    remote_port      = 0;
    buf.addr         = NULL;
  80479b:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
    buf.port         = 0;
  8047a2:	66 c7 45 e0 00 00    	movw   $0x0,-0x20(%ebp)
              s, data, size, flags));
  //ip_addr_debug_print(SOCKETS_DEBUG, &remote_addr);
  LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%u\n", remote_port));
    
  /* make the buffer point to the data that should be sent */
  if ((err = netbuf_ref(&buf, data, size)) == ERR_OK) {
  8047a8:	0f b7 c7             	movzwl %di,%eax
  8047ab:	89 44 24 08          	mov    %eax,0x8(%esp)
  8047af:	8b 45 0c             	mov    0xc(%ebp),%eax
  8047b2:	89 44 24 04          	mov    %eax,0x4(%esp)
  8047b6:	8d 45 d4             	lea    -0x2c(%ebp),%eax
  8047b9:	89 04 24             	mov    %eax,(%esp)
  8047bc:	e8 9c 0e 00 00       	call   80565d <netbuf_ref>
  8047c1:	0f be f0             	movsbl %al,%esi
  8047c4:	85 f6                	test   %esi,%esi
  8047c6:	75 14                	jne    8047dc <lwip_sendto+0x11f>
    /* send the data */
    err = netconn_send(sock->conn, &buf);
  8047c8:	8d 45 d4             	lea    -0x2c(%ebp),%eax
  8047cb:	89 44 24 04          	mov    %eax,0x4(%esp)
  8047cf:	8b 03                	mov    (%ebx),%eax
  8047d1:	89 04 24             	mov    %eax,(%esp)
  8047d4:	e8 0a 9f 00 00       	call   80e6e3 <netconn_send>
  8047d9:	0f be f0             	movsbl %al,%esi
  }

  /* deallocated the buffer */
  if (buf.p != NULL) {
  8047dc:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  8047df:	85 c0                	test   %eax,%eax
  8047e1:	74 08                	je     8047eb <lwip_sendto+0x12e>
    pbuf_free(buf.p);
  8047e3:	89 04 24             	mov    %eax,(%esp)
  8047e6:	e8 12 37 00 00       	call   807efd <pbuf_free>
  }
#endif /* LWIP_TCPIP_CORE_LOCKING */
  sock_set_errno(sock, err_to_errno(err));
  8047eb:	89 f2                	mov    %esi,%edx
  8047ed:	f7 da                	neg    %edx
  8047ef:	b8 05 00 00 00       	mov    $0x5,%eax
  8047f4:	83 fa 0e             	cmp    $0xe,%edx
  8047f7:	77 07                	ja     804800 <lwip_sendto+0x143>
  8047f9:	8b 04 95 20 2f 81 00 	mov    0x812f20(,%edx,4),%eax
  804800:	89 43 10             	mov    %eax,0x10(%ebx)
  804803:	a3 a0 f5 b3 00       	mov    %eax,0xb3f5a0
  return (err==ERR_OK?size:-1);
  804808:	85 f6                	test   %esi,%esi
  80480a:	74 05                	je     804811 <lwip_sendto+0x154>
  80480c:	bf ff ff ff ff       	mov    $0xffffffff,%edi
}
  804811:	89 f8                	mov    %edi,%eax
  804813:	83 c4 3c             	add    $0x3c,%esp
  804816:	5b                   	pop    %ebx
  804817:	5e                   	pop    %esi
  804818:	5f                   	pop    %edi
  804819:	5d                   	pop    %ebp
  80481a:	c3                   	ret    

0080481b <lwip_recvfrom>:
}

int
lwip_recvfrom(int s, void *mem, int len, unsigned int flags,
        struct sockaddr *from, socklen_t *fromlen)
{
  80481b:	55                   	push   %ebp
  80481c:	89 e5                	mov    %esp,%ebp
  80481e:	57                   	push   %edi
  80481f:	56                   	push   %esi
  804820:	53                   	push   %ebx
  804821:	83 ec 5c             	sub    $0x5c,%esp
  804824:	8b 75 14             	mov    0x14(%ebp),%esi
  struct ip_addr     *addr;
  u16_t               port;
  u8_t                done = 0;

  LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom(%d, %p, %d, 0x%x, ..)\n", s, mem, len, flags));
  sock = get_socket(s);
  804827:	8b 45 08             	mov    0x8(%ebp),%eax
  80482a:	e8 71 ed ff ff       	call   8035a0 <get_socket>
  80482f:	89 c3                	mov    %eax,%ebx
  if (!sock)
  804831:	66 c7 45 c6 00 00    	movw   $0x0,-0x3a(%ebp)
  804837:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  80483c:	85 db                	test   %ebx,%ebx
  80483e:	0f 84 0b 02 00 00    	je     804a4f <lwip_recvfrom+0x234>
    /* Check if there is data left from the last recv operation. */
    if (sock->lastdata) {
      buf = sock->lastdata;
    } else {
      /* If this is non-blocking call, then check first */
      if (((flags & MSG_DONTWAIT) || (sock->flags & O_NONBLOCK)) && !sock->rcvevent) {
  804844:	89 f0                	mov    %esi,%eax
  804846:	83 e0 08             	and    $0x8,%eax
  804849:	89 45 b0             	mov    %eax,-0x50(%ebp)
    } else {
      done = 1;
    }

    /* If we don't peek the incoming message... */
    if ((flags & MSG_PEEK)==0) {
  80484c:	83 e6 01             	and    $0x1,%esi
  80484f:	89 75 b4             	mov    %esi,-0x4c(%ebp)
    return -1;

  do {
    LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: top while sock->lastdata=%p\n", (void*)sock->lastdata));
    /* Check if there is data left from the last recv operation. */
    if (sock->lastdata) {
  804852:	8b 73 04             	mov    0x4(%ebx),%esi
  804855:	85 f6                	test   %esi,%esi
  804857:	75 7d                	jne    8048d6 <lwip_recvfrom+0xbb>
      buf = sock->lastdata;
    } else {
      /* If this is non-blocking call, then check first */
      if (((flags & MSG_DONTWAIT) || (sock->flags & O_NONBLOCK)) && !sock->rcvevent) {
  804859:	83 7d b0 00          	cmpl   $0x0,-0x50(%ebp)
  80485d:	75 06                	jne    804865 <lwip_recvfrom+0x4a>
  80485f:	f6 43 0f 08          	testb  $0x8,0xf(%ebx)
  804863:	74 22                	je     804887 <lwip_recvfrom+0x6c>
  804865:	66 83 7b 0a 00       	cmpw   $0x0,0xa(%ebx)
  80486a:	75 1b                	jne    804887 <lwip_recvfrom+0x6c>
        LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom(%d): returning EWOULDBLOCK\n", s));
        sock_set_errno(sock, EWOULDBLOCK);
  80486c:	c7 43 10 0b 00 00 00 	movl   $0xb,0x10(%ebx)
  804873:	c7 05 a0 f5 b3 00 0b 	movl   $0xb,0xb3f5a0
  80487a:	00 00 00 
  80487d:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
        return -1;
  804882:	e9 c8 01 00 00       	jmp    804a4f <lwip_recvfrom+0x234>
      }

      /* No data was left from the previous operation, so we try to get
      some from the network. */
      sock->lastdata = buf = netconn_recv(sock->conn);
  804887:	8b 03                	mov    (%ebx),%eax
  804889:	89 04 24             	mov    %eax,(%esp)
  80488c:	e8 38 a1 00 00       	call   80e9c9 <netconn_recv>
  804891:	89 c6                	mov    %eax,%esi
  804893:	89 43 04             	mov    %eax,0x4(%ebx)
      LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: netconn_recv netbuf=%p\n", (void*)buf));

      if (!buf) {
  804896:	85 c0                	test   %eax,%eax
  804898:	75 3c                	jne    8048d6 <lwip_recvfrom+0xbb>
        /* We should really do some error checking here. */
        LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom(%d): buf == NULL!\n", s));
        sock_set_errno(sock, (((sock->conn->pcb.ip!=NULL) && (sock->conn->err==ERR_OK))?ETIMEDOUT:err_to_errno(sock->conn->err)));
  80489a:	8b 13                	mov    (%ebx),%edx
  80489c:	83 7a 08 00          	cmpl   $0x0,0x8(%edx)
  8048a0:	74 0b                	je     8048ad <lwip_recvfrom+0x92>
  8048a2:	b8 6e 00 00 00       	mov    $0x6e,%eax
  8048a7:	80 7a 0c 00          	cmpb   $0x0,0xc(%edx)
  8048ab:	74 17                	je     8048c4 <lwip_recvfrom+0xa9>
  8048ad:	0f be 52 0c          	movsbl 0xc(%edx),%edx
  8048b1:	f7 da                	neg    %edx
  8048b3:	b8 05 00 00 00       	mov    $0x5,%eax
  8048b8:	83 fa 0e             	cmp    $0xe,%edx
  8048bb:	77 07                	ja     8048c4 <lwip_recvfrom+0xa9>
  8048bd:	8b 04 95 20 2f 81 00 	mov    0x812f20(,%edx,4),%eax
  8048c4:	89 43 10             	mov    %eax,0x10(%ebx)
  8048c7:	a3 a0 f5 b3 00       	mov    %eax,0xb3f5a0
  8048cc:	b8 00 00 00 00       	mov    $0x0,%eax
        return 0;
  8048d1:	e9 79 01 00 00       	jmp    804a4f <lwip_recvfrom+0x234>
      }
    }

    buflen = netbuf_len(buf);
  8048d6:	8b 06                	mov    (%esi),%eax
  8048d8:	0f b7 78 08          	movzwl 0x8(%eax),%edi
    LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: buflen=%d len=%d off=%d sock->lastoffset=%d\n", buflen, len, off, sock->lastoffset));

    buflen -= sock->lastoffset;
  8048dc:	0f b7 53 08          	movzwl 0x8(%ebx),%edx
  8048e0:	66 29 d7             	sub    %dx,%di

    if (len > buflen) {
  8048e3:	0f b7 cf             	movzwl %di,%ecx
  8048e6:	89 4d bc             	mov    %ecx,-0x44(%ebp)
  8048e9:	39 4d 10             	cmp    %ecx,0x10(%ebp)
  8048ec:	0f 4e 7d 10          	cmovle 0x10(%ebp),%edi
      copylen = len;
    }

    /* copy the contents of the received buffer into
    the supplied memory pointer mem */
    netbuf_copy_partial(buf, (u8_t*)mem + off, copylen, sock->lastoffset);
  8048f0:	0f b7 cf             	movzwl %di,%ecx
  8048f3:	89 4d c0             	mov    %ecx,-0x40(%ebp)
  8048f6:	0f b7 d2             	movzwl %dx,%edx
  8048f9:	89 54 24 0c          	mov    %edx,0xc(%esp)
  8048fd:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  804901:	0f b7 55 c6          	movzwl -0x3a(%ebp),%edx
  804905:	03 55 0c             	add    0xc(%ebp),%edx
  804908:	89 54 24 04          	mov    %edx,0x4(%esp)
  80490c:	89 04 24             	mov    %eax,(%esp)
  80490f:	e8 72 33 00 00       	call   807c86 <pbuf_copy_partial>

    off += copylen;
  804914:	66 01 7d c6          	add    %di,-0x3a(%ebp)

    if (netconn_type(sock->conn) == NETCONN_TCP) {
  804918:	8b 03                	mov    (%ebx),%eax
  80491a:	89 04 24             	mov    %eax,(%esp)
  80491d:	e8 ce 9c 00 00       	call   80e5f0 <netconn_type>
  804922:	83 f8 10             	cmp    $0x10,%eax
  804925:	75 1f                	jne    804946 <lwip_recvfrom+0x12b>
      len -= copylen;
  804927:	8b 45 c0             	mov    -0x40(%ebp),%eax
  80492a:	29 45 10             	sub    %eax,0x10(%ebp)
      if ( (len <= 0) || (buf->p->flags & PBUF_FLAG_PUSH) || !sock->rcvevent) {
  80492d:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  804931:	7e 13                	jle    804946 <lwip_recvfrom+0x12b>
  804933:	8b 06                	mov    (%esi),%eax
  804935:	f6 40 0d 01          	testb  $0x1,0xd(%eax)
  804939:	75 0b                	jne    804946 <lwip_recvfrom+0x12b>
  80493b:	c6 45 bb 00          	movb   $0x0,-0x45(%ebp)
  80493f:	66 83 7b 0a 00       	cmpw   $0x0,0xa(%ebx)
  804944:	75 04                	jne    80494a <lwip_recvfrom+0x12f>
  804946:	c6 45 bb 01          	movb   $0x1,-0x45(%ebp)
    } else {
      done = 1;
    }

    /* If we don't peek the incoming message... */
    if ((flags & MSG_PEEK)==0) {
  80494a:	83 7d b4 00          	cmpl   $0x0,-0x4c(%ebp)
  80494e:	75 39                	jne    804989 <lwip_recvfrom+0x16e>
      /* If this is a TCP socket, check if there is data left in the
         buffer. If so, it should be saved in the sock structure for next
         time around. */
      if ((sock->conn->type == NETCONN_TCP) && (buflen - copylen > 0)) {
  804950:	8b 03                	mov    (%ebx),%eax
  804952:	83 38 10             	cmpl   $0x10,(%eax)
  804955:	75 13                	jne    80496a <lwip_recvfrom+0x14f>
  804957:	8b 45 bc             	mov    -0x44(%ebp),%eax
  80495a:	2b 45 c0             	sub    -0x40(%ebp),%eax
  80495d:	85 c0                	test   %eax,%eax
  80495f:	7e 09                	jle    80496a <lwip_recvfrom+0x14f>
        sock->lastdata = buf;
  804961:	89 73 04             	mov    %esi,0x4(%ebx)
        sock->lastoffset += copylen;
  804964:	66 01 7b 08          	add    %di,0x8(%ebx)
    /* If we don't peek the incoming message... */
    if ((flags & MSG_PEEK)==0) {
      /* If this is a TCP socket, check if there is data left in the
         buffer. If so, it should be saved in the sock structure for next
         time around. */
      if ((sock->conn->type == NETCONN_TCP) && (buflen - copylen > 0)) {
  804968:	eb 15                	jmp    80497f <lwip_recvfrom+0x164>
        sock->lastdata = buf;
        sock->lastoffset += copylen;
        LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: lastdata now netbuf=%p\n", (void*)buf));
      } else {
        sock->lastdata = NULL;
  80496a:	c7 43 04 00 00 00 00 	movl   $0x0,0x4(%ebx)
        sock->lastoffset = 0;
  804971:	66 c7 43 08 00 00    	movw   $0x0,0x8(%ebx)
        LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: deleting netbuf=%p\n", (void*)buf));
        netbuf_delete(buf);
  804977:	89 34 24             	mov    %esi,(%esp)
  80497a:	e8 9f 0c 00 00       	call   80561e <netbuf_delete>
      }
    } else {
      done = 1;
    }
  } while (!done);
  80497f:	80 7d bb 00          	cmpb   $0x0,-0x45(%ebp)
  804983:	0f 84 c9 fe ff ff    	je     804852 <lwip_recvfrom+0x37>

  /* Check to see from where the data was.*/
  if (from && fromlen) {
  804989:	83 7d 18 00          	cmpl   $0x0,0x18(%ebp)
  80498d:	0f 84 a7 00 00 00    	je     804a3a <lwip_recvfrom+0x21f>
  804993:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
  804997:	0f 84 9d 00 00 00    	je     804a3a <lwip_recvfrom+0x21f>
    struct sockaddr_in sin;

    if (netconn_type(sock->conn) == NETCONN_TCP) {
  80499d:	8b 03                	mov    (%ebx),%eax
  80499f:	89 04 24             	mov    %eax,(%esp)
  8049a2:	e8 49 9c 00 00       	call   80e5f0 <netconn_type>
  8049a7:	83 f8 10             	cmp    $0x10,%eax
  8049aa:	75 22                	jne    8049ce <lwip_recvfrom+0x1b3>
      addr = (struct ip_addr*)&(sin.sin_addr.s_addr);
  8049ac:	8d 7d d8             	lea    -0x28(%ebp),%edi
      netconn_getaddr(sock->conn, addr, &port, 0);
  8049af:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  8049b6:	00 
  8049b7:	8d 45 e6             	lea    -0x1a(%ebp),%eax
  8049ba:	89 44 24 08          	mov    %eax,0x8(%esp)
  8049be:	89 7c 24 04          	mov    %edi,0x4(%esp)
  8049c2:	8b 03                	mov    (%ebx),%eax
  8049c4:	89 04 24             	mov    %eax,(%esp)
  8049c7:	e8 d7 9e 00 00       	call   80e8a3 <netconn_getaddr>
  8049cc:	eb 0b                	jmp    8049d9 <lwip_recvfrom+0x1be>
    } else {
      addr = netbuf_fromaddr(buf);
  8049ce:	8b 7e 08             	mov    0x8(%esi),%edi
      port = netbuf_fromport(buf);
  8049d1:	0f b7 46 0c          	movzwl 0xc(%esi),%eax
  8049d5:	66 89 45 e6          	mov    %ax,-0x1a(%ebp)
    }

    memset(&sin, 0, sizeof(sin));
  8049d9:	c7 44 24 08 10 00 00 	movl   $0x10,0x8(%esp)
  8049e0:	00 
  8049e1:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  8049e8:	00 
  8049e9:	8d 45 d4             	lea    -0x2c(%ebp),%eax
  8049ec:	89 04 24             	mov    %eax,(%esp)
  8049ef:	e8 92 c8 ff ff       	call   801286 <memset>
    sin.sin_len = sizeof(sin);
  8049f4:	c6 45 d4 10          	movb   $0x10,-0x2c(%ebp)
    sin.sin_family = AF_INET;
  8049f8:	c6 45 d5 02          	movb   $0x2,-0x2b(%ebp)
    sin.sin_port = htons(port);
  8049fc:	0f b7 45 e6          	movzwl -0x1a(%ebp),%eax
  804a00:	89 04 24             	mov    %eax,(%esp)
  804a03:	e8 eb 62 00 00       	call   80acf3 <htons>
  804a08:	66 89 45 d6          	mov    %ax,-0x2a(%ebp)
    sin.sin_addr.s_addr = addr->addr;
  804a0c:	8b 07                	mov    (%edi),%eax
  804a0e:	89 45 d8             	mov    %eax,-0x28(%ebp)

    if (*fromlen > sizeof(sin))
  804a11:	8b 55 1c             	mov    0x1c(%ebp),%edx
  804a14:	83 3a 10             	cmpl   $0x10,(%edx)
  804a17:	76 06                	jbe    804a1f <lwip_recvfrom+0x204>
      *fromlen = sizeof(sin);
  804a19:	c7 02 10 00 00 00    	movl   $0x10,(%edx)

    SMEMCPY(from, &sin, *fromlen);
  804a1f:	8b 4d 1c             	mov    0x1c(%ebp),%ecx
  804a22:	8b 01                	mov    (%ecx),%eax
  804a24:	89 44 24 08          	mov    %eax,0x8(%esp)
  804a28:	8d 45 d4             	lea    -0x2c(%ebp),%eax
  804a2b:	89 44 24 04          	mov    %eax,0x4(%esp)
  804a2f:	8b 45 18             	mov    0x18(%ebp),%eax
  804a32:	89 04 24             	mov    %eax,(%esp)
  804a35:	e8 27 c9 ff ff       	call   801361 <memcpy>
    //ip_addr_debug_print(SOCKETS_DEBUG, addr);
    LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%u len=%u\n", port, off));
#endif /*  SOCKETS_DEBUG */
  }

  sock_set_errno(sock, 0);
  804a3a:	c7 43 10 00 00 00 00 	movl   $0x0,0x10(%ebx)
  804a41:	c7 05 a0 f5 b3 00 00 	movl   $0x0,0xb3f5a0
  804a48:	00 00 00 
  return off;
  804a4b:	0f b7 45 c6          	movzwl -0x3a(%ebp),%eax
}
  804a4f:	83 c4 5c             	add    $0x5c,%esp
  804a52:	5b                   	pop    %ebx
  804a53:	5e                   	pop    %esi
  804a54:	5f                   	pop    %edi
  804a55:	5d                   	pop    %ebp
  804a56:	c3                   	ret    

00804a57 <lwip_recv>:
  return lwip_recvfrom(s, mem, len, 0, NULL, NULL);
}

int
lwip_recv(int s, void *mem, int len, unsigned int flags)
{
  804a57:	55                   	push   %ebp
  804a58:	89 e5                	mov    %esp,%ebp
  804a5a:	83 ec 28             	sub    $0x28,%esp
  return lwip_recvfrom(s, mem, len, flags, NULL, NULL);
  804a5d:	c7 44 24 14 00 00 00 	movl   $0x0,0x14(%esp)
  804a64:	00 
  804a65:	c7 44 24 10 00 00 00 	movl   $0x0,0x10(%esp)
  804a6c:	00 
  804a6d:	8b 45 14             	mov    0x14(%ebp),%eax
  804a70:	89 44 24 0c          	mov    %eax,0xc(%esp)
  804a74:	8b 45 10             	mov    0x10(%ebp),%eax
  804a77:	89 44 24 08          	mov    %eax,0x8(%esp)
  804a7b:	8b 45 0c             	mov    0xc(%ebp),%eax
  804a7e:	89 44 24 04          	mov    %eax,0x4(%esp)
  804a82:	8b 45 08             	mov    0x8(%ebp),%eax
  804a85:	89 04 24             	mov    %eax,(%esp)
  804a88:	e8 8e fd ff ff       	call   80481b <lwip_recvfrom>
}
  804a8d:	c9                   	leave  
  804a8e:	c3                   	ret    

00804a8f <lwip_read>:
  return off;
}

int
lwip_read(int s, void *mem, int len)
{
  804a8f:	55                   	push   %ebp
  804a90:	89 e5                	mov    %esp,%ebp
  804a92:	83 ec 28             	sub    $0x28,%esp
  return lwip_recvfrom(s, mem, len, 0, NULL, NULL);
  804a95:	c7 44 24 14 00 00 00 	movl   $0x0,0x14(%esp)
  804a9c:	00 
  804a9d:	c7 44 24 10 00 00 00 	movl   $0x0,0x10(%esp)
  804aa4:	00 
  804aa5:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  804aac:	00 
  804aad:	8b 45 10             	mov    0x10(%ebp),%eax
  804ab0:	89 44 24 08          	mov    %eax,0x8(%esp)
  804ab4:	8b 45 0c             	mov    0xc(%ebp),%eax
  804ab7:	89 44 24 04          	mov    %eax,0x4(%esp)
  804abb:	8b 45 08             	mov    0x8(%ebp),%eax
  804abe:	89 04 24             	mov    %eax,(%esp)
  804ac1:	e8 55 fd ff ff       	call   80481b <lwip_recvfrom>
}
  804ac6:	c9                   	leave  
  804ac7:	c3                   	ret    

00804ac8 <lwip_close>:
  return 0;
}

int
lwip_close(int s)
{
  804ac8:	55                   	push   %ebp
  804ac9:	89 e5                	mov    %esp,%ebp
  804acb:	53                   	push   %ebx
  804acc:	83 ec 14             	sub    $0x14,%esp
  struct lwip_socket *sock;

  LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_close(%d)\n", s));

  sock = get_socket(s);
  804acf:	8b 45 08             	mov    0x8(%ebp),%eax
  804ad2:	e8 c9 ea ff ff       	call   8035a0 <get_socket>
  804ad7:	89 c3                	mov    %eax,%ebx
  if (!sock) {
  804ad9:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  804ade:	85 db                	test   %ebx,%ebx
  804ae0:	74 5c                	je     804b3e <lwip_close+0x76>
    return -1;
  }

  netconn_delete(sock->conn);
  804ae2:	8b 03                	mov    (%ebx),%eax
  804ae4:	89 04 24             	mov    %eax,(%esp)
  804ae7:	e8 8f a0 00 00       	call   80eb7b <netconn_delete>

  sys_sem_wait(socksem);
  804aec:	a1 a4 96 81 00       	mov    0x8196a4,%eax
  804af1:	89 04 24             	mov    %eax,(%esp)
  804af4:	e8 d1 3a 00 00       	call   8085ca <sys_sem_wait>
  if (sock->lastdata) {
  804af9:	8b 43 04             	mov    0x4(%ebx),%eax
  804afc:	85 c0                	test   %eax,%eax
  804afe:	74 08                	je     804b08 <lwip_close+0x40>
    netbuf_delete(sock->lastdata);
  804b00:	89 04 24             	mov    %eax,(%esp)
  804b03:	e8 16 0b 00 00       	call   80561e <netbuf_delete>
  }
  sock->lastdata   = NULL;
  804b08:	c7 43 04 00 00 00 00 	movl   $0x0,0x4(%ebx)
  sock->lastoffset = 0;
  804b0f:	66 c7 43 08 00 00    	movw   $0x0,0x8(%ebx)
  sock->conn       = NULL;
  804b15:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  sock_set_errno(sock, 0);
  804b1b:	c7 43 10 00 00 00 00 	movl   $0x0,0x10(%ebx)
  804b22:	c7 05 a0 f5 b3 00 00 	movl   $0x0,0xb3f5a0
  804b29:	00 00 00 
  sys_sem_signal(socksem);
  804b2c:	a1 a4 96 81 00       	mov    0x8196a4,%eax
  804b31:	89 04 24             	mov    %eax,(%esp)
  804b34:	e8 ae 90 00 00       	call   80dbe7 <sys_sem_signal>
  804b39:	b8 00 00 00 00       	mov    $0x0,%eax
  return 0;
}
  804b3e:	83 c4 14             	add    $0x14,%esp
  804b41:	5b                   	pop    %ebx
  804b42:	5d                   	pop    %ebp
  804b43:	c3                   	ret    

00804b44 <lwip_shutdown>:
 * Unimplemented: Close one end of a full-duplex connection.
 * Currently, the full connection is closed.
 */
int
lwip_shutdown(int s, int how)
{
  804b44:	55                   	push   %ebp
  804b45:	89 e5                	mov    %esp,%ebp
  804b47:	83 ec 18             	sub    $0x18,%esp
  LWIP_UNUSED_ARG(how);
  LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_shutdown(%d, how=%d)\n", s, how));
  return lwip_close(s); /* XXX temporary hack until proper implementation */
  804b4a:	8b 45 08             	mov    0x8(%ebp),%eax
  804b4d:	89 04 24             	mov    %eax,(%esp)
  804b50:	e8 73 ff ff ff       	call   804ac8 <lwip_close>
}
  804b55:	c9                   	leave  
  804b56:	c3                   	ret    

00804b57 <lwip_listen>:
 * @param backlog (ATTENTION: need TCP_LISTEN_BACKLOG=1)
 * @return 0 on success, non-zero on failure
 */
int
lwip_listen(int s, int backlog)
{
  804b57:	55                   	push   %ebp
  804b58:	89 e5                	mov    %esp,%ebp
  804b5a:	56                   	push   %esi
  804b5b:	53                   	push   %ebx
  804b5c:	83 ec 10             	sub    $0x10,%esp
  804b5f:	8b 75 0c             	mov    0xc(%ebp),%esi
  struct lwip_socket *sock;
  err_t err;

  LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_listen(%d, backlog=%d)\n", s, backlog));

  sock = get_socket(s);
  804b62:	8b 45 08             	mov    0x8(%ebp),%eax
  804b65:	e8 36 ea ff ff       	call   8035a0 <get_socket>
  804b6a:	89 c3                	mov    %eax,%ebx
  if (!sock)
  804b6c:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  804b71:	85 db                	test   %ebx,%ebx
  804b73:	74 69                	je     804bde <lwip_listen+0x87>
  804b75:	85 f6                	test   %esi,%esi
  804b77:	b8 00 00 00 00       	mov    $0x0,%eax
  804b7c:	0f 48 f0             	cmovs  %eax,%esi
  }
  if (backlog > 0xff) {
    backlog = 0xff;
  }

  err = netconn_listen_with_backlog(sock->conn, backlog);
  804b7f:	81 fe ff 00 00 00    	cmp    $0xff,%esi
  804b85:	b0 ff                	mov    $0xff,%al
  804b87:	0f 4f f0             	cmovg  %eax,%esi
  804b8a:	81 e6 ff 00 00 00    	and    $0xff,%esi
  804b90:	89 74 24 04          	mov    %esi,0x4(%esp)
  804b94:	8b 03                	mov    (%ebx),%eax
  804b96:	89 04 24             	mov    %eax,(%esp)
  804b99:	e8 c5 9b 00 00       	call   80e763 <netconn_listen_with_backlog>

  if (err != ERR_OK) {
  804b9e:	84 c0                	test   %al,%al
  804ba0:	74 26                	je     804bc8 <lwip_listen+0x71>
    LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_listen(%d) failed, err=%d\n", s, err));
    sock_set_errno(sock, err_to_errno(err));
  804ba2:	0f be c0             	movsbl %al,%eax
  804ba5:	f7 d8                	neg    %eax
  804ba7:	ba 05 00 00 00       	mov    $0x5,%edx
  804bac:	83 f8 0e             	cmp    $0xe,%eax
  804baf:	77 07                	ja     804bb8 <lwip_listen+0x61>
  804bb1:	8b 14 85 20 2f 81 00 	mov    0x812f20(,%eax,4),%edx
  804bb8:	89 53 10             	mov    %edx,0x10(%ebx)
  804bbb:	89 15 a0 f5 b3 00    	mov    %edx,0xb3f5a0
  804bc1:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
    return -1;
  804bc6:	eb 16                	jmp    804bde <lwip_listen+0x87>
  }

  sock_set_errno(sock, 0);
  804bc8:	c7 43 10 00 00 00 00 	movl   $0x0,0x10(%ebx)
  804bcf:	c7 05 a0 f5 b3 00 00 	movl   $0x0,0xb3f5a0
  804bd6:	00 00 00 
  804bd9:	b8 00 00 00 00       	mov    $0x0,%eax
  return 0;
}
  804bde:	83 c4 10             	add    $0x10,%esp
  804be1:	5b                   	pop    %ebx
  804be2:	5e                   	pop    %esi
  804be3:	5d                   	pop    %ebp
  804be4:	c3                   	ret    

00804be5 <lwip_connect>:
  return 0;
}

int
lwip_connect(int s, const struct sockaddr *name, socklen_t namelen)
{
  804be5:	55                   	push   %ebp
  804be6:	89 e5                	mov    %esp,%ebp
  804be8:	53                   	push   %ebx
  804be9:	83 ec 24             	sub    $0x24,%esp
  struct lwip_socket *sock;
  err_t err;

  sock = get_socket(s);
  804bec:	8b 45 08             	mov    0x8(%ebp),%eax
  804bef:	e8 ac e9 ff ff       	call   8035a0 <get_socket>
  804bf4:	89 c3                	mov    %eax,%ebx
  if (!sock)
  804bf6:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  804bfb:	85 db                	test   %ebx,%ebx
  804bfd:	0f 84 95 00 00 00    	je     804c98 <lwip_connect+0xb3>
    return -1;

  LWIP_ERROR("lwip_connect: invalid address", ((namelen == sizeof(struct sockaddr_in)) &&
  804c03:	83 7d 10 10          	cmpl   $0x10,0x10(%ebp)
  804c07:	75 09                	jne    804c12 <lwip_connect+0x2d>
  804c09:	8b 45 0c             	mov    0xc(%ebp),%eax
  804c0c:	80 78 01 02          	cmpb   $0x2,0x1(%eax)
  804c10:	74 1c                	je     804c2e <lwip_connect+0x49>
  804c12:	c7 44 24 08 88 2e 81 	movl   $0x812e88,0x8(%esp)
  804c19:	00 
  804c1a:	c7 44 24 04 86 01 00 	movl   $0x186,0x4(%esp)
  804c21:	00 
  804c22:	c7 04 24 46 2e 81 00 	movl   $0x812e46,(%esp)
  804c29:	e8 6e bd ff ff       	call   80099c <_panic>
    err = netconn_disconnect(sock->conn);
  } else {
    struct ip_addr remote_addr;
    u16_t remote_port;

    remote_addr.addr = ((struct sockaddr_in *)name)->sin_addr.s_addr;
  804c2e:	8b 50 04             	mov    0x4(%eax),%edx
  804c31:	89 55 f4             	mov    %edx,-0xc(%ebp)

    LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_connect(%d, addr=", s));
    //ip_addr_debug_print(SOCKETS_DEBUG, &remote_addr);
    LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%u)\n", ntohs(remote_port)));

    err = netconn_connect(sock->conn, &remote_addr, ntohs(remote_port));
  804c34:	0f b7 40 02          	movzwl 0x2(%eax),%eax
  804c38:	89 04 24             	mov    %eax,(%esp)
  804c3b:	e8 c0 60 00 00       	call   80ad00 <ntohs>
  804c40:	0f b7 c0             	movzwl %ax,%eax
  804c43:	89 44 24 08          	mov    %eax,0x8(%esp)
  804c47:	8d 45 f4             	lea    -0xc(%ebp),%eax
  804c4a:	89 44 24 04          	mov    %eax,0x4(%esp)
  804c4e:	8b 03                	mov    (%ebx),%eax
  804c50:	89 04 24             	mov    %eax,(%esp)
  804c53:	e8 9d 9b 00 00       	call   80e7f5 <netconn_connect>
  }

  if (err != ERR_OK) {
  804c58:	84 c0                	test   %al,%al
  804c5a:	74 26                	je     804c82 <lwip_connect+0x9d>
    LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_connect(%d) failed, err=%d\n", s, err));
    sock_set_errno(sock, err_to_errno(err));
  804c5c:	0f be c0             	movsbl %al,%eax
  804c5f:	f7 d8                	neg    %eax
  804c61:	ba 05 00 00 00       	mov    $0x5,%edx
  804c66:	83 f8 0e             	cmp    $0xe,%eax
  804c69:	77 07                	ja     804c72 <lwip_connect+0x8d>
  804c6b:	8b 14 85 20 2f 81 00 	mov    0x812f20(,%eax,4),%edx
  804c72:	89 53 10             	mov    %edx,0x10(%ebx)
  804c75:	89 15 a0 f5 b3 00    	mov    %edx,0xb3f5a0
  804c7b:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
    return -1;
  804c80:	eb 16                	jmp    804c98 <lwip_connect+0xb3>
  }

  LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_connect(%d) succeeded\n", s));
  sock_set_errno(sock, 0);
  804c82:	c7 43 10 00 00 00 00 	movl   $0x0,0x10(%ebx)
  804c89:	c7 05 a0 f5 b3 00 00 	movl   $0x0,0xb3f5a0
  804c90:	00 00 00 
  804c93:	b8 00 00 00 00       	mov    $0x0,%eax
  return 0;
}
  804c98:	83 c4 24             	add    $0x24,%esp
  804c9b:	5b                   	pop    %ebx
  804c9c:	5d                   	pop    %ebp
  804c9d:	c3                   	ret    

00804c9e <lwip_bind>:
  return newsock;
}

int
lwip_bind(int s, struct sockaddr *name, socklen_t namelen)
{
  804c9e:	55                   	push   %ebp
  804c9f:	89 e5                	mov    %esp,%ebp
  804ca1:	53                   	push   %ebx
  804ca2:	83 ec 24             	sub    $0x24,%esp
  struct lwip_socket *sock;
  struct ip_addr local_addr;
  u16_t local_port;
  err_t err;

  sock = get_socket(s);
  804ca5:	8b 45 08             	mov    0x8(%ebp),%eax
  804ca8:	e8 f3 e8 ff ff       	call   8035a0 <get_socket>
  804cad:	89 c3                	mov    %eax,%ebx
  if (!sock)
  804caf:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  804cb4:	85 db                	test   %ebx,%ebx
  804cb6:	0f 84 95 00 00 00    	je     804d51 <lwip_bind+0xb3>
    return -1;

  LWIP_ERROR("lwip_bind: invalid address", ((namelen == sizeof(struct sockaddr_in)) &&
  804cbc:	83 7d 10 10          	cmpl   $0x10,0x10(%ebp)
  804cc0:	75 09                	jne    804ccb <lwip_bind+0x2d>
  804cc2:	8b 45 0c             	mov    0xc(%ebp),%eax
  804cc5:	80 78 01 02          	cmpb   $0x2,0x1(%eax)
  804cc9:	74 1c                	je     804ce7 <lwip_bind+0x49>
  804ccb:	c7 44 24 08 a6 2e 81 	movl   $0x812ea6,0x8(%esp)
  804cd2:	00 
  804cd3:	c7 44 24 04 4a 01 00 	movl   $0x14a,0x4(%esp)
  804cda:	00 
  804cdb:	c7 04 24 46 2e 81 00 	movl   $0x812e46,(%esp)
  804ce2:	e8 b5 bc ff ff       	call   80099c <_panic>
             ((((struct sockaddr_in *)name)->sin_family) == AF_INET)),
             sock_set_errno(sock, err_to_errno(ERR_ARG)); return -1;);

  local_addr.addr = ((struct sockaddr_in *)name)->sin_addr.s_addr;
  804ce7:	8b 50 04             	mov    0x4(%eax),%edx
  804cea:	89 55 f4             	mov    %edx,-0xc(%ebp)

  LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_bind(%d, addr=", s));
  //ip_addr_debug_print(SOCKETS_DEBUG, &local_addr);
  LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%u)\n", ntohs(local_port)));

  err = netconn_bind(sock->conn, &local_addr, ntohs(local_port));
  804ced:	0f b7 40 02          	movzwl 0x2(%eax),%eax
  804cf1:	89 04 24             	mov    %eax,(%esp)
  804cf4:	e8 07 60 00 00       	call   80ad00 <ntohs>
  804cf9:	0f b7 c0             	movzwl %ax,%eax
  804cfc:	89 44 24 08          	mov    %eax,0x8(%esp)
  804d00:	8d 45 f4             	lea    -0xc(%ebp),%eax
  804d03:	89 44 24 04          	mov    %eax,0x4(%esp)
  804d07:	8b 03                	mov    (%ebx),%eax
  804d09:	89 04 24             	mov    %eax,(%esp)
  804d0c:	e8 3b 9b 00 00       	call   80e84c <netconn_bind>

  if (err != ERR_OK) {
  804d11:	84 c0                	test   %al,%al
  804d13:	74 26                	je     804d3b <lwip_bind+0x9d>
    LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_bind(%d) failed, err=%d\n", s, err));
    sock_set_errno(sock, err_to_errno(err));
  804d15:	0f be c0             	movsbl %al,%eax
  804d18:	f7 d8                	neg    %eax
  804d1a:	ba 05 00 00 00       	mov    $0x5,%edx
  804d1f:	83 f8 0e             	cmp    $0xe,%eax
  804d22:	77 07                	ja     804d2b <lwip_bind+0x8d>
  804d24:	8b 14 85 20 2f 81 00 	mov    0x812f20(,%eax,4),%edx
  804d2b:	89 53 10             	mov    %edx,0x10(%ebx)
  804d2e:	89 15 a0 f5 b3 00    	mov    %edx,0xb3f5a0
  804d34:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
    return -1;
  804d39:	eb 16                	jmp    804d51 <lwip_bind+0xb3>
  }

  LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_bind(%d) succeeded\n", s));
  sock_set_errno(sock, 0);
  804d3b:	c7 43 10 00 00 00 00 	movl   $0x0,0x10(%ebx)
  804d42:	c7 05 a0 f5 b3 00 00 	movl   $0x0,0xb3f5a0
  804d49:	00 00 00 
  804d4c:	b8 00 00 00 00       	mov    $0x0,%eax
  return 0;
}
  804d51:	83 c4 24             	add    $0x24,%esp
  804d54:	5b                   	pop    %ebx
  804d55:	5d                   	pop    %ebp
  804d56:	c3                   	ret    

00804d57 <lwip_accept>:
 * Exceptions are documented!
 */

int
lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
{
  804d57:	55                   	push   %ebp
  804d58:	89 e5                	mov    %esp,%ebp
  804d5a:	57                   	push   %edi
  804d5b:	56                   	push   %esi
  804d5c:	53                   	push   %ebx
  804d5d:	83 ec 4c             	sub    $0x4c,%esp
  int newsock;
  struct sockaddr_in sin;
  err_t err;

  LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_accept(%d)...\n", s));
  sock = get_socket(s);
  804d60:	8b 45 08             	mov    0x8(%ebp),%eax
  804d63:	e8 38 e8 ff ff       	call   8035a0 <get_socket>
  804d68:	89 c7                	mov    %eax,%edi
  if (!sock)
  804d6a:	be ff ff ff ff       	mov    $0xffffffff,%esi
  804d6f:	85 c0                	test   %eax,%eax
  804d71:	0f 84 ae 01 00 00    	je     804f25 <lwip_accept+0x1ce>
    return -1;

  newconn = netconn_accept(sock->conn);
  804d77:	8b 00                	mov    (%eax),%eax
  804d79:	89 04 24             	mov    %eax,(%esp)
  804d7c:	e8 be 9b 00 00       	call   80e93f <netconn_accept>
  804d81:	89 c3                	mov    %eax,%ebx
  if (!newconn) {
  804d83:	85 c0                	test   %eax,%eax
  804d85:	75 2b                	jne    804db2 <lwip_accept+0x5b>
    LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_accept(%d) failed, err=%d\n", s, sock->conn->err));
    sock_set_errno(sock, err_to_errno(sock->conn->err));
  804d87:	8b 07                	mov    (%edi),%eax
  804d89:	0f be 50 0c          	movsbl 0xc(%eax),%edx
  804d8d:	f7 da                	neg    %edx
  804d8f:	b8 05 00 00 00       	mov    $0x5,%eax
  804d94:	83 fa 0e             	cmp    $0xe,%edx
  804d97:	77 07                	ja     804da0 <lwip_accept+0x49>
  804d99:	8b 04 95 20 2f 81 00 	mov    0x812f20(,%edx,4),%eax
  804da0:	89 47 10             	mov    %eax,0x10(%edi)
  804da3:	a3 a0 f5 b3 00       	mov    %eax,0xb3f5a0
  804da8:	be ff ff ff ff       	mov    $0xffffffff,%esi
    return -1;
  804dad:	e9 73 01 00 00       	jmp    804f25 <lwip_accept+0x1ce>
  }

  /* get the IP address and port of the remote host */
  err = netconn_peer(newconn, &naddr, &port);
  804db2:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  804db9:	00 
  804dba:	8d 45 e2             	lea    -0x1e(%ebp),%eax
  804dbd:	89 44 24 08          	mov    %eax,0x8(%esp)
  804dc1:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  804dc4:	89 44 24 04          	mov    %eax,0x4(%esp)
  804dc8:	89 1c 24             	mov    %ebx,(%esp)
  804dcb:	e8 d3 9a 00 00       	call   80e8a3 <netconn_getaddr>
  804dd0:	89 c6                	mov    %eax,%esi
  if (err != ERR_OK) {
  804dd2:	84 c0                	test   %al,%al
  804dd4:	74 32                	je     804e08 <lwip_accept+0xb1>
    netconn_delete(newconn);
  804dd6:	89 1c 24             	mov    %ebx,(%esp)
  804dd9:	e8 9d 9d 00 00       	call   80eb7b <netconn_delete>
    sock_set_errno(sock, err_to_errno(err));
  804dde:	89 f0                	mov    %esi,%eax
  804de0:	0f be f0             	movsbl %al,%esi
  804de3:	f7 de                	neg    %esi
  804de5:	b8 05 00 00 00       	mov    $0x5,%eax
  804dea:	83 fe 0e             	cmp    $0xe,%esi
  804ded:	77 07                	ja     804df6 <lwip_accept+0x9f>
  804def:	8b 04 b5 20 2f 81 00 	mov    0x812f20(,%esi,4),%eax
  804df6:	89 47 10             	mov    %eax,0x10(%edi)
  804df9:	a3 a0 f5 b3 00       	mov    %eax,0xb3f5a0
  804dfe:	be ff ff ff ff       	mov    $0xffffffff,%esi
    return -1;
  804e03:	e9 1d 01 00 00       	jmp    804f25 <lwip_accept+0x1ce>
  }

  memset(&sin, 0, sizeof(sin));
  804e08:	c7 44 24 08 10 00 00 	movl   $0x10,0x8(%esp)
  804e0f:	00 
  804e10:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  804e17:	00 
  804e18:	8d 45 d0             	lea    -0x30(%ebp),%eax
  804e1b:	89 04 24             	mov    %eax,(%esp)
  804e1e:	e8 63 c4 ff ff       	call   801286 <memset>
  sin.sin_len = sizeof(sin);
  804e23:	c6 45 d0 10          	movb   $0x10,-0x30(%ebp)
  sin.sin_family = AF_INET;
  804e27:	c6 45 d1 02          	movb   $0x2,-0x2f(%ebp)
  sin.sin_port = htons(port);
  804e2b:	0f b7 45 e2          	movzwl -0x1e(%ebp),%eax
  804e2f:	89 04 24             	mov    %eax,(%esp)
  804e32:	e8 bc 5e 00 00       	call   80acf3 <htons>
  804e37:	66 89 45 d2          	mov    %ax,-0x2e(%ebp)
  sin.sin_addr.s_addr = naddr.addr;
  804e3b:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  804e3e:	89 45 d4             	mov    %eax,-0x2c(%ebp)

  if (*addrlen > sizeof(sin))
  804e41:	8b 55 10             	mov    0x10(%ebp),%edx
  804e44:	83 3a 10             	cmpl   $0x10,(%edx)
  804e47:	76 06                	jbe    804e4f <lwip_accept+0xf8>
    *addrlen = sizeof(sin);
  804e49:	c7 02 10 00 00 00    	movl   $0x10,(%edx)

  SMEMCPY(addr, &sin, *addrlen);
  804e4f:	8b 55 10             	mov    0x10(%ebp),%edx
  804e52:	8b 02                	mov    (%edx),%eax
  804e54:	89 44 24 08          	mov    %eax,0x8(%esp)
  804e58:	8d 45 d0             	lea    -0x30(%ebp),%eax
  804e5b:	89 44 24 04          	mov    %eax,0x4(%esp)
  804e5f:	8b 45 0c             	mov    0xc(%ebp),%eax
  804e62:	89 04 24             	mov    %eax,(%esp)
  804e65:	e8 f7 c4 ff ff       	call   801361 <memcpy>

  newsock = alloc_socket(newconn);
  804e6a:	89 d8                	mov    %ebx,%eax
  804e6c:	e8 8c f0 ff ff       	call   803efd <alloc_socket>
  804e71:	89 c6                	mov    %eax,%esi
  if (newsock == -1) {
  804e73:	83 f8 ff             	cmp    $0xffffffff,%eax
  804e76:	75 1e                	jne    804e96 <lwip_accept+0x13f>
    netconn_delete(newconn);
  804e78:	89 1c 24             	mov    %ebx,(%esp)
  804e7b:	e8 fb 9c 00 00       	call   80eb7b <netconn_delete>
    sock_set_errno(sock, ENFILE);
  804e80:	c7 47 10 17 00 00 00 	movl   $0x17,0x10(%edi)
  804e87:	c7 05 a0 f5 b3 00 17 	movl   $0x17,0xb3f5a0
  804e8e:	00 00 00 
    return -1;
  804e91:	e9 8f 00 00 00       	jmp    804f25 <lwip_accept+0x1ce>
  }
  LWIP_ASSERT("invalid socket index", (newsock >= 0) && (newsock < NUM_SOCKETS));
  804e96:	83 fe 1f             	cmp    $0x1f,%esi
  804e99:	76 1c                	jbe    804eb7 <lwip_accept+0x160>
  804e9b:	c7 44 24 08 c1 2e 81 	movl   $0x812ec1,0x8(%esp)
  804ea2:	00 
  804ea3:	c7 44 24 04 25 01 00 	movl   $0x125,0x4(%esp)
  804eaa:	00 
  804eab:	c7 04 24 46 2e 81 00 	movl   $0x812e46,(%esp)
  804eb2:	e8 e5 ba ff ff       	call   80099c <_panic>
  newconn->callback = event_callback;
  804eb7:	c7 43 2c a6 3f 80 00 	movl   $0x803fa6,0x2c(%ebx)
  nsock = &sockets[newsock];
  804ebe:	8d 04 80             	lea    (%eax,%eax,4),%eax
  804ec1:	8d 04 85 20 94 81 00 	lea    0x819420(,%eax,4),%eax
  804ec8:	89 45 c4             	mov    %eax,-0x3c(%ebp)
  LWIP_ASSERT("invalid socket pointer", nsock != NULL);
  804ecb:	85 c0                	test   %eax,%eax
  804ecd:	75 1c                	jne    804eeb <lwip_accept+0x194>
  804ecf:	c7 44 24 08 d6 2e 81 	movl   $0x812ed6,0x8(%esp)
  804ed6:	00 
  804ed7:	c7 44 24 04 28 01 00 	movl   $0x128,0x4(%esp)
  804ede:	00 
  804edf:	c7 04 24 46 2e 81 00 	movl   $0x812e46,(%esp)
  804ee6:	e8 b1 ba ff ff       	call   80099c <_panic>

  sys_sem_wait(socksem);
  804eeb:	a1 a4 96 81 00       	mov    0x8196a4,%eax
  804ef0:	89 04 24             	mov    %eax,(%esp)
  804ef3:	e8 d2 36 00 00       	call   8085ca <sys_sem_wait>
  /* See event_callback: If data comes in right away after an accept, even
   * though the server task might not have created a new socket yet.
   * In that case, newconn->socket is counted down (newconn->socket--),
   * so nsock->rcvevent is >= 1 here!
   */
  nsock->rcvevent += -1 - newconn->socket;
  804ef8:	8b 43 1c             	mov    0x1c(%ebx),%eax
  804efb:	f7 d0                	not    %eax
  804efd:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  804f00:	66 01 42 0a          	add    %ax,0xa(%edx)
  newconn->socket = newsock;
  804f04:	89 73 1c             	mov    %esi,0x1c(%ebx)
  sys_sem_signal(socksem);
  804f07:	a1 a4 96 81 00       	mov    0x8196a4,%eax
  804f0c:	89 04 24             	mov    %eax,(%esp)
  804f0f:	e8 d3 8c 00 00       	call   80dbe7 <sys_sem_signal>

  LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_accept(%d) returning new sock=%d addr=", s, newsock));
  //ip_addr_debug_print(SOCKETS_DEBUG, &naddr);
  LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%u\n", port));

  sock_set_errno(sock, 0);
  804f14:	c7 47 10 00 00 00 00 	movl   $0x0,0x10(%edi)
  804f1b:	c7 05 a0 f5 b3 00 00 	movl   $0x0,0xb3f5a0
  804f22:	00 00 00 
  return newsock;
}
  804f25:	89 f0                	mov    %esi,%eax
  804f27:	83 c4 4c             	add    $0x4c,%esp
  804f2a:	5b                   	pop    %ebx
  804f2b:	5e                   	pop    %esi
  804f2c:	5f                   	pop    %edi
  804f2d:	5d                   	pop    %ebp
  804f2e:	c3                   	ret    
	...

00804f30 <pbuf_free_int>:
 *
 * @param p The pbuf (chain) to be dereferenced.
 */
static void
pbuf_free_int(void *p)
{
  804f30:	55                   	push   %ebp
  804f31:	89 e5                	mov    %esp,%ebp
  804f33:	83 ec 18             	sub    $0x18,%esp
  struct pbuf *q = p;
  pbuf_free(q);
  804f36:	8b 45 08             	mov    0x8(%ebp),%eax
  804f39:	89 04 24             	mov    %eax,(%esp)
  804f3c:	e8 bc 2f 00 00       	call   807efd <pbuf_free>
}
  804f41:	c9                   	leave  
  804f42:	c3                   	ret    

00804f43 <tcpip_init>:
 * @param initfunc a function to call when tcpip_thread is running and finished initializing
 * @param arg argument to pass to initfunc
 */
void
tcpip_init(void (* initfunc)(void *), void *arg)
{
  804f43:	55                   	push   %ebp
  804f44:	89 e5                	mov    %esp,%ebp
  804f46:	83 ec 28             	sub    $0x28,%esp
  lwip_init();
  804f49:	e8 62 08 00 00       	call   8057b0 <lwip_init>

  tcpip_init_done = initfunc;
  804f4e:	8b 45 08             	mov    0x8(%ebp),%eax
  804f51:	a3 ac 96 81 00       	mov    %eax,0x8196ac
  tcpip_init_done_arg = arg;
  804f56:	8b 45 0c             	mov    0xc(%ebp),%eax
  804f59:	a3 b0 96 81 00       	mov    %eax,0x8196b0
  mbox = sys_mbox_new(TCPIP_MBOX_SIZE);
  804f5e:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  804f65:	e8 65 8b 00 00       	call   80dacf <sys_mbox_new>
  804f6a:	a3 74 90 81 00       	mov    %eax,0x819074
#if LWIP_TCPIP_CORE_LOCKING
  lock_tcpip_core = sys_sem_new(1);
#endif /* LWIP_TCPIP_CORE_LOCKING */

  sys_thread_new(TCPIP_THREAD_NAME, tcpip_thread, NULL, TCPIP_THREAD_STACKSIZE, TCPIP_THREAD_PRIO);
  804f6f:	c7 44 24 10 01 00 00 	movl   $0x1,0x10(%esp)
  804f76:	00 
  804f77:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  804f7e:	00 
  804f7f:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  804f86:	00 
  804f87:	c7 44 24 04 e6 4f 80 	movl   $0x804fe6,0x4(%esp)
  804f8e:	00 
  804f8f:	c7 04 24 5c 2f 81 00 	movl   $0x812f5c,(%esp)
  804f96:	e8 9f 88 00 00       	call   80d83a <sys_thread_new>
}
  804f9b:	c9                   	leave  
  804f9c:	c3                   	ret    

00804f9d <tcp_timer_needed>:
 * the reason is to have the TCP timer only running when
 * there are active (or time-wait) PCBs.
 */
void
tcp_timer_needed(void)
{
  804f9d:	55                   	push   %ebp
  804f9e:	89 e5                	mov    %esp,%ebp
  804fa0:	83 ec 18             	sub    $0x18,%esp
  /* timer is off but needed again? */
  if (!tcpip_tcp_timer_active && (tcp_active_pcbs || tcp_tw_pcbs)) {
  804fa3:	83 3d b4 96 81 00 00 	cmpl   $0x0,0x8196b4
  804faa:	75 38                	jne    804fe4 <tcp_timer_needed+0x47>
  804fac:	83 3d 08 f6 b3 00 00 	cmpl   $0x0,0xb3f608
  804fb3:	75 09                	jne    804fbe <tcp_timer_needed+0x21>
  804fb5:	83 3d 1c f6 b3 00 00 	cmpl   $0x0,0xb3f61c
  804fbc:	74 26                	je     804fe4 <tcp_timer_needed+0x47>
    /* enable and start timer */
    tcpip_tcp_timer_active = 1;
  804fbe:	c7 05 b4 96 81 00 01 	movl   $0x1,0x8196b4
  804fc5:	00 00 00 
    sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL);
  804fc8:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  804fcf:	00 
  804fd0:	c7 44 24 04 01 54 80 	movl   $0x805401,0x4(%esp)
  804fd7:	00 
  804fd8:	c7 04 24 fa 00 00 00 	movl   $0xfa,(%esp)
  804fdf:	e8 16 35 00 00       	call   8084fa <sys_timeout>
  }
}
  804fe4:	c9                   	leave  
  804fe5:	c3                   	ret    

00804fe6 <tcpip_thread>:
 *
 * @param arg unused argument
 */
static void
tcpip_thread(void *arg)
{
  804fe6:	55                   	push   %ebp
  804fe7:	89 e5                	mov    %esp,%ebp
  804fe9:	53                   	push   %ebx
  804fea:	83 ec 24             	sub    $0x24,%esp
  struct tcpip_msg *msg;
  LWIP_UNUSED_ARG(arg);

#if IP_REASSEMBLY
  sys_timeout(IP_TMR_INTERVAL, ip_reass_timer, NULL);
  804fed:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  804ff4:	00 
  804ff5:	c7 44 24 04 de 51 80 	movl   $0x8051de,0x4(%esp)
  804ffc:	00 
  804ffd:	c7 04 24 e8 03 00 00 	movl   $0x3e8,(%esp)
  805004:	e8 f1 34 00 00       	call   8084fa <sys_timeout>
#endif /* IP_REASSEMBLY */
#if LWIP_ARP
  sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL);
  805009:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  805010:	00 
  805011:	c7 44 24 04 b5 51 80 	movl   $0x8051b5,0x4(%esp)
  805018:	00 
  805019:	c7 04 24 88 13 00 00 	movl   $0x1388,(%esp)
  805020:	e8 d5 34 00 00       	call   8084fa <sys_timeout>
#endif /* LWIP_ARP */
#if LWIP_DHCP
  sys_timeout(DHCP_COARSE_TIMER_MSECS, dhcp_timer_coarse, NULL);
  805025:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80502c:	00 
  80502d:	c7 44 24 04 8c 51 80 	movl   $0x80518c,0x4(%esp)
  805034:	00 
  805035:	c7 04 24 60 ea 00 00 	movl   $0xea60,(%esp)
  80503c:	e8 b9 34 00 00       	call   8084fa <sys_timeout>
  sys_timeout(DHCP_FINE_TIMER_MSECS, dhcp_timer_fine, NULL);
  805041:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  805048:	00 
  805049:	c7 44 24 04 63 51 80 	movl   $0x805163,0x4(%esp)
  805050:	00 
  805051:	c7 04 24 f4 01 00 00 	movl   $0x1f4,(%esp)
  805058:	e8 9d 34 00 00       	call   8084fa <sys_timeout>
#endif /* LWIP_IGMP */
#if LWIP_DNS
  sys_timeout(DNS_TMR_INTERVAL, dns_timer, NULL);
#endif /* LWIP_DNS */

  if (tcpip_init_done != NULL) {
  80505d:	a1 ac 96 81 00       	mov    0x8196ac,%eax
  805062:	85 c0                	test   %eax,%eax
  805064:	74 0b                	je     805071 <tcpip_thread+0x8b>
    tcpip_init_done(tcpip_init_done_arg);
  805066:	8b 15 b0 96 81 00    	mov    0x8196b0,%edx
  80506c:	89 14 24             	mov    %edx,(%esp)
  80506f:	ff d0                	call   *%eax
  }

  LOCK_TCPIP_CORE();
  while (1) {                          /* MAIN Loop */
    sys_mbox_fetch(mbox, (void *)&msg);
  805071:	8d 5d f4             	lea    -0xc(%ebp),%ebx
  805074:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  805078:	a1 74 90 81 00       	mov    0x819074,%eax
  80507d:	89 04 24             	mov    %eax,(%esp)
  805080:	e8 67 36 00 00       	call   8086ec <sys_mbox_fetch>
    switch (msg->type) {
  805085:	8b 45 f4             	mov    -0xc(%ebp),%eax
  805088:	8b 10                	mov    (%eax),%edx
  80508a:	83 fa 01             	cmp    $0x1,%edx
  80508d:	74 28                	je     8050b7 <tcpip_thread+0xd1>
  80508f:	83 fa 01             	cmp    $0x1,%edx
  805092:	72 16                	jb     8050aa <tcpip_thread+0xc4>
  805094:	83 fa 02             	cmp    $0x2,%edx
  805097:	74 5f                	je     8050f8 <tcpip_thread+0x112>
  805099:	83 fa 03             	cmp    $0x3,%edx
  80509c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  8050a0:	75 d2                	jne    805074 <tcpip_thread+0x8e>
  8050a2:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  8050a8:	eb 6f                	jmp    805119 <tcpip_thread+0x133>
#if LWIP_NETCONN
    case TCPIP_MSG_API:
      LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: API message %p\n", (void *)msg));
      msg->msg.apimsg->function(&(msg->msg.apimsg->msg));
  8050aa:	8b 40 08             	mov    0x8(%eax),%eax
  8050ad:	8d 50 04             	lea    0x4(%eax),%edx
  8050b0:	89 14 24             	mov    %edx,(%esp)
  8050b3:	ff 10                	call   *(%eax)
      break;
  8050b5:	eb bd                	jmp    805074 <tcpip_thread+0x8e>
#endif /* LWIP_NETCONN */

    case TCPIP_MSG_INPKT:
      LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: PACKET %p\n", (void *)msg));
#if LWIP_ARP
      if (msg->msg.inp.netif->flags & NETIF_FLAG_ETHARP) {
  8050b7:	8b 50 0c             	mov    0xc(%eax),%edx
  8050ba:	f6 42 2e 20          	testb  $0x20,0x2e(%edx)
  8050be:	74 11                	je     8050d1 <tcpip_thread+0xeb>
        ethernet_input(msg->msg.inp.p, msg->msg.inp.netif);
  8050c0:	89 54 24 04          	mov    %edx,0x4(%esp)
  8050c4:	8b 40 08             	mov    0x8(%eax),%eax
  8050c7:	89 04 24             	mov    %eax,(%esp)
  8050ca:	e8 78 83 00 00       	call   80d447 <ethernet_input>
  8050cf:	eb 0f                	jmp    8050e0 <tcpip_thread+0xfa>
      } else
#endif /* LWIP_ARP */
      { ip_input(msg->msg.inp.p, msg->msg.inp.netif);
  8050d1:	89 54 24 04          	mov    %edx,0x4(%esp)
  8050d5:	8b 40 08             	mov    0x8(%eax),%eax
  8050d8:	89 04 24             	mov    %eax,(%esp)
  8050db:	e8 d4 4a 00 00       	call   809bb4 <ip_input>
      }
      memp_free(MEMP_TCPIP_MSG_INPKT, msg);
  8050e0:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8050e3:	89 44 24 04          	mov    %eax,0x4(%esp)
  8050e7:	c7 04 24 09 00 00 00 	movl   $0x9,(%esp)
  8050ee:	e8 81 26 00 00       	call   807774 <memp_free>
      break;
  8050f3:	e9 7c ff ff ff       	jmp    805074 <tcpip_thread+0x8e>
      break;
#endif /* LWIP_NETIF_API */

    case TCPIP_MSG_CALLBACK:
      LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: CALLBACK %p\n", (void *)msg));
      msg->msg.cb.f(msg->msg.cb.ctx);
  8050f8:	8b 50 0c             	mov    0xc(%eax),%edx
  8050fb:	89 14 24             	mov    %edx,(%esp)
  8050fe:	ff 50 08             	call   *0x8(%eax)
      memp_free(MEMP_TCPIP_MSG_API, msg);
  805101:	8b 45 f4             	mov    -0xc(%ebp),%eax
  805104:	89 44 24 04          	mov    %eax,0x4(%esp)
  805108:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
  80510f:	e8 60 26 00 00       	call   807774 <memp_free>
      break;
  805114:	e9 5b ff ff ff       	jmp    805074 <tcpip_thread+0x8e>

    case TCPIP_MSG_TIMEOUT:
      LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: TIMEOUT %p\n", (void *)msg));

      if(msg->msg.tmo.msecs != 0xffffffff)
  805119:	8b 50 08             	mov    0x8(%eax),%edx
  80511c:	83 fa ff             	cmp    $0xffffffff,%edx
  80511f:	74 18                	je     805139 <tcpip_thread+0x153>
        sys_timeout (msg->msg.tmo.msecs, msg->msg.tmo.h, msg->msg.tmo.arg);
  805121:	8b 48 10             	mov    0x10(%eax),%ecx
  805124:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  805128:	8b 40 0c             	mov    0xc(%eax),%eax
  80512b:	89 44 24 04          	mov    %eax,0x4(%esp)
  80512f:	89 14 24             	mov    %edx,(%esp)
  805132:	e8 c3 33 00 00       	call   8084fa <sys_timeout>
  805137:	eb 12                	jmp    80514b <tcpip_thread+0x165>
      else
        sys_untimeout (msg->msg.tmo.h, msg->msg.tmo.arg);
  805139:	8b 50 10             	mov    0x10(%eax),%edx
  80513c:	89 54 24 04          	mov    %edx,0x4(%esp)
  805140:	8b 40 0c             	mov    0xc(%eax),%eax
  805143:	89 04 24             	mov    %eax,(%esp)
  805146:	e8 22 33 00 00       	call   80846d <sys_untimeout>
      memp_free(MEMP_TCPIP_MSG_API, msg);
  80514b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80514e:	89 44 24 04          	mov    %eax,0x4(%esp)
  805152:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
  805159:	e8 16 26 00 00       	call   807774 <memp_free>
  80515e:	e9 11 ff ff ff       	jmp    805074 <tcpip_thread+0x8e>

00805163 <dhcp_timer_fine>:
 *
 * @param arg unused argument
 */
static void
dhcp_timer_fine(void *arg)
{
  805163:	55                   	push   %ebp
  805164:	89 e5                	mov    %esp,%ebp
  805166:	83 ec 18             	sub    $0x18,%esp
  LWIP_UNUSED_ARG(arg);
  LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip: dhcp_fine_tmr()\n"));
  dhcp_fine_tmr();
  805169:	e8 f4 1e 00 00       	call   807062 <dhcp_fine_tmr>
  sys_timeout(DHCP_FINE_TIMER_MSECS, dhcp_timer_fine, NULL);
  80516e:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  805175:	00 
  805176:	c7 44 24 04 63 51 80 	movl   $0x805163,0x4(%esp)
  80517d:	00 
  80517e:	c7 04 24 f4 01 00 00 	movl   $0x1f4,(%esp)
  805185:	e8 70 33 00 00       	call   8084fa <sys_timeout>
}
  80518a:	c9                   	leave  
  80518b:	c3                   	ret    

0080518c <dhcp_timer_coarse>:
 *
 * @param arg unused argument
 */
static void
dhcp_timer_coarse(void *arg)
{
  80518c:	55                   	push   %ebp
  80518d:	89 e5                	mov    %esp,%ebp
  80518f:	83 ec 18             	sub    $0x18,%esp
  LWIP_UNUSED_ARG(arg);
  LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip: dhcp_coarse_tmr()\n"));
  dhcp_coarse_tmr();
  805192:	e8 92 12 00 00       	call   806429 <dhcp_coarse_tmr>
  sys_timeout(DHCP_COARSE_TIMER_MSECS, dhcp_timer_coarse, NULL);
  805197:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80519e:	00 
  80519f:	c7 44 24 04 8c 51 80 	movl   $0x80518c,0x4(%esp)
  8051a6:	00 
  8051a7:	c7 04 24 60 ea 00 00 	movl   $0xea60,(%esp)
  8051ae:	e8 47 33 00 00       	call   8084fa <sys_timeout>
}
  8051b3:	c9                   	leave  
  8051b4:	c3                   	ret    

008051b5 <arp_timer>:
 *
 * @param arg unused argument
 */
static void
arp_timer(void *arg)
{
  8051b5:	55                   	push   %ebp
  8051b6:	89 e5                	mov    %esp,%ebp
  8051b8:	83 ec 18             	sub    $0x18,%esp
  LWIP_UNUSED_ARG(arg);
  LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip: etharp_tmr()\n"));
  etharp_tmr();
  8051bb:	e8 59 7e 00 00       	call   80d019 <etharp_tmr>
  sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL);
  8051c0:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  8051c7:	00 
  8051c8:	c7 44 24 04 b5 51 80 	movl   $0x8051b5,0x4(%esp)
  8051cf:	00 
  8051d0:	c7 04 24 88 13 00 00 	movl   $0x1388,(%esp)
  8051d7:	e8 1e 33 00 00       	call   8084fa <sys_timeout>
}
  8051dc:	c9                   	leave  
  8051dd:	c3                   	ret    

008051de <ip_reass_timer>:
 *
 * @param arg unused argument
 */
static void
ip_reass_timer(void *arg)
{
  8051de:	55                   	push   %ebp
  8051df:	89 e5                	mov    %esp,%ebp
  8051e1:	83 ec 18             	sub    $0x18,%esp
  LWIP_UNUSED_ARG(arg);
  LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip: ip_reass_tmr()\n"));
  ip_reass_tmr();
  8051e4:	e8 a8 50 00 00       	call   80a291 <ip_reass_tmr>
  sys_timeout(IP_TMR_INTERVAL, ip_reass_timer, NULL);
  8051e9:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  8051f0:	00 
  8051f1:	c7 44 24 04 de 51 80 	movl   $0x8051de,0x4(%esp)
  8051f8:	00 
  8051f9:	c7 04 24 e8 03 00 00 	movl   $0x3e8,(%esp)
  805200:	e8 f5 32 00 00       	call   8084fa <sys_timeout>
}
  805205:	c9                   	leave  
  805206:	c3                   	ret    

00805207 <tcpip_apimsg>:
 * @param apimsg a struct containing the function to call and its parameters
 * @return ERR_OK if the function was called, another err_t if not
 */
err_t
tcpip_apimsg(struct api_msg *apimsg)
{
  805207:	55                   	push   %ebp
  805208:	89 e5                	mov    %esp,%ebp
  80520a:	53                   	push   %ebx
  80520b:	83 ec 34             	sub    $0x34,%esp
  80520e:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct tcpip_msg msg;
  
  if (mbox != SYS_MBOX_NULL) {
  805211:	8b 15 74 90 81 00    	mov    0x819074,%edx
  805217:	b8 f7 ff ff ff       	mov    $0xfffffff7,%eax
  80521c:	83 fa ff             	cmp    $0xffffffff,%edx
  80521f:	74 34                	je     805255 <tcpip_apimsg+0x4e>
    msg.type = TCPIP_MSG_API;
  805221:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
    msg.msg.apimsg = apimsg;
  805228:	89 5d ec             	mov    %ebx,-0x14(%ebp)
    sys_mbox_post(mbox, &msg);
  80522b:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80522e:	89 44 24 04          	mov    %eax,0x4(%esp)
  805232:	89 14 24             	mov    %edx,(%esp)
  805235:	e8 2b 8c 00 00       	call   80de65 <sys_mbox_post>
    sys_arch_sem_wait(apimsg->msg.conn->op_completed, 0);
  80523a:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  805241:	00 
  805242:	8b 43 04             	mov    0x4(%ebx),%eax
  805245:	8b 40 10             	mov    0x10(%eax),%eax
  805248:	89 04 24             	mov    %eax,(%esp)
  80524b:	e8 a6 86 00 00       	call   80d8f6 <sys_arch_sem_wait>
  805250:	b8 00 00 00 00       	mov    $0x0,%eax
    return ERR_OK;
  }
  return ERR_VAL;
}
  805255:	83 c4 34             	add    $0x34,%esp
  805258:	5b                   	pop    %ebx
  805259:	5d                   	pop    %ebp
  80525a:	c3                   	ret    

0080525b <tcpip_timeout>:
  return ERR_VAL;
}

err_t
tcpip_timeout(u32_t msecs, sys_timeout_handler h, void *arg)
{
  80525b:	55                   	push   %ebp
  80525c:	89 e5                	mov    %esp,%ebp
  80525e:	83 ec 18             	sub    $0x18,%esp
  struct tcpip_msg *msg;

  if (mbox != SYS_MBOX_NULL) {
  805261:	b8 f7 ff ff ff       	mov    $0xfffffff7,%eax
  805266:	83 3d 74 90 81 00 ff 	cmpl   $0xffffffff,0x819074
  80526d:	74 45                	je     8052b4 <tcpip_timeout+0x59>
    msg = memp_malloc(MEMP_TCPIP_MSG_API);
  80526f:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
  805276:	e8 3d 25 00 00       	call   8077b8 <memp_malloc>
  80527b:	89 c2                	mov    %eax,%edx
    if (msg == NULL) {
  80527d:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  805282:	85 d2                	test   %edx,%edx
  805284:	74 2e                	je     8052b4 <tcpip_timeout+0x59>
      return ERR_MEM;
    }

    msg->type = TCPIP_MSG_TIMEOUT;
  805286:	c7 02 03 00 00 00    	movl   $0x3,(%edx)
    msg->msg.tmo.msecs = msecs;
  80528c:	8b 45 08             	mov    0x8(%ebp),%eax
  80528f:	89 42 08             	mov    %eax,0x8(%edx)
    msg->msg.tmo.h = h;
  805292:	8b 45 0c             	mov    0xc(%ebp),%eax
  805295:	89 42 0c             	mov    %eax,0xc(%edx)
    msg->msg.tmo.arg = arg;
  805298:	8b 45 10             	mov    0x10(%ebp),%eax
  80529b:	89 42 10             	mov    %eax,0x10(%edx)
    sys_mbox_post(mbox, msg);
  80529e:	89 54 24 04          	mov    %edx,0x4(%esp)
  8052a2:	a1 74 90 81 00       	mov    0x819074,%eax
  8052a7:	89 04 24             	mov    %eax,(%esp)
  8052aa:	e8 b6 8b 00 00       	call   80de65 <sys_mbox_post>
  8052af:	b8 00 00 00 00       	mov    $0x0,%eax
    return ERR_OK;
  }
  return ERR_VAL;
}
  8052b4:	c9                   	leave  
  8052b5:	c3                   	ret    

008052b6 <tcpip_callback_with_block>:
 * @param block 1 to block until the request is posted, 0 to non-blocking mode
 * @return ERR_OK if the function was called, another err_t if not
 */
err_t
tcpip_callback_with_block(void (*f)(void *ctx), void *ctx, u8_t block)
{
  8052b6:	55                   	push   %ebp
  8052b7:	89 e5                	mov    %esp,%ebp
  8052b9:	83 ec 18             	sub    $0x18,%esp
  8052bc:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  8052bf:	89 75 fc             	mov    %esi,-0x4(%ebp)
  8052c2:	0f b6 5d 10          	movzbl 0x10(%ebp),%ebx
  struct tcpip_msg *msg;

  if (mbox != SYS_MBOX_NULL) {
  8052c6:	b8 f7 ff ff ff       	mov    $0xfffffff7,%eax
  8052cb:	83 3d 74 90 81 00 ff 	cmpl   $0xffffffff,0x819074
  8052d2:	74 6f                	je     805343 <tcpip_callback_with_block+0x8d>
    msg = memp_malloc(MEMP_TCPIP_MSG_API);
  8052d4:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
  8052db:	e8 d8 24 00 00       	call   8077b8 <memp_malloc>
  8052e0:	89 c6                	mov    %eax,%esi
    if (msg == NULL) {
  8052e2:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  8052e7:	85 f6                	test   %esi,%esi
  8052e9:	74 58                	je     805343 <tcpip_callback_with_block+0x8d>
      return ERR_MEM;
    }

    msg->type = TCPIP_MSG_CALLBACK;
  8052eb:	c7 06 02 00 00 00    	movl   $0x2,(%esi)
    msg->msg.cb.f = f;
  8052f1:	8b 45 08             	mov    0x8(%ebp),%eax
  8052f4:	89 46 08             	mov    %eax,0x8(%esi)
    msg->msg.cb.ctx = ctx;
  8052f7:	8b 45 0c             	mov    0xc(%ebp),%eax
  8052fa:	89 46 0c             	mov    %eax,0xc(%esi)
    if (block) {
  8052fd:	84 db                	test   %bl,%bl
  8052ff:	74 18                	je     805319 <tcpip_callback_with_block+0x63>
      sys_mbox_post(mbox, msg);
  805301:	89 74 24 04          	mov    %esi,0x4(%esp)
  805305:	a1 74 90 81 00       	mov    0x819074,%eax
  80530a:	89 04 24             	mov    %eax,(%esp)
  80530d:	e8 53 8b 00 00       	call   80de65 <sys_mbox_post>
  805312:	b8 00 00 00 00       	mov    $0x0,%eax
  805317:	eb 2a                	jmp    805343 <tcpip_callback_with_block+0x8d>
    } else {
      if (sys_mbox_trypost(mbox, msg) != ERR_OK) {
  805319:	89 74 24 04          	mov    %esi,0x4(%esp)
  80531d:	a1 74 90 81 00       	mov    0x819074,%eax
  805322:	89 04 24             	mov    %eax,(%esp)
  805325:	e8 6d 8a 00 00       	call   80dd97 <sys_mbox_trypost>
  80532a:	84 c0                	test   %al,%al
  80532c:	74 15                	je     805343 <tcpip_callback_with_block+0x8d>
        memp_free(MEMP_TCPIP_MSG_API, msg);
  80532e:	89 74 24 04          	mov    %esi,0x4(%esp)
  805332:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
  805339:	e8 36 24 00 00       	call   807774 <memp_free>
  80533e:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
      }
    }
    return ERR_OK;
  }
  return ERR_VAL;
}
  805343:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  805346:	8b 75 fc             	mov    -0x4(%ebp),%esi
  805349:	89 ec                	mov    %ebp,%esp
  80534b:	5d                   	pop    %ebp
  80534c:	c3                   	ret    

0080534d <mem_free_callback>:
 * @param m the heap memory to free
 * @return ERR_OK if callback could be enqueued, an err_t if not
 */
err_t
mem_free_callback(void *m)
{
  80534d:	55                   	push   %ebp
  80534e:	89 e5                	mov    %esp,%ebp
  805350:	83 ec 18             	sub    $0x18,%esp
  return tcpip_callback_with_block(mem_free, m, 0);
  805353:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80535a:	00 
  80535b:	8b 45 08             	mov    0x8(%ebp),%eax
  80535e:	89 44 24 04          	mov    %eax,0x4(%esp)
  805362:	c7 04 24 f5 74 80 00 	movl   $0x8074f5,(%esp)
  805369:	e8 48 ff ff ff       	call   8052b6 <tcpip_callback_with_block>
}
  80536e:	c9                   	leave  
  80536f:	c3                   	ret    

00805370 <pbuf_free_callback>:
 * @param p The pbuf (chain) to be dereferenced.
 * @return ERR_OK if callback could be enqueued, an err_t if not
 */
err_t
pbuf_free_callback(struct pbuf *p)
{
  805370:	55                   	push   %ebp
  805371:	89 e5                	mov    %esp,%ebp
  805373:	83 ec 18             	sub    $0x18,%esp
  return tcpip_callback_with_block(pbuf_free_int, p, 0);
  805376:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80537d:	00 
  80537e:	8b 45 08             	mov    0x8(%ebp),%eax
  805381:	89 44 24 04          	mov    %eax,0x4(%esp)
  805385:	c7 04 24 30 4f 80 00 	movl   $0x804f30,(%esp)
  80538c:	e8 25 ff ff ff       	call   8052b6 <tcpip_callback_with_block>
}
  805391:	c9                   	leave  
  805392:	c3                   	ret    

00805393 <tcpip_input>:
 *          to an IP header (if netif doesn't got NETIF_FLAG_ETHARP flag)
 * @param inp the network interface on which the packet was received
 */
err_t
tcpip_input(struct pbuf *p, struct netif *inp)
{
  805393:	55                   	push   %ebp
  805394:	89 e5                	mov    %esp,%ebp
  805396:	53                   	push   %ebx
  805397:	83 ec 14             	sub    $0x14,%esp
  struct tcpip_msg *msg;

  if (mbox != SYS_MBOX_NULL) {
  80539a:	b8 f7 ff ff ff       	mov    $0xfffffff7,%eax
  80539f:	83 3d 74 90 81 00 ff 	cmpl   $0xffffffff,0x819074
  8053a6:	74 53                	je     8053fb <tcpip_input+0x68>
    msg = memp_malloc(MEMP_TCPIP_MSG_INPKT);
  8053a8:	c7 04 24 09 00 00 00 	movl   $0x9,(%esp)
  8053af:	e8 04 24 00 00       	call   8077b8 <memp_malloc>
  8053b4:	89 c3                	mov    %eax,%ebx
    if (msg == NULL) {
  8053b6:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  8053bb:	85 db                	test   %ebx,%ebx
  8053bd:	74 3c                	je     8053fb <tcpip_input+0x68>
      return ERR_MEM;
    }

    msg->type = TCPIP_MSG_INPKT;
  8053bf:	c7 03 01 00 00 00    	movl   $0x1,(%ebx)
    msg->msg.inp.p = p;
  8053c5:	8b 45 08             	mov    0x8(%ebp),%eax
  8053c8:	89 43 08             	mov    %eax,0x8(%ebx)
    msg->msg.inp.netif = inp;
  8053cb:	8b 45 0c             	mov    0xc(%ebp),%eax
  8053ce:	89 43 0c             	mov    %eax,0xc(%ebx)
    if (sys_mbox_trypost(mbox, msg) != ERR_OK) {
  8053d1:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  8053d5:	a1 74 90 81 00       	mov    0x819074,%eax
  8053da:	89 04 24             	mov    %eax,(%esp)
  8053dd:	e8 b5 89 00 00       	call   80dd97 <sys_mbox_trypost>
  8053e2:	84 c0                	test   %al,%al
  8053e4:	74 15                	je     8053fb <tcpip_input+0x68>
      memp_free(MEMP_TCPIP_MSG_INPKT, msg);
  8053e6:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  8053ea:	c7 04 24 09 00 00 00 	movl   $0x9,(%esp)
  8053f1:	e8 7e 23 00 00       	call   807774 <memp_free>
  8053f6:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
      return ERR_MEM;
    }
    return ERR_OK;
  }
  return ERR_VAL;
}
  8053fb:	83 c4 14             	add    $0x14,%esp
  8053fe:	5b                   	pop    %ebx
  8053ff:	5d                   	pop    %ebp
  805400:	c3                   	ret    

00805401 <tcpip_tcp_timer>:
 *
 * @param arg unused argument
 */
static void
tcpip_tcp_timer(void *arg)
{
  805401:	55                   	push   %ebp
  805402:	89 e5                	mov    %esp,%ebp
  805404:	83 ec 18             	sub    $0x18,%esp
  LWIP_UNUSED_ARG(arg);

  /* call TCP timer handler */
  tcp_tmr();
  805407:	e8 2a 43 00 00       	call   809736 <tcp_tmr>
  /* timer still needed? */
  if (tcp_active_pcbs || tcp_tw_pcbs) {
  80540c:	83 3d 08 f6 b3 00 00 	cmpl   $0x0,0xb3f608
  805413:	75 09                	jne    80541e <tcpip_tcp_timer+0x1d>
  805415:	83 3d 1c f6 b3 00 00 	cmpl   $0x0,0xb3f61c
  80541c:	74 1e                	je     80543c <tcpip_tcp_timer+0x3b>
    /* restart timer */
    sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL);
  80541e:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  805425:	00 
  805426:	c7 44 24 04 01 54 80 	movl   $0x805401,0x4(%esp)
  80542d:	00 
  80542e:	c7 04 24 fa 00 00 00 	movl   $0xfa,(%esp)
  805435:	e8 c0 30 00 00       	call   8084fa <sys_timeout>
  LWIP_UNUSED_ARG(arg);

  /* call TCP timer handler */
  tcp_tmr();
  /* timer still needed? */
  if (tcp_active_pcbs || tcp_tw_pcbs) {
  80543a:	eb 0a                	jmp    805446 <tcpip_tcp_timer+0x45>
    /* restart timer */
    sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL);
  } else {
    /* disable timer */
    tcpip_tcp_timer_active = 0;
  80543c:	c7 05 b4 96 81 00 00 	movl   $0x0,0x8196b4
  805443:	00 00 00 
  }
}
  805446:	c9                   	leave  
  805447:	c3                   	ret    

00805448 <netbuf_first>:
 *
 * @param buf the netbuf to modify
 */
void
netbuf_first(struct netbuf *buf)
{
  805448:	55                   	push   %ebp
  805449:	89 e5                	mov    %esp,%ebp
  80544b:	83 ec 18             	sub    $0x18,%esp
  80544e:	8b 45 08             	mov    0x8(%ebp),%eax
  LWIP_ERROR("netbuf_free: invalid buf", (buf != NULL), return;);
  805451:	85 c0                	test   %eax,%eax
  805453:	75 1c                	jne    805471 <netbuf_first+0x29>
  805455:	c7 44 24 08 69 2f 81 	movl   $0x812f69,0x8(%esp)
  80545c:	00 
  80545d:	c7 44 24 04 e7 00 00 	movl   $0xe7,0x4(%esp)
  805464:	00 
  805465:	c7 04 24 82 2f 81 00 	movl   $0x812f82,(%esp)
  80546c:	e8 2b b5 ff ff       	call   80099c <_panic>
  buf->ptr = buf->p;
  805471:	8b 10                	mov    (%eax),%edx
  805473:	89 50 04             	mov    %edx,0x4(%eax)
}
  805476:	c9                   	leave  
  805477:	c3                   	ret    

00805478 <netbuf_next>:
 *         1  if moved to the next part but now there is no next part
 *         0  if moved to the next part and there are still more parts
 */
s8_t
netbuf_next(struct netbuf *buf)
{
  805478:	55                   	push   %ebp
  805479:	89 e5                	mov    %esp,%ebp
  80547b:	83 ec 18             	sub    $0x18,%esp
  80547e:	8b 55 08             	mov    0x8(%ebp),%edx
  LWIP_ERROR("netbuf_free: invalid buf", (buf != NULL), return -1;);
  805481:	85 d2                	test   %edx,%edx
  805483:	75 1c                	jne    8054a1 <netbuf_next+0x29>
  805485:	c7 44 24 08 69 2f 81 	movl   $0x812f69,0x8(%esp)
  80548c:	00 
  80548d:	c7 44 24 04 d2 00 00 	movl   $0xd2,0x4(%esp)
  805494:	00 
  805495:	c7 04 24 82 2f 81 00 	movl   $0x812f82,(%esp)
  80549c:	e8 fb b4 ff ff       	call   80099c <_panic>
  if (buf->ptr->next == NULL) {
  8054a1:	8b 42 04             	mov    0x4(%edx),%eax
  8054a4:	8b 08                	mov    (%eax),%ecx
  8054a6:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  8054ab:	85 c9                	test   %ecx,%ecx
  8054ad:	74 09                	je     8054b8 <netbuf_next+0x40>
    return -1;
  }
  buf->ptr = buf->ptr->next;
  8054af:	89 4a 04             	mov    %ecx,0x4(%edx)
  8054b2:	83 39 00             	cmpl   $0x0,(%ecx)
  8054b5:	0f 94 c0             	sete   %al
  if (buf->ptr->next == NULL) {
    return 1;
  }
  return 0;
}
  8054b8:	c9                   	leave  
  8054b9:	c3                   	ret    

008054ba <netbuf_data>:
 * @return ERR_OK if the information was retreived,
 *         ERR_BUF on error.
 */
err_t
netbuf_data(struct netbuf *buf, void **dataptr, u16_t *len)
{
  8054ba:	55                   	push   %ebp
  8054bb:	89 e5                	mov    %esp,%ebp
  8054bd:	56                   	push   %esi
  8054be:	53                   	push   %ebx
  8054bf:	83 ec 10             	sub    $0x10,%esp
  8054c2:	8b 55 08             	mov    0x8(%ebp),%edx
  8054c5:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  8054c8:	8b 4d 10             	mov    0x10(%ebp),%ecx
  LWIP_ERROR("netbuf_data: invalid buf", (buf != NULL), return ERR_ARG;);
  8054cb:	85 d2                	test   %edx,%edx
  8054cd:	75 1c                	jne    8054eb <netbuf_data+0x31>
  8054cf:	c7 44 24 08 98 2f 81 	movl   $0x812f98,0x8(%esp)
  8054d6:	00 
  8054d7:	c7 44 24 04 b9 00 00 	movl   $0xb9,0x4(%esp)
  8054de:	00 
  8054df:	c7 04 24 82 2f 81 00 	movl   $0x812f82,(%esp)
  8054e6:	e8 b1 b4 ff ff       	call   80099c <_panic>
  LWIP_ERROR("netbuf_data: invalid dataptr", (dataptr != NULL), return ERR_ARG;);
  8054eb:	85 db                	test   %ebx,%ebx
  8054ed:	75 1c                	jne    80550b <netbuf_data+0x51>
  8054ef:	c7 44 24 08 b1 2f 81 	movl   $0x812fb1,0x8(%esp)
  8054f6:	00 
  8054f7:	c7 44 24 04 ba 00 00 	movl   $0xba,0x4(%esp)
  8054fe:	00 
  8054ff:	c7 04 24 82 2f 81 00 	movl   $0x812f82,(%esp)
  805506:	e8 91 b4 ff ff       	call   80099c <_panic>
  LWIP_ERROR("netbuf_data: invalid len", (len != NULL), return ERR_ARG;);
  80550b:	85 c9                	test   %ecx,%ecx
  80550d:	75 1c                	jne    80552b <netbuf_data+0x71>
  80550f:	c7 44 24 08 ce 2f 81 	movl   $0x812fce,0x8(%esp)
  805516:	00 
  805517:	c7 44 24 04 bb 00 00 	movl   $0xbb,0x4(%esp)
  80551e:	00 
  80551f:	c7 04 24 82 2f 81 00 	movl   $0x812f82,(%esp)
  805526:	e8 71 b4 ff ff       	call   80099c <_panic>

  if (buf->ptr == NULL) {
  80552b:	8b 72 04             	mov    0x4(%edx),%esi
  80552e:	b8 fe ff ff ff       	mov    $0xfffffffe,%eax
  805533:	85 f6                	test   %esi,%esi
  805535:	74 14                	je     80554b <netbuf_data+0x91>
    return ERR_BUF;
  }
  *dataptr = buf->ptr->payload;
  805537:	8b 46 04             	mov    0x4(%esi),%eax
  80553a:	89 03                	mov    %eax,(%ebx)
  *len = buf->ptr->len;
  80553c:	8b 42 04             	mov    0x4(%edx),%eax
  80553f:	0f b7 40 0a          	movzwl 0xa(%eax),%eax
  805543:	66 89 01             	mov    %ax,(%ecx)
  805546:	b8 00 00 00 00       	mov    $0x0,%eax
  return ERR_OK;
}
  80554b:	83 c4 10             	add    $0x10,%esp
  80554e:	5b                   	pop    %ebx
  80554f:	5e                   	pop    %esi
  805550:	5d                   	pop    %ebp
  805551:	c3                   	ret    

00805552 <netbuf_chain>:
 * @param head the first netbuf
 * @param tail netbuf to chain after head
 */
void
netbuf_chain(struct netbuf *head, struct netbuf *tail)
{
  805552:	55                   	push   %ebp
  805553:	89 e5                	mov    %esp,%ebp
  805555:	83 ec 18             	sub    $0x18,%esp
  805558:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  80555b:	89 75 fc             	mov    %esi,-0x4(%ebp)
  80555e:	8b 5d 08             	mov    0x8(%ebp),%ebx
  805561:	8b 75 0c             	mov    0xc(%ebp),%esi
  LWIP_ERROR("netbuf_ref: invalid head", (head != NULL), return;);
  805564:	85 db                	test   %ebx,%ebx
  805566:	75 1c                	jne    805584 <netbuf_chain+0x32>
  805568:	c7 44 24 08 e7 2f 81 	movl   $0x812fe7,0x8(%esp)
  80556f:	00 
  805570:	c7 44 24 04 a6 00 00 	movl   $0xa6,0x4(%esp)
  805577:	00 
  805578:	c7 04 24 82 2f 81 00 	movl   $0x812f82,(%esp)
  80557f:	e8 18 b4 ff ff       	call   80099c <_panic>
  LWIP_ERROR("netbuf_chain: invalid tail", (tail != NULL), return;);
  805584:	85 f6                	test   %esi,%esi
  805586:	75 1c                	jne    8055a4 <netbuf_chain+0x52>
  805588:	c7 44 24 08 00 30 81 	movl   $0x813000,0x8(%esp)
  80558f:	00 
  805590:	c7 44 24 04 a7 00 00 	movl   $0xa7,0x4(%esp)
  805597:	00 
  805598:	c7 04 24 82 2f 81 00 	movl   $0x812f82,(%esp)
  80559f:	e8 f8 b3 ff ff       	call   80099c <_panic>
  pbuf_chain(head->p, tail->p);
  8055a4:	8b 06                	mov    (%esi),%eax
  8055a6:	89 44 24 04          	mov    %eax,0x4(%esp)
  8055aa:	8b 03                	mov    (%ebx),%eax
  8055ac:	89 04 24             	mov    %eax,(%esp)
  8055af:	e8 b8 25 00 00       	call   807b6c <pbuf_chain>
  head->ptr = head->p;
  8055b4:	8b 03                	mov    (%ebx),%eax
  8055b6:	89 43 04             	mov    %eax,0x4(%ebx)
  memp_free(MEMP_NETBUF, tail);
  8055b9:	89 74 24 04          	mov    %esi,0x4(%esp)
  8055bd:	c7 04 24 06 00 00 00 	movl   $0x6,(%esp)
  8055c4:	e8 ab 21 00 00       	call   807774 <memp_free>
}
  8055c9:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  8055cc:	8b 75 fc             	mov    -0x4(%ebp),%esi
  8055cf:	89 ec                	mov    %ebp,%esp
  8055d1:	5d                   	pop    %ebp
  8055d2:	c3                   	ret    

008055d3 <netbuf_free>:
 *
 * @param buf pointer to the netbuf which contains the packet buffer to free
 */
void
netbuf_free(struct netbuf *buf)
{
  8055d3:	55                   	push   %ebp
  8055d4:	89 e5                	mov    %esp,%ebp
  8055d6:	53                   	push   %ebx
  8055d7:	83 ec 14             	sub    $0x14,%esp
  8055da:	8b 5d 08             	mov    0x8(%ebp),%ebx
  LWIP_ERROR("netbuf_free: invalid buf", (buf != NULL), return;);
  8055dd:	85 db                	test   %ebx,%ebx
  8055df:	75 1c                	jne    8055fd <netbuf_free+0x2a>
  8055e1:	c7 44 24 08 69 2f 81 	movl   $0x812f69,0x8(%esp)
  8055e8:	00 
  8055e9:	c7 44 24 04 7b 00 00 	movl   $0x7b,0x4(%esp)
  8055f0:	00 
  8055f1:	c7 04 24 82 2f 81 00 	movl   $0x812f82,(%esp)
  8055f8:	e8 9f b3 ff ff       	call   80099c <_panic>
  if (buf->p != NULL) {
  8055fd:	8b 03                	mov    (%ebx),%eax
  8055ff:	85 c0                	test   %eax,%eax
  805601:	74 08                	je     80560b <netbuf_free+0x38>
    pbuf_free(buf->p);
  805603:	89 04 24             	mov    %eax,(%esp)
  805606:	e8 f2 28 00 00       	call   807efd <pbuf_free>
  }
  buf->p = buf->ptr = NULL;
  80560b:	c7 43 04 00 00 00 00 	movl   $0x0,0x4(%ebx)
  805612:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
}
  805618:	83 c4 14             	add    $0x14,%esp
  80561b:	5b                   	pop    %ebx
  80561c:	5d                   	pop    %ebp
  80561d:	c3                   	ret    

0080561e <netbuf_delete>:
 *
 * @param buf pointer to a netbuf allocated by netbuf_new()
 */
void
netbuf_delete(struct netbuf *buf)
{
  80561e:	55                   	push   %ebp
  80561f:	89 e5                	mov    %esp,%ebp
  805621:	53                   	push   %ebx
  805622:	83 ec 14             	sub    $0x14,%esp
  805625:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if (buf != NULL) {
  805628:	85 db                	test   %ebx,%ebx
  80562a:	74 2b                	je     805657 <netbuf_delete+0x39>
    if (buf->p != NULL) {
  80562c:	8b 03                	mov    (%ebx),%eax
  80562e:	85 c0                	test   %eax,%eax
  805630:	74 15                	je     805647 <netbuf_delete+0x29>
      pbuf_free(buf->p);
  805632:	89 04 24             	mov    %eax,(%esp)
  805635:	e8 c3 28 00 00       	call   807efd <pbuf_free>
      buf->p = buf->ptr = NULL;
  80563a:	c7 43 04 00 00 00 00 	movl   $0x0,0x4(%ebx)
  805641:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
    }
    memp_free(MEMP_NETBUF, buf);
  805647:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  80564b:	c7 04 24 06 00 00 00 	movl   $0x6,(%esp)
  805652:	e8 1d 21 00 00       	call   807774 <memp_free>
  }
}
  805657:	83 c4 14             	add    $0x14,%esp
  80565a:	5b                   	pop    %ebx
  80565b:	5d                   	pop    %ebp
  80565c:	c3                   	ret    

0080565d <netbuf_ref>:
 * @return ERR_OK if data is referenced
 *         ERR_MEM if data couldn't be referenced due to lack of memory
 */
err_t
netbuf_ref(struct netbuf *buf, const void *dataptr, u16_t size)
{
  80565d:	55                   	push   %ebp
  80565e:	89 e5                	mov    %esp,%ebp
  805660:	56                   	push   %esi
  805661:	53                   	push   %ebx
  805662:	83 ec 10             	sub    $0x10,%esp
  805665:	8b 5d 08             	mov    0x8(%ebp),%ebx
  805668:	0f b7 75 10          	movzwl 0x10(%ebp),%esi
  LWIP_ERROR("netbuf_ref: invalid buf", (buf != NULL), return ERR_ARG;);
  80566c:	85 db                	test   %ebx,%ebx
  80566e:	75 1c                	jne    80568c <netbuf_ref+0x2f>
  805670:	c7 44 24 08 1b 30 81 	movl   $0x81301b,0x8(%esp)
  805677:	00 
  805678:	c7 44 24 04 8e 00 00 	movl   $0x8e,0x4(%esp)
  80567f:	00 
  805680:	c7 04 24 82 2f 81 00 	movl   $0x812f82,(%esp)
  805687:	e8 10 b3 ff ff       	call   80099c <_panic>
  if (buf->p != NULL) {
  80568c:	8b 03                	mov    (%ebx),%eax
  80568e:	85 c0                	test   %eax,%eax
  805690:	74 08                	je     80569a <netbuf_ref+0x3d>
    pbuf_free(buf->p);
  805692:	89 04 24             	mov    %eax,(%esp)
  805695:	e8 63 28 00 00       	call   807efd <pbuf_free>
  }
  buf->p = pbuf_alloc(PBUF_TRANSPORT, 0, PBUF_REF);
  80569a:	c7 44 24 08 02 00 00 	movl   $0x2,0x8(%esp)
  8056a1:	00 
  8056a2:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  8056a9:	00 
  8056aa:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  8056b1:	e8 03 2b 00 00       	call   8081b9 <pbuf_alloc>
  8056b6:	89 03                	mov    %eax,(%ebx)
  if (buf->p == NULL) {
  8056b8:	85 c0                	test   %eax,%eax
  8056ba:	75 0e                	jne    8056ca <netbuf_ref+0x6d>
    buf->ptr = NULL;
  8056bc:	c7 43 04 00 00 00 00 	movl   $0x0,0x4(%ebx)
  8056c3:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
    return ERR_MEM;
  8056c8:	eb 1a                	jmp    8056e4 <netbuf_ref+0x87>
  }
  buf->p->payload = (void*)dataptr;
  8056ca:	8b 55 0c             	mov    0xc(%ebp),%edx
  8056cd:	89 50 04             	mov    %edx,0x4(%eax)
  buf->p->len = buf->p->tot_len = size;
  8056d0:	8b 03                	mov    (%ebx),%eax
  8056d2:	66 89 70 08          	mov    %si,0x8(%eax)
  8056d6:	66 89 70 0a          	mov    %si,0xa(%eax)
  buf->ptr = buf->p;
  8056da:	8b 03                	mov    (%ebx),%eax
  8056dc:	89 43 04             	mov    %eax,0x4(%ebx)
  8056df:	b8 00 00 00 00       	mov    $0x0,%eax
  return ERR_OK;
}
  8056e4:	83 c4 10             	add    $0x10,%esp
  8056e7:	5b                   	pop    %ebx
  8056e8:	5e                   	pop    %esi
  8056e9:	5d                   	pop    %ebp
  8056ea:	c3                   	ret    

008056eb <netbuf_alloc>:
 * @return pointer to the allocated memory
 *         NULL if no memory could be allocated
 */
void *
netbuf_alloc(struct netbuf *buf, u16_t size)
{
  8056eb:	55                   	push   %ebp
  8056ec:	89 e5                	mov    %esp,%ebp
  8056ee:	56                   	push   %esi
  8056ef:	53                   	push   %ebx
  8056f0:	83 ec 10             	sub    $0x10,%esp
  8056f3:	8b 5d 08             	mov    0x8(%ebp),%ebx
  8056f6:	0f b7 75 0c          	movzwl 0xc(%ebp),%esi
  LWIP_ERROR("netbuf_alloc: invalid buf", (buf != NULL), return NULL;);
  8056fa:	85 db                	test   %ebx,%ebx
  8056fc:	75 1c                	jne    80571a <netbuf_alloc+0x2f>
  8056fe:	c7 44 24 08 33 30 81 	movl   $0x813033,0x8(%esp)
  805705:	00 
  805706:	c7 44 24 04 63 00 00 	movl   $0x63,0x4(%esp)
  80570d:	00 
  80570e:	c7 04 24 82 2f 81 00 	movl   $0x812f82,(%esp)
  805715:	e8 82 b2 ff ff       	call   80099c <_panic>

  /* Deallocate any previously allocated memory. */
  if (buf->p != NULL) {
  80571a:	8b 03                	mov    (%ebx),%eax
  80571c:	85 c0                	test   %eax,%eax
  80571e:	74 08                	je     805728 <netbuf_alloc+0x3d>
    pbuf_free(buf->p);
  805720:	89 04 24             	mov    %eax,(%esp)
  805723:	e8 d5 27 00 00       	call   807efd <pbuf_free>
  }
  buf->p = pbuf_alloc(PBUF_TRANSPORT, size, PBUF_RAM);
  805728:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80572f:	00 
  805730:	0f b7 c6             	movzwl %si,%eax
  805733:	89 44 24 04          	mov    %eax,0x4(%esp)
  805737:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80573e:	e8 76 2a 00 00       	call   8081b9 <pbuf_alloc>
  805743:	89 03                	mov    %eax,(%ebx)
  if (buf->p == NULL) {
  805745:	ba 00 00 00 00       	mov    $0x0,%edx
  80574a:	85 c0                	test   %eax,%eax
  80574c:	74 28                	je     805776 <netbuf_alloc+0x8b>
     return NULL;
  }
  LWIP_ASSERT("check that first pbuf can hold size",
  80574e:	66 3b 70 0a          	cmp    0xa(%eax),%si
  805752:	76 1c                	jbe    805770 <netbuf_alloc+0x85>
  805754:	c7 44 24 08 50 30 81 	movl   $0x813050,0x8(%esp)
  80575b:	00 
  80575c:	c7 44 24 04 6e 00 00 	movl   $0x6e,0x4(%esp)
  805763:	00 
  805764:	c7 04 24 82 2f 81 00 	movl   $0x812f82,(%esp)
  80576b:	e8 2c b2 ff ff       	call   80099c <_panic>
             (buf->p->len >= size));
  buf->ptr = buf->p;
  805770:	89 43 04             	mov    %eax,0x4(%ebx)
  return buf->p->payload;
  805773:	8b 50 04             	mov    0x4(%eax),%edx
}
  805776:	89 d0                	mov    %edx,%eax
  805778:	83 c4 10             	add    $0x10,%esp
  80577b:	5b                   	pop    %ebx
  80577c:	5e                   	pop    %esi
  80577d:	5d                   	pop    %ebp
  80577e:	c3                   	ret    

0080577f <netbuf_new>:
 * @return a pointer to a new netbuf
 *         NULL on lack of memory
 */
struct
netbuf *netbuf_new(void)
{
  80577f:	55                   	push   %ebp
  805780:	89 e5                	mov    %esp,%ebp
  805782:	83 ec 18             	sub    $0x18,%esp
  struct netbuf *buf;

  buf = memp_malloc(MEMP_NETBUF);
  805785:	c7 04 24 06 00 00 00 	movl   $0x6,(%esp)
  80578c:	e8 27 20 00 00       	call   8077b8 <memp_malloc>
  if (buf != NULL) {
  805791:	85 c0                	test   %eax,%eax
  805793:	74 14                	je     8057a9 <netbuf_new+0x2a>
    buf->p = NULL;
  805795:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
    buf->ptr = NULL;
  80579b:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
    buf->addr = NULL;
  8057a2:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)
    return buf;
  } else {
    return NULL;
  }
}
  8057a9:	c9                   	leave  
  8057aa:	c3                   	ret    
  8057ab:	00 00                	add    %al,(%eax)
  8057ad:	00 00                	add    %al,(%eax)
	...

008057b0 <lwip_init>:
/**
 * Perform Sanity check of user-configurable values, and initialize all modules.
 */
void
lwip_init(void)
{
  8057b0:	55                   	push   %ebp
  8057b1:	89 e5                	mov    %esp,%ebp
  8057b3:	83 ec 08             	sub    $0x8,%esp
  /* Sanity check user-configurable values */
  lwip_sanity_check();

  /* Modules initialization */
  stats_init();
  sys_init();
  8057b6:	e8 35 7d 00 00       	call   80d4f0 <sys_init>
  mem_init();
  8057bb:	e8 d3 1e 00 00       	call   807693 <mem_init>
  memp_init();
  8057c0:	e8 2b 1f 00 00       	call   8076f0 <memp_init>
  pbuf_init();
  netif_init();
#if LWIP_SOCKET
  lwip_socket_init();
  8057c5:	e8 6e e9 ff ff       	call   804138 <lwip_socket_init>
  igmp_init();
#endif /* LWIP_IGMP */
#if LWIP_DNS
  dns_init();
#endif /* LWIP_DNS */
}
  8057ca:	c9                   	leave  
  8057cb:	c3                   	ret    
  8057cc:	00 00                	add    %al,(%eax)
	...

008057d0 <dhcp_set_state>:
 *
 * TODO: we might also want to reset the timeout here?
 */
static void
dhcp_set_state(struct dhcp *dhcp, u8_t new_state)
{
  8057d0:	55                   	push   %ebp
  8057d1:	89 e5                	mov    %esp,%ebp
  if (new_state != dhcp->state) {
  8057d3:	38 10                	cmp    %dl,(%eax)
  8057d5:	74 06                	je     8057dd <dhcp_set_state+0xd>
    dhcp->state = new_state;
  8057d7:	88 10                	mov    %dl,(%eax)
    dhcp->tries = 0;
  8057d9:	c6 40 01 00          	movb   $0x0,0x1(%eax)
  }
}
  8057dd:	5d                   	pop    %ebp
  8057de:	c3                   	ret    

008057df <dhcp_get_option_ptr>:
 *
 * @return a byte offset into the UDP message where the option was found, or
 * zero if the given option was not found.
 */
static u8_t *dhcp_get_option_ptr(struct dhcp *dhcp, u8_t option_type)
{
  8057df:	55                   	push   %ebp
  8057e0:	89 e5                	mov    %esp,%ebp
  8057e2:	57                   	push   %edi
  8057e3:	56                   	push   %esi
  8057e4:	53                   	push   %ebx
  8057e5:	83 ec 08             	sub    $0x8,%esp
  8057e8:	88 55 f3             	mov    %dl,-0xd(%ebp)
  u8_t overload = DHCP_OVERLOAD_NONE;

  /* options available? */
  if ((dhcp->options_in != NULL) && (dhcp->options_in_len > 0)) {
  8057eb:	8b 70 14             	mov    0x14(%eax),%esi
  8057ee:	85 f6                	test   %esi,%esi
  8057f0:	0f 84 e6 00 00 00    	je     8058dc <dhcp_get_option_ptr+0xfd>
  8057f6:	0f b7 78 18          	movzwl 0x18(%eax),%edi
  8057fa:	66 85 ff             	test   %di,%di
  8057fd:	0f 84 d9 00 00 00    	je     8058dc <dhcp_get_option_ptr+0xfd>
    /* start with options field */
    u8_t *options = (u8_t *)dhcp->options_in;
    u16_t offset = 0;
    /* at least 1 byte to read and no end marker, then at least 3 bytes to read? */
    while ((offset < dhcp->options_in_len) && (options[offset] != DHCP_OPTION_END)) {
  805803:	0f b6 0e             	movzbl (%esi),%ecx
  805806:	80 f9 ff             	cmp    $0xff,%cl
  805809:	0f 84 cd 00 00 00    	je     8058dc <dhcp_get_option_ptr+0xfd>
  80580f:	89 f3                	mov    %esi,%ebx
  805811:	ba 00 00 00 00       	mov    $0x0,%edx
  805816:	c6 45 f2 00          	movb   $0x0,-0xe(%ebp)
      /* LWIP_DEBUGF(DHCP_DEBUG, ("msg_offset=%"U16_F", q->len=%"U16_F, msg_offset, q->len)); */
      /* are the sname and/or file field overloaded with options? */
      if (options[offset] == DHCP_OPTION_OVERLOAD) {
  80581a:	80 f9 34             	cmp    $0x34,%cl
  80581d:	75 12                	jne    805831 <dhcp_get_option_ptr+0x52>
        LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 2, ("overloaded message detected\n"));
        /* skip option type and length */
        offset += 2;
  80581f:	8d 4a 02             	lea    0x2(%edx),%ecx
        overload = options[offset++];
  805822:	0f b7 c9             	movzwl %cx,%ecx
  805825:	0f b6 0c 0e          	movzbl (%esi,%ecx,1),%ecx
  805829:	88 4d f2             	mov    %cl,-0xe(%ebp)
  80582c:	83 c2 03             	add    $0x3,%edx
  80582f:	eb 17                	jmp    805848 <dhcp_get_option_ptr+0x69>
      }
      /* requested option found */
      else if (options[offset] == option_type) {
  805831:	3a 4d f3             	cmp    -0xd(%ebp),%cl
  805834:	0f 84 a7 00 00 00    	je     8058e1 <dhcp_get_option_ptr+0x102>
        return &options[offset];
      /* skip option */
      } else {
         LWIP_DEBUGF(DHCP_DEBUG, ("skipping option %"U16_F" in options\n", options[offset]));
        /* skip option type */
        offset++;
  80583a:	8d 4a 01             	lea    0x1(%edx),%ecx
        /* skip option length, and then length bytes */
        offset += 1 + options[offset];
  80583d:	0f b7 c9             	movzwl %cx,%ecx
  805840:	0f b6 0c 0e          	movzbl (%esi,%ecx,1),%ecx
  805844:	8d 54 0a 02          	lea    0x2(%edx,%ecx,1),%edx
  if ((dhcp->options_in != NULL) && (dhcp->options_in_len > 0)) {
    /* start with options field */
    u8_t *options = (u8_t *)dhcp->options_in;
    u16_t offset = 0;
    /* at least 1 byte to read and no end marker, then at least 3 bytes to read? */
    while ((offset < dhcp->options_in_len) && (options[offset] != DHCP_OPTION_END)) {
  805848:	66 39 d7             	cmp    %dx,%di
  80584b:	76 0e                	jbe    80585b <dhcp_get_option_ptr+0x7c>
  80584d:	0f b7 da             	movzwl %dx,%ebx
  805850:	8d 1c 1e             	lea    (%esi,%ebx,1),%ebx
  805853:	0f b6 0b             	movzbl (%ebx),%ecx
  805856:	80 f9 ff             	cmp    $0xff,%cl
  805859:	75 bf                	jne    80581a <dhcp_get_option_ptr+0x3b>
        /* skip option length, and then length bytes */
        offset += 1 + options[offset];
      }
    }
    /* is this an overloaded message? */
    if (overload != DHCP_OVERLOAD_NONE) {
  80585b:	80 7d f2 00          	cmpb   $0x0,-0xe(%ebp)
  80585f:	74 7b                	je     8058dc <dhcp_get_option_ptr+0xfd>
      u16_t field_len;
      if (overload == DHCP_OVERLOAD_FILE) {
  805861:	80 7d f2 01          	cmpb   $0x1,-0xe(%ebp)
  805865:	75 0d                	jne    805874 <dhcp_get_option_ptr+0x95>
        LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 1, ("overloaded file field\n"));
        options = (u8_t *)&dhcp->msg_in->file;
  805867:	8b 58 10             	mov    0x10(%eax),%ebx
  80586a:	83 c3 6c             	add    $0x6c,%ebx
  80586d:	b9 80 00 00 00       	mov    $0x80,%ecx
  805872:	eb 1e                	jmp    805892 <dhcp_get_option_ptr+0xb3>
        field_len = DHCP_FILE_LEN;
      } else if (overload == DHCP_OVERLOAD_SNAME) {
  805874:	80 7d f2 02          	cmpb   $0x2,-0xe(%ebp)
  805878:	75 0d                	jne    805887 <dhcp_get_option_ptr+0xa8>
        LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 1, ("overloaded sname field\n"));
        options = (u8_t *)&dhcp->msg_in->sname;
  80587a:	8b 58 10             	mov    0x10(%eax),%ebx
  80587d:	83 c3 2c             	add    $0x2c,%ebx
  805880:	b9 40 00 00 00       	mov    $0x40,%ecx
  805885:	eb 0b                	jmp    805892 <dhcp_get_option_ptr+0xb3>
        field_len = DHCP_SNAME_LEN;
      /* TODO: check if else if () is necessary */
      } else {
        LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 1, ("overloaded sname and file field\n"));
        options = (u8_t *)&dhcp->msg_in->sname;
  805887:	8b 58 10             	mov    0x10(%eax),%ebx
  80588a:	83 c3 2c             	add    $0x2c,%ebx
  80588d:	b9 c0 00 00 00       	mov    $0xc0,%ecx
        field_len = DHCP_FILE_LEN + DHCP_SNAME_LEN;
      }
      offset = 0;

      /* at least 1 byte to read and no end marker */
      while ((offset < field_len) && (options[offset] != DHCP_OPTION_END)) {
  805892:	0f b6 13             	movzbl (%ebx),%edx
  805895:	80 fa ff             	cmp    $0xff,%dl
  805898:	74 42                	je     8058dc <dhcp_get_option_ptr+0xfd>
        if (options[offset] == option_type) {
  80589a:	b8 00 00 00 00       	mov    $0x0,%eax
  80589f:	38 55 f3             	cmp    %dl,-0xd(%ebp)
  8058a2:	75 0e                	jne    8058b2 <dhcp_get_option_ptr+0xd3>
  8058a4:	eb 3b                	jmp    8058e1 <dhcp_get_option_ptr+0x102>
  8058a6:	89 f9                	mov    %edi,%ecx
  8058a8:	38 d1                	cmp    %dl,%cl
  8058aa:	75 0e                	jne    8058ba <dhcp_get_option_ptr+0xdb>
  8058ac:	89 f3                	mov    %esi,%ebx
  8058ae:	66 90                	xchg   %ax,%ax
  8058b0:	eb 2f                	jmp    8058e1 <dhcp_get_option_ptr+0x102>
  8058b2:	66 89 4d ee          	mov    %cx,-0x12(%ebp)
  8058b6:	0f b6 7d f3          	movzbl -0xd(%ebp),%edi
          return &options[offset];
        /* skip option */
        } else {
          LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("skipping option %"U16_F"\n", options[offset]));
          /* skip option type */
          offset++;
  8058ba:	8d 50 01             	lea    0x1(%eax),%edx
          offset += 1 + options[offset];
  8058bd:	0f b7 d2             	movzwl %dx,%edx
  8058c0:	0f b6 14 13          	movzbl (%ebx,%edx,1),%edx
  8058c4:	8d 44 02 02          	lea    0x2(%edx,%eax,1),%eax
        field_len = DHCP_FILE_LEN + DHCP_SNAME_LEN;
      }
      offset = 0;

      /* at least 1 byte to read and no end marker */
      while ((offset < field_len) && (options[offset] != DHCP_OPTION_END)) {
  8058c8:	66 39 45 ee          	cmp    %ax,-0x12(%ebp)
  8058cc:	76 0e                	jbe    8058dc <dhcp_get_option_ptr+0xfd>
  8058ce:	0f b7 f0             	movzwl %ax,%esi
  8058d1:	8d 34 33             	lea    (%ebx,%esi,1),%esi
  8058d4:	0f b6 16             	movzbl (%esi),%edx
  8058d7:	80 fa ff             	cmp    $0xff,%dl
  8058da:	75 ca                	jne    8058a6 <dhcp_get_option_ptr+0xc7>
  8058dc:	bb 00 00 00 00       	mov    $0x0,%ebx
        }
      }
    }
  }
  return NULL;
}
  8058e1:	89 d8                	mov    %ebx,%eax
  8058e3:	83 c4 08             	add    $0x8,%esp
  8058e6:	5b                   	pop    %ebx
  8058e7:	5e                   	pop    %esi
  8058e8:	5f                   	pop    %edi
  8058e9:	5d                   	pop    %ebp
  8058ea:	c3                   	ret    

008058eb <dhcp_get_option_byte>:
 *
 * @return byte value at the given address.
 */
static u8_t
dhcp_get_option_byte(u8_t *ptr)
{
  8058eb:	55                   	push   %ebp
  8058ec:	89 e5                	mov    %esp,%ebp
  8058ee:	0f b6 00             	movzbl (%eax),%eax
  LWIP_DEBUGF(DHCP_DEBUG, ("option byte value=%"U16_F"\n", (u16_t)(*ptr)));
  return *ptr;
}
  8058f1:	5d                   	pop    %ebp
  8058f2:	c3                   	ret    

008058f3 <dhcp_get_option_long>:
 * @param ptr pointer obtained by dhcp_get_option_ptr().
 *
 * @return byte value at the given address.
 */
static u32_t dhcp_get_option_long(u8_t *ptr)
{
  8058f3:	55                   	push   %ebp
  8058f4:	89 e5                	mov    %esp,%ebp
  8058f6:	53                   	push   %ebx
  u32_t value;
  value = (u32_t)(*ptr++) << 24;
  8058f7:	0f b6 10             	movzbl (%eax),%edx
  8058fa:	c1 e2 18             	shl    $0x18,%edx
  value |= (u32_t)(*ptr++) << 16;
  8058fd:	0f b6 58 01          	movzbl 0x1(%eax),%ebx
  805901:	c1 e3 10             	shl    $0x10,%ebx
  805904:	09 d3                	or     %edx,%ebx
  805906:	8d 50 02             	lea    0x2(%eax),%edx
  value |= (u32_t)(*ptr++) << 8;
  805909:	0f b6 0a             	movzbl (%edx),%ecx
  80590c:	c1 e1 08             	shl    $0x8,%ecx
  80590f:	89 d8                	mov    %ebx,%eax
  805911:	09 c8                	or     %ecx,%eax
  805913:	0f b6 52 01          	movzbl 0x1(%edx),%edx
  805917:	09 d0                	or     %edx,%eax
  value |= (u32_t)(*ptr++);
  LWIP_DEBUGF(DHCP_DEBUG, ("option long value=%"U32_F"\n", value));
  return value;
}
  805919:	5b                   	pop    %ebx
  80591a:	5d                   	pop    %ebp
  80591b:	c3                   	ret    

0080591c <dhcp_option>:
 * DHCP message.
 *
 */
static void
dhcp_option(struct dhcp *dhcp, u8_t option_type, u8_t option_len)
{
  80591c:	55                   	push   %ebp
  80591d:	89 e5                	mov    %esp,%ebp
  80591f:	83 ec 28             	sub    $0x28,%esp
  805922:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  805925:	89 75 f8             	mov    %esi,-0x8(%ebp)
  805928:	89 7d fc             	mov    %edi,-0x4(%ebp)
  LWIP_ASSERT("dhcp_option: dhcp->options_out_len + 2 + option_len <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 2U + option_len <= DHCP_OPTIONS_LEN);
  80592b:	0f b7 58 24          	movzwl 0x24(%eax),%ebx
  80592f:	0f b7 fb             	movzwl %bx,%edi
  805932:	0f b6 f1             	movzbl %cl,%esi
  805935:	8d 74 37 02          	lea    0x2(%edi,%esi,1),%esi
  805939:	83 fe 44             	cmp    $0x44,%esi
  80593c:	76 1c                	jbe    80595a <dhcp_option+0x3e>
  80593e:	c7 44 24 08 74 30 81 	movl   $0x813074,0x8(%esp)
  805945:	00 
  805946:	c7 44 24 04 5a 04 00 	movl   $0x45a,0x4(%esp)
  80594d:	00 
  80594e:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  805955:	e8 42 b0 ff ff       	call   80099c <_panic>
  dhcp->msg_out->options[dhcp->options_out_len++] = option_type;
  80595a:	8b 78 20             	mov    0x20(%eax),%edi
  80595d:	0f b7 f3             	movzwl %bx,%esi
  805960:	88 94 37 f0 00 00 00 	mov    %dl,0xf0(%edi,%esi,1)
  805967:	8d 53 01             	lea    0x1(%ebx),%edx
  dhcp->msg_out->options[dhcp->options_out_len++] = option_len;
  80596a:	8b 70 20             	mov    0x20(%eax),%esi
  80596d:	0f b7 d2             	movzwl %dx,%edx
  805970:	88 8c 16 f0 00 00 00 	mov    %cl,0xf0(%esi,%edx,1)
  805977:	83 c3 02             	add    $0x2,%ebx
  80597a:	66 89 58 24          	mov    %bx,0x24(%eax)
}
  80597e:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  805981:	8b 75 f8             	mov    -0x8(%ebp),%esi
  805984:	8b 7d fc             	mov    -0x4(%ebp),%edi
  805987:	89 ec                	mov    %ebp,%esp
  805989:	5d                   	pop    %ebp
  80598a:	c3                   	ret    

0080598b <dhcp_option_byte>:
 * Concatenate a single byte to the outgoing DHCP message.
 *
 */
static void
dhcp_option_byte(struct dhcp *dhcp, u8_t value)
{
  80598b:	55                   	push   %ebp
  80598c:	89 e5                	mov    %esp,%ebp
  80598e:	83 ec 18             	sub    $0x18,%esp
  805991:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  805994:	89 75 fc             	mov    %esi,-0x4(%ebp)
  LWIP_ASSERT("dhcp_option_byte: dhcp->options_out_len < DHCP_OPTIONS_LEN", dhcp->options_out_len < DHCP_OPTIONS_LEN);
  805997:	0f b7 48 24          	movzwl 0x24(%eax),%ecx
  80599b:	66 83 f9 43          	cmp    $0x43,%cx
  80599f:	76 1c                	jbe    8059bd <dhcp_option_byte+0x32>
  8059a1:	c7 44 24 08 bc 30 81 	movl   $0x8130bc,0x8(%esp)
  8059a8:	00 
  8059a9:	c7 44 24 04 65 04 00 	movl   $0x465,0x4(%esp)
  8059b0:	00 
  8059b1:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  8059b8:	e8 df af ff ff       	call   80099c <_panic>
  dhcp->msg_out->options[dhcp->options_out_len++] = value;
  8059bd:	8b 70 20             	mov    0x20(%eax),%esi
  8059c0:	0f b7 d9             	movzwl %cx,%ebx
  8059c3:	88 94 1e f0 00 00 00 	mov    %dl,0xf0(%esi,%ebx,1)
  8059ca:	83 c1 01             	add    $0x1,%ecx
  8059cd:	66 89 48 24          	mov    %cx,0x24(%eax)
}
  8059d1:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  8059d4:	8b 75 fc             	mov    -0x4(%ebp),%esi
  8059d7:	89 ec                	mov    %ebp,%esp
  8059d9:	5d                   	pop    %ebp
  8059da:	c3                   	ret    

008059db <dhcp_option_trailer>:
 *
 * @param dhcp DHCP state structure
 */
static void
dhcp_option_trailer(struct dhcp *dhcp)
{
  8059db:	55                   	push   %ebp
  8059dc:	89 e5                	mov    %esp,%ebp
  8059de:	53                   	push   %ebx
  8059df:	83 ec 14             	sub    $0x14,%esp
  LWIP_ERROR("dhcp_option_trailer: dhcp != NULL", (dhcp != NULL), return;);
  8059e2:	85 c0                	test   %eax,%eax
  8059e4:	75 1c                	jne    805a02 <dhcp_option_trailer+0x27>
  8059e6:	c7 44 24 08 f8 30 81 	movl   $0x8130f8,0x8(%esp)
  8059ed:	00 
  8059ee:	c7 44 24 04 80 05 00 	movl   $0x580,0x4(%esp)
  8059f5:	00 
  8059f6:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  8059fd:	e8 9a af ff ff       	call   80099c <_panic>
  LWIP_ASSERT("dhcp_option_trailer: dhcp->msg_out != NULL\n", dhcp->msg_out != NULL);
  805a02:	8b 48 20             	mov    0x20(%eax),%ecx
  805a05:	85 c9                	test   %ecx,%ecx
  805a07:	75 1c                	jne    805a25 <dhcp_option_trailer+0x4a>
  805a09:	c7 44 24 08 1c 31 81 	movl   $0x81311c,0x8(%esp)
  805a10:	00 
  805a11:	c7 44 24 04 81 05 00 	movl   $0x581,0x4(%esp)
  805a18:	00 
  805a19:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  805a20:	e8 77 af ff ff       	call   80099c <_panic>
  LWIP_ASSERT("dhcp_option_trailer: dhcp->options_out_len < DHCP_OPTIONS_LEN\n", dhcp->options_out_len < DHCP_OPTIONS_LEN);
  805a25:	0f b7 50 24          	movzwl 0x24(%eax),%edx
  805a29:	66 83 fa 43          	cmp    $0x43,%dx
  805a2d:	76 1c                	jbe    805a4b <dhcp_option_trailer+0x70>
  805a2f:	c7 44 24 08 48 31 81 	movl   $0x813148,0x8(%esp)
  805a36:	00 
  805a37:	c7 44 24 04 82 05 00 	movl   $0x582,0x4(%esp)
  805a3e:	00 
  805a3f:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  805a46:	e8 51 af ff ff       	call   80099c <_panic>
  dhcp->msg_out->options[dhcp->options_out_len++] = DHCP_OPTION_END;
  805a4b:	0f b7 da             	movzwl %dx,%ebx
  805a4e:	c6 84 19 f0 00 00 00 	movb   $0xff,0xf0(%ecx,%ebx,1)
  805a55:	ff 
  805a56:	83 c2 01             	add    $0x1,%edx
  805a59:	66 89 50 24          	mov    %dx,0x24(%eax)
  /* packet is too small, or not 4 byte aligned? */
  while ((dhcp->options_out_len < DHCP_MIN_OPTIONS_LEN) || (dhcp->options_out_len & 3)) {
  805a5d:	eb 31                	jmp    805a90 <dhcp_option_trailer+0xb5>
    /* LWIP_DEBUGF(DHCP_DEBUG,("dhcp_option_trailer:dhcp->options_out_len=%"U16_F", DHCP_OPTIONS_LEN=%"U16_F, dhcp->options_out_len, DHCP_OPTIONS_LEN)); */
    LWIP_ASSERT("dhcp_option_trailer: dhcp->options_out_len < DHCP_OPTIONS_LEN\n", dhcp->options_out_len < DHCP_OPTIONS_LEN);
  805a5f:	c7 44 24 08 48 31 81 	movl   $0x813148,0x8(%esp)
  805a66:	00 
  805a67:	c7 44 24 04 87 05 00 	movl   $0x587,0x4(%esp)
  805a6e:	00 
  805a6f:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  805a76:	e8 21 af ff ff       	call   80099c <_panic>
    /* add a fill/padding byte */
    dhcp->msg_out->options[dhcp->options_out_len++] = 0;
  805a7b:	8b 58 20             	mov    0x20(%eax),%ebx
  805a7e:	0f b7 ca             	movzwl %dx,%ecx
  805a81:	c6 84 0b f0 00 00 00 	movb   $0x0,0xf0(%ebx,%ecx,1)
  805a88:	00 
  805a89:	83 c2 01             	add    $0x1,%edx
  805a8c:	66 89 50 24          	mov    %dx,0x24(%eax)
  LWIP_ERROR("dhcp_option_trailer: dhcp != NULL", (dhcp != NULL), return;);
  LWIP_ASSERT("dhcp_option_trailer: dhcp->msg_out != NULL\n", dhcp->msg_out != NULL);
  LWIP_ASSERT("dhcp_option_trailer: dhcp->options_out_len < DHCP_OPTIONS_LEN\n", dhcp->options_out_len < DHCP_OPTIONS_LEN);
  dhcp->msg_out->options[dhcp->options_out_len++] = DHCP_OPTION_END;
  /* packet is too small, or not 4 byte aligned? */
  while ((dhcp->options_out_len < DHCP_MIN_OPTIONS_LEN) || (dhcp->options_out_len & 3)) {
  805a90:	0f b7 50 24          	movzwl 0x24(%eax),%edx
  805a94:	66 83 fa 43          	cmp    $0x43,%dx
  805a98:	76 e1                	jbe    805a7b <dhcp_option_trailer+0xa0>
  805a9a:	f6 c2 03             	test   $0x3,%dl
  805a9d:	75 c0                	jne    805a5f <dhcp_option_trailer+0x84>
    /* LWIP_DEBUGF(DHCP_DEBUG,("dhcp_option_trailer:dhcp->options_out_len=%"U16_F", DHCP_OPTIONS_LEN=%"U16_F, dhcp->options_out_len, DHCP_OPTIONS_LEN)); */
    LWIP_ASSERT("dhcp_option_trailer: dhcp->options_out_len < DHCP_OPTIONS_LEN\n", dhcp->options_out_len < DHCP_OPTIONS_LEN);
    /* add a fill/padding byte */
    dhcp->msg_out->options[dhcp->options_out_len++] = 0;
  }
}
  805a9f:	83 c4 14             	add    $0x14,%esp
  805aa2:	5b                   	pop    %ebx
  805aa3:	5d                   	pop    %ebp
  805aa4:	c3                   	ret    

00805aa5 <dhcp_option_short>:
  dhcp->msg_out->options[dhcp->options_out_len++] = value;
}

static void
dhcp_option_short(struct dhcp *dhcp, u16_t value)
{
  805aa5:	55                   	push   %ebp
  805aa6:	89 e5                	mov    %esp,%ebp
  805aa8:	83 ec 48             	sub    $0x48,%esp
  805aab:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  805aae:	89 75 f8             	mov    %esi,-0x8(%ebp)
  805ab1:	89 7d fc             	mov    %edi,-0x4(%ebp)
  LWIP_ASSERT("dhcp_option_short: dhcp->options_out_len + 2 <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 2U <= DHCP_OPTIONS_LEN);
  805ab4:	0f b7 48 24          	movzwl 0x24(%eax),%ecx
  805ab8:	0f b7 d9             	movzwl %cx,%ebx
  805abb:	83 c3 02             	add    $0x2,%ebx
  805abe:	83 fb 44             	cmp    $0x44,%ebx
  805ac1:	76 1c                	jbe    805adf <dhcp_option_short+0x3a>
  805ac3:	c7 44 24 08 88 31 81 	movl   $0x813188,0x8(%esp)
  805aca:	00 
  805acb:	c7 44 24 04 6c 04 00 	movl   $0x46c,0x4(%esp)
  805ad2:	00 
  805ad3:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  805ada:	e8 bd ae ff ff       	call   80099c <_panic>
  dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0xff00U) >> 8);
  805adf:	0f b7 d9             	movzwl %cx,%ebx
  805ae2:	89 5d e4             	mov    %ebx,-0x1c(%ebp)
  805ae5:	89 d6                	mov    %edx,%esi
  805ae7:	66 c1 ee 08          	shr    $0x8,%si
  805aeb:	66 89 75 d6          	mov    %si,-0x2a(%ebp)
  805aef:	0f b6 5d d6          	movzbl -0x2a(%ebp),%ebx
  805af3:	8b 78 20             	mov    0x20(%eax),%edi
  805af6:	8b 75 e4             	mov    -0x1c(%ebp),%esi
  805af9:	88 9c 37 f0 00 00 00 	mov    %bl,0xf0(%edi,%esi,1)
  805b00:	8d 59 01             	lea    0x1(%ecx),%ebx
  dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t) (value & 0x00ffU);
  805b03:	8b 70 20             	mov    0x20(%eax),%esi
  805b06:	0f b7 db             	movzwl %bx,%ebx
  805b09:	88 94 1e f0 00 00 00 	mov    %dl,0xf0(%esi,%ebx,1)
  805b10:	83 c1 02             	add    $0x2,%ecx
  805b13:	66 89 48 24          	mov    %cx,0x24(%eax)
}
  805b17:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  805b1a:	8b 75 f8             	mov    -0x8(%ebp),%esi
  805b1d:	8b 7d fc             	mov    -0x4(%ebp),%edi
  805b20:	89 ec                	mov    %ebp,%esp
  805b22:	5d                   	pop    %ebp
  805b23:	c3                   	ret    

00805b24 <dhcp_option_long>:

static void
dhcp_option_long(struct dhcp *dhcp, u32_t value)
{
  805b24:	55                   	push   %ebp
  805b25:	89 e5                	mov    %esp,%ebp
  805b27:	83 ec 48             	sub    $0x48,%esp
  805b2a:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  805b2d:	89 75 f8             	mov    %esi,-0x8(%ebp)
  805b30:	89 7d fc             	mov    %edi,-0x4(%ebp)
  LWIP_ASSERT("dhcp_option_long: dhcp->options_out_len + 4 <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 4U <= DHCP_OPTIONS_LEN);
  805b33:	0f b7 48 24          	movzwl 0x24(%eax),%ecx
  805b37:	0f b7 d9             	movzwl %cx,%ebx
  805b3a:	83 c3 04             	add    $0x4,%ebx
  805b3d:	83 fb 44             	cmp    $0x44,%ebx
  805b40:	76 1c                	jbe    805b5e <dhcp_option_long+0x3a>
  805b42:	c7 44 24 08 cc 31 81 	movl   $0x8131cc,0x8(%esp)
  805b49:	00 
  805b4a:	c7 44 24 04 74 04 00 	movl   $0x474,0x4(%esp)
  805b51:	00 
  805b52:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  805b59:	e8 3e ae ff ff       	call   80099c <_panic>
  dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0xff000000UL) >> 24);
  805b5e:	0f b7 d9             	movzwl %cx,%ebx
  805b61:	89 5d e4             	mov    %ebx,-0x1c(%ebp)
  805b64:	89 d6                	mov    %edx,%esi
  805b66:	c1 ee 18             	shr    $0x18,%esi
  805b69:	89 75 d4             	mov    %esi,-0x2c(%ebp)
  805b6c:	0f b6 5d d4          	movzbl -0x2c(%ebp),%ebx
  805b70:	8b 78 20             	mov    0x20(%eax),%edi
  805b73:	8b 75 e4             	mov    -0x1c(%ebp),%esi
  805b76:	88 9c 37 f0 00 00 00 	mov    %bl,0xf0(%edi,%esi,1)
  805b7d:	8d 59 01             	lea    0x1(%ecx),%ebx
  dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x00ff0000UL) >> 16);
  805b80:	0f b7 db             	movzwl %bx,%ebx
  805b83:	89 5d e4             	mov    %ebx,-0x1c(%ebp)
  805b86:	89 d3                	mov    %edx,%ebx
  805b88:	c1 eb 10             	shr    $0x10,%ebx
  805b8b:	8b 78 20             	mov    0x20(%eax),%edi
  805b8e:	8b 75 e4             	mov    -0x1c(%ebp),%esi
  805b91:	88 9c 37 f0 00 00 00 	mov    %bl,0xf0(%edi,%esi,1)
  805b98:	8d 59 02             	lea    0x2(%ecx),%ebx
  dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x0000ff00UL) >> 8);
  805b9b:	0f b7 db             	movzwl %bx,%ebx
  805b9e:	89 5d e4             	mov    %ebx,-0x1c(%ebp)
  805ba1:	0f b6 de             	movzbl %dh,%ebx
  805ba4:	8b 78 20             	mov    0x20(%eax),%edi
  805ba7:	8b 75 e4             	mov    -0x1c(%ebp),%esi
  805baa:	88 9c 37 f0 00 00 00 	mov    %bl,0xf0(%edi,%esi,1)
  805bb1:	8d 59 03             	lea    0x3(%ecx),%ebx
  dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x000000ffUL));
  805bb4:	8b 70 20             	mov    0x20(%eax),%esi
  805bb7:	0f b7 db             	movzwl %bx,%ebx
  805bba:	88 94 1e f0 00 00 00 	mov    %dl,0xf0(%esi,%ebx,1)
  805bc1:	83 c1 04             	add    $0x4,%ecx
  805bc4:	66 89 48 24          	mov    %cx,0x24(%eax)
}
  805bc8:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  805bcb:	8b 75 f8             	mov    -0x8(%ebp),%esi
  805bce:	8b 7d fc             	mov    -0x4(%ebp),%edi
  805bd1:	89 ec                	mov    %ebp,%esp
  805bd3:	5d                   	pop    %ebp
  805bd4:	c3                   	ret    

00805bd5 <dhcp_delete_request>:
 *
 * @param netif the netif under DHCP control
 */
static void
dhcp_delete_request(struct netif *netif)
{
  805bd5:	55                   	push   %ebp
  805bd6:	89 e5                	mov    %esp,%ebp
  805bd8:	53                   	push   %ebx
  805bd9:	83 ec 14             	sub    $0x14,%esp
  struct dhcp *dhcp;
  LWIP_ERROR("dhcp_delete_request: netif != NULL", (netif != NULL), return;);
  805bdc:	85 c0                	test   %eax,%eax
  805bde:	75 1c                	jne    805bfc <dhcp_delete_request+0x27>
  805be0:	c7 44 24 08 0c 32 81 	movl   $0x81320c,0x8(%esp)
  805be7:	00 
  805be8:	c7 44 24 04 69 05 00 	movl   $0x569,0x4(%esp)
  805bef:	00 
  805bf0:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  805bf7:	e8 a0 ad ff ff       	call   80099c <_panic>
  dhcp = netif->dhcp;
  805bfc:	8b 58 20             	mov    0x20(%eax),%ebx
  LWIP_ERROR("dhcp_delete_request: dhcp != NULL", (dhcp != NULL), return;);
  805bff:	85 db                	test   %ebx,%ebx
  805c01:	75 1c                	jne    805c1f <dhcp_delete_request+0x4a>
  805c03:	c7 44 24 08 30 32 81 	movl   $0x813230,0x8(%esp)
  805c0a:	00 
  805c0b:	c7 44 24 04 6b 05 00 	movl   $0x56b,0x4(%esp)
  805c12:	00 
  805c13:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  805c1a:	e8 7d ad ff ff       	call   80099c <_panic>
  LWIP_ASSERT("dhcp_delete_request: dhcp->p_out != NULL", dhcp->p_out != NULL);
  805c1f:	8b 43 1c             	mov    0x1c(%ebx),%eax
  805c22:	85 c0                	test   %eax,%eax
  805c24:	75 1c                	jne    805c42 <dhcp_delete_request+0x6d>
  805c26:	c7 44 24 08 54 32 81 	movl   $0x813254,0x8(%esp)
  805c2d:	00 
  805c2e:	c7 44 24 04 6c 05 00 	movl   $0x56c,0x4(%esp)
  805c35:	00 
  805c36:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  805c3d:	e8 5a ad ff ff       	call   80099c <_panic>
  LWIP_ASSERT("dhcp_delete_request: dhcp->msg_out != NULL", dhcp->msg_out != NULL);
  805c42:	83 7b 20 00          	cmpl   $0x0,0x20(%ebx)
  805c46:	75 1c                	jne    805c64 <dhcp_delete_request+0x8f>
  805c48:	c7 44 24 08 80 32 81 	movl   $0x813280,0x8(%esp)
  805c4f:	00 
  805c50:	c7 44 24 04 6d 05 00 	movl   $0x56d,0x4(%esp)
  805c57:	00 
  805c58:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  805c5f:	e8 38 ad ff ff       	call   80099c <_panic>
  if (dhcp->p_out != NULL) {
    pbuf_free(dhcp->p_out);
  805c64:	89 04 24             	mov    %eax,(%esp)
  805c67:	e8 91 22 00 00       	call   807efd <pbuf_free>
  }
  dhcp->p_out = NULL;
  805c6c:	c7 43 1c 00 00 00 00 	movl   $0x0,0x1c(%ebx)
  dhcp->msg_out = NULL;
  805c73:	c7 43 20 00 00 00 00 	movl   $0x0,0x20(%ebx)
}
  805c7a:	83 c4 14             	add    $0x14,%esp
  805c7d:	5b                   	pop    %ebx
  805c7e:	5d                   	pop    %ebp
  805c7f:	c3                   	ret    

00805c80 <dhcp_free_reply>:
 * Free the incoming DHCP message including contiguous copy of
 * its DHCP options.
 *
 */
static void dhcp_free_reply(struct dhcp *dhcp)
{
  805c80:	55                   	push   %ebp
  805c81:	89 e5                	mov    %esp,%ebp
  805c83:	53                   	push   %ebx
  805c84:	83 ec 14             	sub    $0x14,%esp
  805c87:	89 c3                	mov    %eax,%ebx
  if (dhcp->msg_in != NULL) {
  805c89:	8b 40 10             	mov    0x10(%eax),%eax
  805c8c:	85 c0                	test   %eax,%eax
  805c8e:	74 0f                	je     805c9f <dhcp_free_reply+0x1f>
    mem_free((void *)dhcp->msg_in);
  805c90:	89 04 24             	mov    %eax,(%esp)
  805c93:	e8 5d 18 00 00       	call   8074f5 <mem_free>
    dhcp->msg_in = NULL;
  805c98:	c7 43 10 00 00 00 00 	movl   $0x0,0x10(%ebx)
  }
  if (dhcp->options_in) {
  805c9f:	8b 43 14             	mov    0x14(%ebx),%eax
  805ca2:	85 c0                	test   %eax,%eax
  805ca4:	74 15                	je     805cbb <dhcp_free_reply+0x3b>
    mem_free((void *)dhcp->options_in);
  805ca6:	89 04 24             	mov    %eax,(%esp)
  805ca9:	e8 47 18 00 00       	call   8074f5 <mem_free>
    dhcp->options_in = NULL;
  805cae:	c7 43 14 00 00 00 00 	movl   $0x0,0x14(%ebx)
    dhcp->options_in_len = 0;
  805cb5:	66 c7 43 18 00 00    	movw   $0x0,0x18(%ebx)
  }
  LWIP_DEBUGF(DHCP_DEBUG, ("dhcp_free_reply(): free'd\n"));
}
  805cbb:	83 c4 14             	add    $0x14,%esp
  805cbe:	5b                   	pop    %ebx
  805cbf:	5d                   	pop    %ebp
  805cc0:	c3                   	ret    

00805cc1 <dhcp_stop>:
 *
 * @param netif The network interface to stop DHCP on
 */
void
dhcp_stop(struct netif *netif)
{
  805cc1:	55                   	push   %ebp
  805cc2:	89 e5                	mov    %esp,%ebp
  805cc4:	56                   	push   %esi
  805cc5:	53                   	push   %ebx
  805cc6:	83 ec 10             	sub    $0x10,%esp
  805cc9:	8b 75 08             	mov    0x8(%ebp),%esi
  struct dhcp *dhcp = netif->dhcp;
  805ccc:	8b 5e 20             	mov    0x20(%esi),%ebx
  LWIP_ERROR("dhcp_stop: netif != NULL", (netif != NULL), return;);
  805ccf:	85 f6                	test   %esi,%esi
  805cd1:	75 1c                	jne    805cef <dhcp_stop+0x2e>
  805cd3:	c7 44 24 08 d7 33 81 	movl   $0x8133d7,0x8(%esp)
  805cda:	00 
  805cdb:	c7 44 24 04 2c 04 00 	movl   $0x42c,0x4(%esp)
  805ce2:	00 
  805ce3:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  805cea:	e8 ad ac ff ff       	call   80099c <_panic>
  /* Remove the flag that says this netif is handled by DHCP. */
  netif->flags &= ~NETIF_FLAG_DHCP;
  805cef:	80 66 2e f7          	andb   $0xf7,0x2e(%esi)

  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 3, ("dhcp_stop()\n"));
  /* netif is DHCP configured? */
  if (dhcp != NULL) {
  805cf3:	85 db                	test   %ebx,%ebx
  805cf5:	74 42                	je     805d39 <dhcp_stop+0x78>
    if (dhcp->pcb != NULL) {
  805cf7:	8b 43 08             	mov    0x8(%ebx),%eax
  805cfa:	85 c0                	test   %eax,%eax
  805cfc:	74 0f                	je     805d0d <dhcp_stop+0x4c>
      udp_remove(dhcp->pcb);
  805cfe:	89 04 24             	mov    %eax,(%esp)
  805d01:	e8 e6 63 00 00       	call   80c0ec <udp_remove>
      dhcp->pcb = NULL;
  805d06:	c7 43 08 00 00 00 00 	movl   $0x0,0x8(%ebx)
    }
    if (dhcp->p != NULL) {
  805d0d:	8b 43 0c             	mov    0xc(%ebx),%eax
  805d10:	85 c0                	test   %eax,%eax
  805d12:	74 0f                	je     805d23 <dhcp_stop+0x62>
      pbuf_free(dhcp->p);
  805d14:	89 04 24             	mov    %eax,(%esp)
  805d17:	e8 e1 21 00 00       	call   807efd <pbuf_free>
      dhcp->p = NULL;
  805d1c:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
    }
    /* free unfolded reply */
    dhcp_free_reply(dhcp);
  805d23:	89 d8                	mov    %ebx,%eax
  805d25:	e8 56 ff ff ff       	call   805c80 <dhcp_free_reply>
    mem_free((void *)dhcp);
  805d2a:	89 1c 24             	mov    %ebx,(%esp)
  805d2d:	e8 c3 17 00 00       	call   8074f5 <mem_free>
    netif->dhcp = NULL;
  805d32:	c7 46 20 00 00 00 00 	movl   $0x0,0x20(%esi)
  }
}
  805d39:	83 c4 10             	add    $0x10,%esp
  805d3c:	5b                   	pop    %ebx
  805d3d:	5e                   	pop    %esi
  805d3e:	5d                   	pop    %ebp
  805d3f:	c3                   	ret    

00805d40 <dhcp_create_request>:
 *
 * @param netif the netif under DHCP control
 */
static err_t
dhcp_create_request(struct netif *netif)
{
  805d40:	55                   	push   %ebp
  805d41:	89 e5                	mov    %esp,%ebp
  805d43:	57                   	push   %edi
  805d44:	56                   	push   %esi
  805d45:	53                   	push   %ebx
  805d46:	83 ec 2c             	sub    $0x2c,%esp
  805d49:	89 c7                	mov    %eax,%edi
  struct dhcp *dhcp;
  u16_t i;
  LWIP_ERROR("dhcp_create_request: netif != NULL", (netif != NULL), return ERR_ARG;);
  805d4b:	85 c0                	test   %eax,%eax
  805d4d:	75 1c                	jne    805d6b <dhcp_create_request+0x2b>
  805d4f:	c7 44 24 08 ac 32 81 	movl   $0x8132ac,0x8(%esp)
  805d56:	00 
  805d57:	c7 44 24 04 2d 05 00 	movl   $0x52d,0x4(%esp)
  805d5e:	00 
  805d5f:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  805d66:	e8 31 ac ff ff       	call   80099c <_panic>
  dhcp = netif->dhcp;
  805d6b:	8b 58 20             	mov    0x20(%eax),%ebx
  LWIP_ERROR("dhcp_create_request: dhcp != NULL", (dhcp != NULL), return ERR_VAL;);
  805d6e:	85 db                	test   %ebx,%ebx
  805d70:	75 1c                	jne    805d8e <dhcp_create_request+0x4e>
  805d72:	c7 44 24 08 d0 32 81 	movl   $0x8132d0,0x8(%esp)
  805d79:	00 
  805d7a:	c7 44 24 04 2f 05 00 	movl   $0x52f,0x4(%esp)
  805d81:	00 
  805d82:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  805d89:	e8 0e ac ff ff       	call   80099c <_panic>
  LWIP_ASSERT("dhcp_create_request: dhcp->p_out == NULL", dhcp->p_out == NULL);
  805d8e:	83 7b 1c 00          	cmpl   $0x0,0x1c(%ebx)
  805d92:	74 1c                	je     805db0 <dhcp_create_request+0x70>
  805d94:	c7 44 24 08 f4 32 81 	movl   $0x8132f4,0x8(%esp)
  805d9b:	00 
  805d9c:	c7 44 24 04 30 05 00 	movl   $0x530,0x4(%esp)
  805da3:	00 
  805da4:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  805dab:	e8 ec ab ff ff       	call   80099c <_panic>
  LWIP_ASSERT("dhcp_create_request: dhcp->msg_out == NULL", dhcp->msg_out == NULL);
  805db0:	83 7b 20 00          	cmpl   $0x0,0x20(%ebx)
  805db4:	74 1c                	je     805dd2 <dhcp_create_request+0x92>
  805db6:	c7 44 24 08 20 33 81 	movl   $0x813320,0x8(%esp)
  805dbd:	00 
  805dbe:	c7 44 24 04 31 05 00 	movl   $0x531,0x4(%esp)
  805dc5:	00 
  805dc6:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  805dcd:	e8 ca ab ff ff       	call   80099c <_panic>
  dhcp->p_out = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcp_msg), PBUF_RAM);
  805dd2:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  805dd9:	00 
  805dda:	c7 44 24 04 34 01 00 	movl   $0x134,0x4(%esp)
  805de1:	00 
  805de2:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  805de9:	e8 cb 23 00 00       	call   8081b9 <pbuf_alloc>
  805dee:	89 43 1c             	mov    %eax,0x1c(%ebx)
  if (dhcp->p_out == NULL) {
  805df1:	ba ff ff ff ff       	mov    $0xffffffff,%edx
  805df6:	85 c0                	test   %eax,%eax
  805df8:	0f 84 2d 01 00 00    	je     805f2b <dhcp_create_request+0x1eb>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 2, ("dhcp_create_request(): could not allocate pbuf\n"));
    return ERR_MEM;
  }
  LWIP_ASSERT("dhcp_create_request: check that first pbuf can hold struct dhcp_msg",
  805dfe:	66 81 78 0a 33 01    	cmpw   $0x133,0xa(%eax)
  805e04:	77 1c                	ja     805e22 <dhcp_create_request+0xe2>
  805e06:	c7 44 24 08 4c 33 81 	movl   $0x81334c,0x8(%esp)
  805e0d:	00 
  805e0e:	c7 44 24 04 38 05 00 	movl   $0x538,0x4(%esp)
  805e15:	00 
  805e16:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  805e1d:	e8 7a ab ff ff       	call   80099c <_panic>
           (dhcp->p_out->len >= sizeof(struct dhcp_msg)));

  /* give unique transaction identifier to this request */
  dhcp->xid = xid++;
  805e22:	8b 15 78 90 81 00    	mov    0x819078,%edx
  805e28:	89 53 04             	mov    %edx,0x4(%ebx)
  805e2b:	83 c2 01             	add    $0x1,%edx
  805e2e:	89 15 78 90 81 00    	mov    %edx,0x819078
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 2, ("transaction id xid++(%"X32_F") dhcp->xid(%"U32_F")\n",xid,dhcp->xid));

  dhcp->msg_out = (struct dhcp_msg *)dhcp->p_out->payload;
  805e34:	8b 40 04             	mov    0x4(%eax),%eax
  805e37:	89 43 20             	mov    %eax,0x20(%ebx)

  dhcp->msg_out->op = DHCP_BOOTREQUEST;
  805e3a:	c6 00 01             	movb   $0x1,(%eax)
  /* TODO: make link layer independent */
  dhcp->msg_out->htype = DHCP_HTYPE_ETH;
  805e3d:	8b 43 20             	mov    0x20(%ebx),%eax
  805e40:	c6 40 01 01          	movb   $0x1,0x1(%eax)
  /* TODO: make link layer independent */
  dhcp->msg_out->hlen = DHCP_HLEN_ETH;
  805e44:	8b 43 20             	mov    0x20(%ebx),%eax
  805e47:	c6 40 02 06          	movb   $0x6,0x2(%eax)
  dhcp->msg_out->hops = 0;
  805e4b:	8b 43 20             	mov    0x20(%ebx),%eax
  805e4e:	c6 40 03 00          	movb   $0x0,0x3(%eax)
  dhcp->msg_out->xid = htonl(dhcp->xid);
  805e52:	8b 73 20             	mov    0x20(%ebx),%esi
  805e55:	8b 43 04             	mov    0x4(%ebx),%eax
  805e58:	89 04 24             	mov    %eax,(%esp)
  805e5b:	e8 b4 4e 00 00       	call   80ad14 <htonl>
  805e60:	89 46 04             	mov    %eax,0x4(%esi)
  dhcp->msg_out->secs = 0;
  805e63:	8b 43 20             	mov    0x20(%ebx),%eax
  805e66:	66 c7 40 08 00 00    	movw   $0x0,0x8(%eax)
  dhcp->msg_out->flags = 0;
  805e6c:	8b 43 20             	mov    0x20(%ebx),%eax
  805e6f:	66 c7 40 0a 00 00    	movw   $0x0,0xa(%eax)
  dhcp->msg_out->ciaddr.addr = netif->ip_addr.addr;
  805e75:	8b 43 20             	mov    0x20(%ebx),%eax
  805e78:	8b 57 04             	mov    0x4(%edi),%edx
  805e7b:	89 50 0c             	mov    %edx,0xc(%eax)
  dhcp->msg_out->yiaddr.addr = 0;
  805e7e:	8b 43 20             	mov    0x20(%ebx),%eax
  805e81:	c7 40 10 00 00 00 00 	movl   $0x0,0x10(%eax)
  dhcp->msg_out->siaddr.addr = 0;
  805e88:	8b 43 20             	mov    0x20(%ebx),%eax
  805e8b:	c7 40 14 00 00 00 00 	movl   $0x0,0x14(%eax)
  dhcp->msg_out->giaddr.addr = 0;
  805e92:	8b 43 20             	mov    0x20(%ebx),%eax
  805e95:	c7 40 18 00 00 00 00 	movl   $0x0,0x18(%eax)
  805e9c:	b8 00 00 00 00       	mov    $0x0,%eax
  for (i = 0; i < DHCP_CHADDR_LEN; i++) {
    /* copy netif hardware address, pad with zeroes */
    dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
  805ea1:	89 5d e4             	mov    %ebx,-0x1c(%ebp)
  805ea4:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  805ea7:	8b 5a 20             	mov    0x20(%edx),%ebx
  805eaa:	89 c1                	mov    %eax,%ecx
  805eac:	0f b6 77 24          	movzbl 0x24(%edi),%esi
  805eb0:	ba 00 00 00 00       	mov    $0x0,%edx
  805eb5:	66 39 c6             	cmp    %ax,%si
  805eb8:	76 05                	jbe    805ebf <dhcp_create_request+0x17f>
  805eba:	0f b6 54 07 25       	movzbl 0x25(%edi,%eax,1),%edx
  805ebf:	88 54 0b 1c          	mov    %dl,0x1c(%ebx,%ecx,1)
  805ec3:	83 c0 01             	add    $0x1,%eax
  dhcp->msg_out->flags = 0;
  dhcp->msg_out->ciaddr.addr = netif->ip_addr.addr;
  dhcp->msg_out->yiaddr.addr = 0;
  dhcp->msg_out->siaddr.addr = 0;
  dhcp->msg_out->giaddr.addr = 0;
  for (i = 0; i < DHCP_CHADDR_LEN; i++) {
  805ec6:	83 f8 10             	cmp    $0x10,%eax
  805ec9:	75 d9                	jne    805ea4 <dhcp_create_request+0x164>
  805ecb:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
  805ece:	b0 00                	mov    $0x0,%al
    /* copy netif hardware address, pad with zeroes */
    dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
  }
  for (i = 0; i < DHCP_SNAME_LEN; i++) {
    dhcp->msg_out->sname[i] = 0;
  805ed0:	8b 53 20             	mov    0x20(%ebx),%edx
  805ed3:	c6 44 10 2c 00       	movb   $0x0,0x2c(%eax,%edx,1)
  805ed8:	83 c0 01             	add    $0x1,%eax
  dhcp->msg_out->giaddr.addr = 0;
  for (i = 0; i < DHCP_CHADDR_LEN; i++) {
    /* copy netif hardware address, pad with zeroes */
    dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
  }
  for (i = 0; i < DHCP_SNAME_LEN; i++) {
  805edb:	83 f8 40             	cmp    $0x40,%eax
  805ede:	75 f0                	jne    805ed0 <dhcp_create_request+0x190>
  805ee0:	b0 00                	mov    $0x0,%al
    dhcp->msg_out->sname[i] = 0;
  }
  for (i = 0; i < DHCP_FILE_LEN; i++) {
    dhcp->msg_out->file[i] = 0;
  805ee2:	8b 53 20             	mov    0x20(%ebx),%edx
  805ee5:	c6 44 10 6c 00       	movb   $0x0,0x6c(%eax,%edx,1)
  805eea:	83 c0 01             	add    $0x1,%eax
    dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
  }
  for (i = 0; i < DHCP_SNAME_LEN; i++) {
    dhcp->msg_out->sname[i] = 0;
  }
  for (i = 0; i < DHCP_FILE_LEN; i++) {
  805eed:	3d 80 00 00 00       	cmp    $0x80,%eax
  805ef2:	75 ee                	jne    805ee2 <dhcp_create_request+0x1a2>
    dhcp->msg_out->file[i] = 0;
  }
  dhcp->msg_out->cookie = htonl(0x63825363UL);
  805ef4:	8b 73 20             	mov    0x20(%ebx),%esi
  805ef7:	c7 04 24 63 53 82 63 	movl   $0x63825363,(%esp)
  805efe:	e8 11 4e 00 00       	call   80ad14 <htonl>
  805f03:	89 86 ec 00 00 00    	mov    %eax,0xec(%esi)
  dhcp->options_out_len = 0;
  805f09:	66 c7 43 24 00 00    	movw   $0x0,0x24(%ebx)
  805f0f:	b8 00 00 00 00       	mov    $0x0,%eax
  /* fill options field with an incrementing array (for debugging purposes) */
  for (i = 0; i < DHCP_OPTIONS_LEN; i++) {
    dhcp->msg_out->options[i] = (u8_t)i; /* for debugging only, no matter if truncated */
  805f14:	8b 53 20             	mov    0x20(%ebx),%edx
  805f17:	88 84 10 f0 00 00 00 	mov    %al,0xf0(%eax,%edx,1)
  805f1e:	83 c0 01             	add    $0x1,%eax
    dhcp->msg_out->file[i] = 0;
  }
  dhcp->msg_out->cookie = htonl(0x63825363UL);
  dhcp->options_out_len = 0;
  /* fill options field with an incrementing array (for debugging purposes) */
  for (i = 0; i < DHCP_OPTIONS_LEN; i++) {
  805f21:	83 f8 44             	cmp    $0x44,%eax
  805f24:	75 ee                	jne    805f14 <dhcp_create_request+0x1d4>
  805f26:	ba 00 00 00 00       	mov    $0x0,%edx
    dhcp->msg_out->options[i] = (u8_t)i; /* for debugging only, no matter if truncated */
  }
  return ERR_OK;
}
  805f2b:	89 d0                	mov    %edx,%eax
  805f2d:	83 c4 2c             	add    $0x2c,%esp
  805f30:	5b                   	pop    %ebx
  805f31:	5e                   	pop    %esi
  805f32:	5f                   	pop    %edi
  805f33:	5d                   	pop    %ebp
  805f34:	c3                   	ret    

00805f35 <dhcp_release>:
 *
 * @param netif network interface which must release its lease
 */
err_t
dhcp_release(struct netif *netif)
{
  805f35:	55                   	push   %ebp
  805f36:	89 e5                	mov    %esp,%ebp
  805f38:	57                   	push   %edi
  805f39:	56                   	push   %esi
  805f3a:	53                   	push   %ebx
  805f3b:	83 ec 3c             	sub    $0x3c,%esp
  805f3e:	8b 75 08             	mov    0x8(%ebp),%esi
  struct dhcp *dhcp = netif->dhcp;
  805f41:	8b 5e 20             	mov    0x20(%esi),%ebx
  err_t result;
  u16_t msecs;
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 3, ("dhcp_release()\n"));

  /* idle DHCP client */
  dhcp_set_state(dhcp, DHCP_OFF);
  805f44:	ba 0d 00 00 00       	mov    $0xd,%edx
  805f49:	89 d8                	mov    %ebx,%eax
  805f4b:	e8 80 f8 ff ff       	call   8057d0 <dhcp_set_state>
  /* clean old DHCP offer */
  dhcp->server_ip_addr.addr = 0;
  805f50:	c7 43 2c 00 00 00 00 	movl   $0x0,0x2c(%ebx)
  dhcp->offered_ip_addr.addr = dhcp->offered_sn_mask.addr = 0;
  805f57:	c7 43 34 00 00 00 00 	movl   $0x0,0x34(%ebx)
  805f5e:	c7 43 30 00 00 00 00 	movl   $0x0,0x30(%ebx)
  dhcp->offered_gw_addr.addr = dhcp->offered_bc_addr.addr = 0;
  805f65:	c7 43 3c 00 00 00 00 	movl   $0x0,0x3c(%ebx)
  805f6c:	c7 43 38 00 00 00 00 	movl   $0x0,0x38(%ebx)
  dhcp->offered_t0_lease = dhcp->offered_t1_renew = dhcp->offered_t2_rebind = 0;
  805f73:	c7 43 54 00 00 00 00 	movl   $0x0,0x54(%ebx)
  805f7a:	c7 43 50 00 00 00 00 	movl   $0x0,0x50(%ebx)
  805f81:	c7 43 4c 00 00 00 00 	movl   $0x0,0x4c(%ebx)
  dhcp->dns_count = 0;
  805f88:	c7 43 40 00 00 00 00 	movl   $0x0,0x40(%ebx)
  
  /* create and initialize the DHCP message header */
  result = dhcp_create_request(netif);
  805f8f:	89 f0                	mov    %esi,%eax
  805f91:	e8 aa fd ff ff       	call   805d40 <dhcp_create_request>
  805f96:	89 c7                	mov    %eax,%edi
  if (result == ERR_OK) {
  805f98:	84 c0                	test   %al,%al
  805f9a:	0f 85 87 00 00 00    	jne    806027 <dhcp_release+0xf2>
    dhcp_option(dhcp, DHCP_OPTION_MESSAGE_TYPE, DHCP_OPTION_MESSAGE_TYPE_LEN);
  805fa0:	b9 01 00 00 00       	mov    $0x1,%ecx
  805fa5:	ba 35 00 00 00       	mov    $0x35,%edx
  805faa:	89 d8                	mov    %ebx,%eax
  805fac:	e8 6b f9 ff ff       	call   80591c <dhcp_option>
    dhcp_option_byte(dhcp, DHCP_RELEASE);
  805fb1:	ba 07 00 00 00       	mov    $0x7,%edx
  805fb6:	89 d8                	mov    %ebx,%eax
  805fb8:	e8 ce f9 ff ff       	call   80598b <dhcp_option_byte>

    dhcp_option_trailer(dhcp);
  805fbd:	89 d8                	mov    %ebx,%eax
  805fbf:	e8 17 fa ff ff       	call   8059db <dhcp_option_trailer>

    pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
  805fc4:	0f b7 43 24          	movzwl 0x24(%ebx),%eax
  805fc8:	66 05 f0 00          	add    $0xf0,%ax
  805fcc:	0f b7 c0             	movzwl %ax,%eax
  805fcf:	89 44 24 04          	mov    %eax,0x4(%esp)
  805fd3:	8b 43 1c             	mov    0x1c(%ebx),%eax
  805fd6:	89 04 24             	mov    %eax,(%esp)
  805fd9:	e8 ab 20 00 00       	call   808089 <pbuf_realloc>

    udp_connect(dhcp->pcb, &dhcp->server_ip_addr, DHCP_SERVER_PORT);
  805fde:	8d 43 2c             	lea    0x2c(%ebx),%eax
  805fe1:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  805fe4:	c7 44 24 08 43 00 00 	movl   $0x43,0x8(%esp)
  805feb:	00 
  805fec:	89 44 24 04          	mov    %eax,0x4(%esp)
  805ff0:	8b 43 08             	mov    0x8(%ebx),%eax
  805ff3:	89 04 24             	mov    %eax,(%esp)
  805ff6:	e8 03 62 00 00       	call   80c1fe <udp_connect>
    udp_sendto_if(dhcp->pcb, dhcp->p_out, &dhcp->server_ip_addr, DHCP_SERVER_PORT, netif);
  805ffb:	89 74 24 10          	mov    %esi,0x10(%esp)
  805fff:	c7 44 24 0c 43 00 00 	movl   $0x43,0xc(%esp)
  806006:	00 
  806007:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80600a:	89 44 24 08          	mov    %eax,0x8(%esp)
  80600e:	8b 43 1c             	mov    0x1c(%ebx),%eax
  806011:	89 44 24 04          	mov    %eax,0x4(%esp)
  806015:	8b 43 08             	mov    0x8(%ebx),%eax
  806018:	89 04 24             	mov    %eax,(%esp)
  80601b:	e8 60 62 00 00       	call   80c280 <udp_sendto_if>
    dhcp_delete_request(netif);
  806020:	89 f0                	mov    %esi,%eax
  806022:	e8 ae fb ff ff       	call   805bd5 <dhcp_delete_request>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_release: RELEASED, DHCP_OFF\n"));
  } else {
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 2, ("dhcp_release: could not allocate DHCP request\n"));
  }
  dhcp->tries++;
  806027:	0f b6 4b 01          	movzbl 0x1(%ebx),%ecx
  80602b:	83 c1 01             	add    $0x1,%ecx
  80602e:	88 4b 01             	mov    %cl,0x1(%ebx)
  msecs = dhcp->tries < 10 ? dhcp->tries * 1000 : 10 * 1000;
  806031:	ba 10 27 00 00       	mov    $0x2710,%edx
  806036:	80 f9 09             	cmp    $0x9,%cl
  806039:	77 08                	ja     806043 <dhcp_release+0x10e>
  80603b:	0f b6 c9             	movzbl %cl,%ecx
  80603e:	66 69 d1 e8 03       	imul   $0x3e8,%cx,%dx
  dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
  806043:	0f b7 d2             	movzwl %dx,%edx
  806046:	81 c2 f3 01 00 00    	add    $0x1f3,%edx
  80604c:	b9 d3 4d 62 10       	mov    $0x10624dd3,%ecx
  806051:	89 d0                	mov    %edx,%eax
  806053:	f7 e9                	imul   %ecx
  806055:	c1 fa 05             	sar    $0x5,%edx
  806058:	66 89 53 26          	mov    %dx,0x26(%ebx)
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_release(): set request timeout %"U16_F" msecs\n", msecs));
  /* bring the interface down */
  netif_set_down(netif);
  80605c:	89 34 24             	mov    %esi,(%esp)
  80605f:	e8 94 18 00 00       	call   8078f8 <netif_set_down>
  /* remove IP address from interface */
  netif_set_ipaddr(netif, IP_ADDR_ANY);
  806064:	c7 44 24 04 a4 3c 81 	movl   $0x813ca4,0x4(%esp)
  80606b:	00 
  80606c:	89 34 24             	mov    %esi,(%esp)
  80606f:	e8 e0 18 00 00       	call   807954 <netif_set_ipaddr>
  netif_set_gw(netif, IP_ADDR_ANY);
  806074:	c7 44 24 04 a4 3c 81 	movl   $0x813ca4,0x4(%esp)
  80607b:	00 
  80607c:	89 34 24             	mov    %esi,(%esp)
  80607f:	e8 db 17 00 00       	call   80785f <netif_set_gw>
  netif_set_netmask(netif, IP_ADDR_ANY);
  806084:	c7 44 24 04 a4 3c 81 	movl   $0x813ca4,0x4(%esp)
  80608b:	00 
  80608c:	89 34 24             	mov    %esi,(%esp)
  80608f:	e8 e4 17 00 00       	call   807878 <netif_set_netmask>
  
  /* TODO: netif_down(netif); */
  return result;
}
  806094:	89 f8                	mov    %edi,%eax
  806096:	83 c4 3c             	add    $0x3c,%esp
  806099:	5b                   	pop    %ebx
  80609a:	5e                   	pop    %esi
  80609b:	5f                   	pop    %edi
  80609c:	5d                   	pop    %ebp
  80609d:	c3                   	ret    

0080609e <dhcp_renew>:
 *
 * @param netif network interface which must renew its lease
 */
err_t
dhcp_renew(struct netif *netif)
{
  80609e:	55                   	push   %ebp
  80609f:	89 e5                	mov    %esp,%ebp
  8060a1:	83 ec 48             	sub    $0x48,%esp
  8060a4:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  8060a7:	89 75 f8             	mov    %esi,-0x8(%ebp)
  8060aa:	89 7d fc             	mov    %edi,-0x4(%ebp)
  8060ad:	8b 7d 08             	mov    0x8(%ebp),%edi
  struct dhcp *dhcp = netif->dhcp;
  8060b0:	8b 5f 20             	mov    0x20(%edi),%ebx
  err_t result;
  u16_t msecs;
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 3, ("dhcp_renew()\n"));
  dhcp_set_state(dhcp, DHCP_RENEWING);
  8060b3:	ba 05 00 00 00       	mov    $0x5,%edx
  8060b8:	89 d8                	mov    %ebx,%eax
  8060ba:	e8 11 f7 ff ff       	call   8057d0 <dhcp_set_state>

  /* create and initialize the DHCP message header */
  result = dhcp_create_request(netif);
  8060bf:	89 f8                	mov    %edi,%eax
  8060c1:	e8 7a fc ff ff       	call   805d40 <dhcp_create_request>
  8060c6:	89 c6                	mov    %eax,%esi
  if (result == ERR_OK) {
  8060c8:	84 c0                	test   %al,%al
  8060ca:	0f 85 a4 00 00 00    	jne    806174 <dhcp_renew+0xd6>

    dhcp_option(dhcp, DHCP_OPTION_MESSAGE_TYPE, DHCP_OPTION_MESSAGE_TYPE_LEN);
  8060d0:	b9 01 00 00 00       	mov    $0x1,%ecx
  8060d5:	ba 35 00 00 00       	mov    $0x35,%edx
  8060da:	89 d8                	mov    %ebx,%eax
  8060dc:	e8 3b f8 ff ff       	call   80591c <dhcp_option>
    dhcp_option_byte(dhcp, DHCP_REQUEST);
  8060e1:	ba 03 00 00 00       	mov    $0x3,%edx
  8060e6:	89 d8                	mov    %ebx,%eax
  8060e8:	e8 9e f8 ff ff       	call   80598b <dhcp_option_byte>

    dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);
  8060ed:	b9 02 00 00 00       	mov    $0x2,%ecx
  8060f2:	ba 39 00 00 00       	mov    $0x39,%edx
  8060f7:	89 d8                	mov    %ebx,%eax
  8060f9:	e8 1e f8 ff ff       	call   80591c <dhcp_option>
    /* TODO: use netif->mtu in some way */
    dhcp_option_short(dhcp, 576);
  8060fe:	ba 40 02 00 00       	mov    $0x240,%edx
  806103:	89 d8                	mov    %ebx,%eax
  806105:	e8 9b f9 ff ff       	call   805aa5 <dhcp_option_short>
#if 0
    dhcp_option(dhcp, DHCP_OPTION_SERVER_ID, 4);
    dhcp_option_long(dhcp, ntohl(dhcp->server_ip_addr.addr));
#endif
    /* append DHCP message trailer */
    dhcp_option_trailer(dhcp);
  80610a:	89 d8                	mov    %ebx,%eax
  80610c:	e8 ca f8 ff ff       	call   8059db <dhcp_option_trailer>

    pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
  806111:	0f b7 43 24          	movzwl 0x24(%ebx),%eax
  806115:	66 05 f0 00          	add    $0xf0,%ax
  806119:	0f b7 c0             	movzwl %ax,%eax
  80611c:	89 44 24 04          	mov    %eax,0x4(%esp)
  806120:	8b 43 1c             	mov    0x1c(%ebx),%eax
  806123:	89 04 24             	mov    %eax,(%esp)
  806126:	e8 5e 1f 00 00       	call   808089 <pbuf_realloc>

    udp_connect(dhcp->pcb, &dhcp->server_ip_addr, DHCP_SERVER_PORT);
  80612b:	8d 43 2c             	lea    0x2c(%ebx),%eax
  80612e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  806131:	c7 44 24 08 43 00 00 	movl   $0x43,0x8(%esp)
  806138:	00 
  806139:	89 44 24 04          	mov    %eax,0x4(%esp)
  80613d:	8b 43 08             	mov    0x8(%ebx),%eax
  806140:	89 04 24             	mov    %eax,(%esp)
  806143:	e8 b6 60 00 00       	call   80c1fe <udp_connect>
    udp_sendto_if(dhcp->pcb, dhcp->p_out, &dhcp->server_ip_addr, DHCP_SERVER_PORT, netif);
  806148:	89 7c 24 10          	mov    %edi,0x10(%esp)
  80614c:	c7 44 24 0c 43 00 00 	movl   $0x43,0xc(%esp)
  806153:	00 
  806154:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  806157:	89 44 24 08          	mov    %eax,0x8(%esp)
  80615b:	8b 43 1c             	mov    0x1c(%ebx),%eax
  80615e:	89 44 24 04          	mov    %eax,0x4(%esp)
  806162:	8b 43 08             	mov    0x8(%ebx),%eax
  806165:	89 04 24             	mov    %eax,(%esp)
  806168:	e8 13 61 00 00       	call   80c280 <udp_sendto_if>
    dhcp_delete_request(netif);
  80616d:	89 f8                	mov    %edi,%eax
  80616f:	e8 61 fa ff ff       	call   805bd5 <dhcp_delete_request>

    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_renew: RENEWING\n"));
  } else {
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 2, ("dhcp_renew: could not allocate DHCP request\n"));
  }
  dhcp->tries++;
  806174:	0f b6 4b 01          	movzbl 0x1(%ebx),%ecx
  806178:	83 c1 01             	add    $0x1,%ecx
  80617b:	88 4b 01             	mov    %cl,0x1(%ebx)
  /* back-off on retries, but to a maximum of 20 seconds */
  msecs = dhcp->tries < 10 ? dhcp->tries * 2000 : 20 * 1000;
  80617e:	ba 20 4e 00 00       	mov    $0x4e20,%edx
  806183:	80 f9 09             	cmp    $0x9,%cl
  806186:	77 08                	ja     806190 <dhcp_renew+0xf2>
  806188:	0f b6 c9             	movzbl %cl,%ecx
  80618b:	66 69 d1 d0 07       	imul   $0x7d0,%cx,%dx
  dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
  806190:	0f b7 d2             	movzwl %dx,%edx
  806193:	81 c2 f3 01 00 00    	add    $0x1f3,%edx
  806199:	b9 d3 4d 62 10       	mov    $0x10624dd3,%ecx
  80619e:	89 d0                	mov    %edx,%eax
  8061a0:	f7 e9                	imul   %ecx
  8061a2:	c1 fa 05             	sar    $0x5,%edx
  8061a5:	66 89 53 26          	mov    %dx,0x26(%ebx)
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_renew(): set request timeout %"U16_F" msecs\n", msecs));
  return result;
}
  8061a9:	89 f0                	mov    %esi,%eax
  8061ab:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  8061ae:	8b 75 f8             	mov    -0x8(%ebp),%esi
  8061b1:	8b 7d fc             	mov    -0x4(%ebp),%edi
  8061b4:	89 ec                	mov    %ebp,%esp
  8061b6:	5d                   	pop    %ebp
  8061b7:	c3                   	ret    

008061b8 <dhcp_discover>:
 *
 * @param netif the netif under DHCP control
 */
static err_t
dhcp_discover(struct netif *netif)
{
  8061b8:	55                   	push   %ebp
  8061b9:	89 e5                	mov    %esp,%ebp
  8061bb:	57                   	push   %edi
  8061bc:	56                   	push   %esi
  8061bd:	53                   	push   %ebx
  8061be:	83 ec 2c             	sub    $0x2c,%esp
  8061c1:	89 c7                	mov    %eax,%edi
  struct dhcp *dhcp = netif->dhcp;
  8061c3:	8b 58 20             	mov    0x20(%eax),%ebx
  err_t result = ERR_OK;
  u16_t msecs;
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 3, ("dhcp_discover()\n"));
  ip_addr_set(&dhcp->offered_ip_addr, IP_ADDR_ANY);
  8061c6:	a1 a4 3c 81 00       	mov    0x813ca4,%eax
  8061cb:	89 43 30             	mov    %eax,0x30(%ebx)
  /* create and initialize the DHCP message header */
  result = dhcp_create_request(netif);
  8061ce:	89 f8                	mov    %edi,%eax
  8061d0:	e8 6b fb ff ff       	call   805d40 <dhcp_create_request>
  8061d5:	89 c6                	mov    %eax,%esi
  if (result == ERR_OK) {
  8061d7:	84 c0                	test   %al,%al
  8061d9:	0f 85 f0 00 00 00    	jne    8062cf <dhcp_discover+0x117>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover: making request\n"));
    dhcp_option(dhcp, DHCP_OPTION_MESSAGE_TYPE, DHCP_OPTION_MESSAGE_TYPE_LEN);
  8061df:	b9 01 00 00 00       	mov    $0x1,%ecx
  8061e4:	ba 35 00 00 00       	mov    $0x35,%edx
  8061e9:	89 d8                	mov    %ebx,%eax
  8061eb:	e8 2c f7 ff ff       	call   80591c <dhcp_option>
    dhcp_option_byte(dhcp, DHCP_DISCOVER);
  8061f0:	ba 01 00 00 00       	mov    $0x1,%edx
  8061f5:	89 d8                	mov    %ebx,%eax
  8061f7:	e8 8f f7 ff ff       	call   80598b <dhcp_option_byte>

    dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);
  8061fc:	b9 02 00 00 00       	mov    $0x2,%ecx
  806201:	ba 39 00 00 00       	mov    $0x39,%edx
  806206:	89 d8                	mov    %ebx,%eax
  806208:	e8 0f f7 ff ff       	call   80591c <dhcp_option>
    dhcp_option_short(dhcp, 576);
  80620d:	ba 40 02 00 00       	mov    $0x240,%edx
  806212:	89 d8                	mov    %ebx,%eax
  806214:	e8 8c f8 ff ff       	call   805aa5 <dhcp_option_short>

    dhcp_option(dhcp, DHCP_OPTION_PARAMETER_REQUEST_LIST, 4/*num options*/);
  806219:	b9 04 00 00 00       	mov    $0x4,%ecx
  80621e:	ba 37 00 00 00       	mov    $0x37,%edx
  806223:	89 d8                	mov    %ebx,%eax
  806225:	e8 f2 f6 ff ff       	call   80591c <dhcp_option>
    dhcp_option_byte(dhcp, DHCP_OPTION_SUBNET_MASK);
  80622a:	ba 01 00 00 00       	mov    $0x1,%edx
  80622f:	89 d8                	mov    %ebx,%eax
  806231:	e8 55 f7 ff ff       	call   80598b <dhcp_option_byte>
    dhcp_option_byte(dhcp, DHCP_OPTION_ROUTER);
  806236:	ba 03 00 00 00       	mov    $0x3,%edx
  80623b:	89 d8                	mov    %ebx,%eax
  80623d:	e8 49 f7 ff ff       	call   80598b <dhcp_option_byte>
    dhcp_option_byte(dhcp, DHCP_OPTION_BROADCAST);
  806242:	ba 1c 00 00 00       	mov    $0x1c,%edx
  806247:	89 d8                	mov    %ebx,%eax
  806249:	e8 3d f7 ff ff       	call   80598b <dhcp_option_byte>
    dhcp_option_byte(dhcp, DHCP_OPTION_DNS_SERVER);
  80624e:	ba 06 00 00 00       	mov    $0x6,%edx
  806253:	89 d8                	mov    %ebx,%eax
  806255:	e8 31 f7 ff ff       	call   80598b <dhcp_option_byte>

    dhcp_option_trailer(dhcp);
  80625a:	89 d8                	mov    %ebx,%eax
  80625c:	e8 7a f7 ff ff       	call   8059db <dhcp_option_trailer>

    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover: realloc()ing\n"));
    pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
  806261:	0f b7 43 24          	movzwl 0x24(%ebx),%eax
  806265:	66 05 f0 00          	add    $0xf0,%ax
  806269:	0f b7 c0             	movzwl %ax,%eax
  80626c:	89 44 24 04          	mov    %eax,0x4(%esp)
  806270:	8b 43 1c             	mov    0x1c(%ebx),%eax
  806273:	89 04 24             	mov    %eax,(%esp)
  806276:	e8 0e 1e 00 00       	call   808089 <pbuf_realloc>

    udp_connect(dhcp->pcb, IP_ADDR_ANY, DHCP_SERVER_PORT);
  80627b:	c7 44 24 08 43 00 00 	movl   $0x43,0x8(%esp)
  806282:	00 
  806283:	c7 44 24 04 a4 3c 81 	movl   $0x813ca4,0x4(%esp)
  80628a:	00 
  80628b:	8b 43 08             	mov    0x8(%ebx),%eax
  80628e:	89 04 24             	mov    %eax,(%esp)
  806291:	e8 68 5f 00 00       	call   80c1fe <udp_connect>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover: sendto(DISCOVER, IP_ADDR_BROADCAST, DHCP_SERVER_PORT)\n"));
    udp_sendto_if(dhcp->pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif);
  806296:	89 7c 24 10          	mov    %edi,0x10(%esp)
  80629a:	c7 44 24 0c 43 00 00 	movl   $0x43,0xc(%esp)
  8062a1:	00 
  8062a2:	c7 44 24 08 a8 3c 81 	movl   $0x813ca8,0x8(%esp)
  8062a9:	00 
  8062aa:	8b 43 1c             	mov    0x1c(%ebx),%eax
  8062ad:	89 44 24 04          	mov    %eax,0x4(%esp)
  8062b1:	8b 43 08             	mov    0x8(%ebx),%eax
  8062b4:	89 04 24             	mov    %eax,(%esp)
  8062b7:	e8 c4 5f 00 00       	call   80c280 <udp_sendto_if>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover: deleting()ing\n"));
    dhcp_delete_request(netif);
  8062bc:	89 f8                	mov    %edi,%eax
  8062be:	e8 12 f9 ff ff       	call   805bd5 <dhcp_delete_request>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_discover: SELECTING\n"));
    dhcp_set_state(dhcp, DHCP_SELECTING);
  8062c3:	ba 06 00 00 00       	mov    $0x6,%edx
  8062c8:	89 d8                	mov    %ebx,%eax
  8062ca:	e8 01 f5 ff ff       	call   8057d0 <dhcp_set_state>
  } else {
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 2, ("dhcp_discover: could not allocate DHCP request\n"));
  }
  dhcp->tries++;
  8062cf:	0f b6 4b 01          	movzbl 0x1(%ebx),%ecx
  8062d3:	83 c1 01             	add    $0x1,%ecx
  8062d6:	88 4b 01             	mov    %cl,0x1(%ebx)
  if(dhcp->tries >= 9 && dhcp->autoip_coop_state == DHCP_AUTOIP_COOP_STATE_OFF) {
    dhcp->autoip_coop_state = DHCP_AUTOIP_COOP_STATE_ON;
    autoip_start(netif);
  }
#endif /* LWIP_DHCP_AUTOIP_COOP */
  msecs = dhcp->tries < 4 ? (dhcp->tries + 1) * 1000 : 10 * 1000;
  8062d9:	ba 10 27 00 00       	mov    $0x2710,%edx
  8062de:	80 f9 03             	cmp    $0x3,%cl
  8062e1:	77 0b                	ja     8062ee <dhcp_discover+0x136>
  8062e3:	0f b6 d1             	movzbl %cl,%edx
  8062e6:	83 c2 01             	add    $0x1,%edx
  8062e9:	66 69 d2 e8 03       	imul   $0x3e8,%dx,%dx
  dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
  8062ee:	0f b7 d2             	movzwl %dx,%edx
  8062f1:	81 c2 f3 01 00 00    	add    $0x1f3,%edx
  8062f7:	b9 d3 4d 62 10       	mov    $0x10624dd3,%ecx
  8062fc:	89 d0                	mov    %edx,%eax
  8062fe:	f7 e9                	imul   %ecx
  806300:	c1 fa 05             	sar    $0x5,%edx
  806303:	66 89 53 26          	mov    %dx,0x26(%ebx)
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_discover(): set request timeout %"U16_F" msecs\n", msecs));
  return result;
}
  806307:	89 f0                	mov    %esi,%eax
  806309:	83 c4 2c             	add    $0x2c,%esp
  80630c:	5b                   	pop    %ebx
  80630d:	5e                   	pop    %esi
  80630e:	5f                   	pop    %edi
  80630f:	5d                   	pop    %ebp
  806310:	c3                   	ret    

00806311 <dhcp_rebind>:
 *
 * @param netif network interface which must rebind with a DHCP server
 */
static err_t
dhcp_rebind(struct netif *netif)
{
  806311:	55                   	push   %ebp
  806312:	89 e5                	mov    %esp,%ebp
  806314:	83 ec 38             	sub    $0x38,%esp
  806317:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  80631a:	89 75 f8             	mov    %esi,-0x8(%ebp)
  80631d:	89 7d fc             	mov    %edi,-0x4(%ebp)
  806320:	89 c7                	mov    %eax,%edi
  struct dhcp *dhcp = netif->dhcp;
  806322:	8b 58 20             	mov    0x20(%eax),%ebx
  err_t result;
  u16_t msecs;
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_rebind()\n"));
  dhcp_set_state(dhcp, DHCP_REBINDING);
  806325:	ba 04 00 00 00       	mov    $0x4,%edx
  80632a:	89 d8                	mov    %ebx,%eax
  80632c:	e8 9f f4 ff ff       	call   8057d0 <dhcp_set_state>

  /* create and initialize the DHCP message header */
  result = dhcp_create_request(netif);
  806331:	89 f8                	mov    %edi,%eax
  806333:	e8 08 fa ff ff       	call   805d40 <dhcp_create_request>
  806338:	89 c6                	mov    %eax,%esi
  if (result == ERR_OK) {
  80633a:	84 c0                	test   %al,%al
  80633c:	0f 85 a3 00 00 00    	jne    8063e5 <dhcp_rebind+0xd4>

    dhcp_option(dhcp, DHCP_OPTION_MESSAGE_TYPE, DHCP_OPTION_MESSAGE_TYPE_LEN);
  806342:	b9 01 00 00 00       	mov    $0x1,%ecx
  806347:	ba 35 00 00 00       	mov    $0x35,%edx
  80634c:	89 d8                	mov    %ebx,%eax
  80634e:	e8 c9 f5 ff ff       	call   80591c <dhcp_option>
    dhcp_option_byte(dhcp, DHCP_REQUEST);
  806353:	ba 03 00 00 00       	mov    $0x3,%edx
  806358:	89 d8                	mov    %ebx,%eax
  80635a:	e8 2c f6 ff ff       	call   80598b <dhcp_option_byte>

    dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);
  80635f:	b9 02 00 00 00       	mov    $0x2,%ecx
  806364:	ba 39 00 00 00       	mov    $0x39,%edx
  806369:	89 d8                	mov    %ebx,%eax
  80636b:	e8 ac f5 ff ff       	call   80591c <dhcp_option>
    dhcp_option_short(dhcp, 576);
  806370:	ba 40 02 00 00       	mov    $0x240,%edx
  806375:	89 d8                	mov    %ebx,%eax
  806377:	e8 29 f7 ff ff       	call   805aa5 <dhcp_option_short>

    dhcp_option(dhcp, DHCP_OPTION_SERVER_ID, 4);
    dhcp_option_long(dhcp, ntohl(dhcp->server_ip_addr.addr));
#endif

    dhcp_option_trailer(dhcp);
  80637c:	89 d8                	mov    %ebx,%eax
  80637e:	e8 58 f6 ff ff       	call   8059db <dhcp_option_trailer>

    pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
  806383:	0f b7 43 24          	movzwl 0x24(%ebx),%eax
  806387:	66 05 f0 00          	add    $0xf0,%ax
  80638b:	0f b7 c0             	movzwl %ax,%eax
  80638e:	89 44 24 04          	mov    %eax,0x4(%esp)
  806392:	8b 43 1c             	mov    0x1c(%ebx),%eax
  806395:	89 04 24             	mov    %eax,(%esp)
  806398:	e8 ec 1c 00 00       	call   808089 <pbuf_realloc>

    /* broadcast to server */
    udp_connect(dhcp->pcb, IP_ADDR_ANY, DHCP_SERVER_PORT);
  80639d:	c7 44 24 08 43 00 00 	movl   $0x43,0x8(%esp)
  8063a4:	00 
  8063a5:	c7 44 24 04 a4 3c 81 	movl   $0x813ca4,0x4(%esp)
  8063ac:	00 
  8063ad:	8b 43 08             	mov    0x8(%ebx),%eax
  8063b0:	89 04 24             	mov    %eax,(%esp)
  8063b3:	e8 46 5e 00 00       	call   80c1fe <udp_connect>
    udp_sendto_if(dhcp->pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif);
  8063b8:	89 7c 24 10          	mov    %edi,0x10(%esp)
  8063bc:	c7 44 24 0c 43 00 00 	movl   $0x43,0xc(%esp)
  8063c3:	00 
  8063c4:	c7 44 24 08 a8 3c 81 	movl   $0x813ca8,0x8(%esp)
  8063cb:	00 
  8063cc:	8b 43 1c             	mov    0x1c(%ebx),%eax
  8063cf:	89 44 24 04          	mov    %eax,0x4(%esp)
  8063d3:	8b 43 08             	mov    0x8(%ebx),%eax
  8063d6:	89 04 24             	mov    %eax,(%esp)
  8063d9:	e8 a2 5e 00 00       	call   80c280 <udp_sendto_if>
    dhcp_delete_request(netif);
  8063de:	89 f8                	mov    %edi,%eax
  8063e0:	e8 f0 f7 ff ff       	call   805bd5 <dhcp_delete_request>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_rebind: REBINDING\n"));
  } else {
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 2, ("dhcp_rebind: could not allocate DHCP request\n"));
  }
  dhcp->tries++;
  8063e5:	0f b6 4b 01          	movzbl 0x1(%ebx),%ecx
  8063e9:	83 c1 01             	add    $0x1,%ecx
  8063ec:	88 4b 01             	mov    %cl,0x1(%ebx)
  msecs = dhcp->tries < 10 ? dhcp->tries * 1000 : 10 * 1000;
  8063ef:	ba 10 27 00 00       	mov    $0x2710,%edx
  8063f4:	80 f9 09             	cmp    $0x9,%cl
  8063f7:	77 08                	ja     806401 <dhcp_rebind+0xf0>
  8063f9:	0f b6 c9             	movzbl %cl,%ecx
  8063fc:	66 69 d1 e8 03       	imul   $0x3e8,%cx,%dx
  dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
  806401:	0f b7 d2             	movzwl %dx,%edx
  806404:	81 c2 f3 01 00 00    	add    $0x1f3,%edx
  80640a:	b9 d3 4d 62 10       	mov    $0x10624dd3,%ecx
  80640f:	89 d0                	mov    %edx,%eax
  806411:	f7 e9                	imul   %ecx
  806413:	c1 fa 05             	sar    $0x5,%edx
  806416:	66 89 53 26          	mov    %dx,0x26(%ebx)
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_rebind(): set request timeout %"U16_F" msecs\n", msecs));
  return result;
}
  80641a:	89 f0                	mov    %esi,%eax
  80641c:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  80641f:	8b 75 f8             	mov    -0x8(%ebp),%esi
  806422:	8b 7d fc             	mov    -0x4(%ebp),%edi
  806425:	89 ec                	mov    %ebp,%esp
  806427:	5d                   	pop    %ebp
  806428:	c3                   	ret    

00806429 <dhcp_coarse_tmr>:
 * The DHCP timer that checks for lease renewal/rebind timeouts.
 *
 */
void
dhcp_coarse_tmr()
{
  806429:	55                   	push   %ebp
  80642a:	89 e5                	mov    %esp,%ebp
  80642c:	53                   	push   %ebx
  80642d:	83 ec 14             	sub    $0x14,%esp
  struct netif *netif = netif_list;
  806430:	8b 1d 00 f6 b3 00    	mov    0xb3f600,%ebx
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_coarse_tmr()\n"));
  /* iterate through all network interfaces */
  while (netif != NULL) {
  806436:	85 db                	test   %ebx,%ebx
  806438:	74 67                	je     8064a1 <dhcp_coarse_tmr+0x78>
    /* only act on DHCP configured interfaces */
    if (netif->dhcp != NULL) {
  80643a:	8b 43 20             	mov    0x20(%ebx),%eax
  80643d:	85 c0                	test   %eax,%eax
  80643f:	74 5a                	je     80649b <dhcp_coarse_tmr+0x72>
      /* timer is active (non zero), and triggers (zeroes) now? */
      if (netif->dhcp->t2_timeout-- == 1) {
  806441:	0f b7 50 2a          	movzwl 0x2a(%eax),%edx
  806445:	8d 4a ff             	lea    -0x1(%edx),%ecx
  806448:	66 89 48 2a          	mov    %cx,0x2a(%eax)
  80644c:	66 83 fa 01          	cmp    $0x1,%dx
  806450:	75 1b                	jne    80646d <dhcp_coarse_tmr+0x44>
static void
dhcp_t2_timeout(struct netif *netif)
{
  struct dhcp *dhcp = netif->dhcp;
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_t2_timeout()\n"));
  if ((dhcp->state == DHCP_REQUESTING) || (dhcp->state == DHCP_BOUND) || (dhcp->state == DHCP_RENEWING)) {
  806452:	8b 43 20             	mov    0x20(%ebx),%eax
  806455:	0f b6 00             	movzbl (%eax),%eax
  806458:	3c 01                	cmp    $0x1,%al
  80645a:	74 08                	je     806464 <dhcp_coarse_tmr+0x3b>
  80645c:	3c 0a                	cmp    $0xa,%al
  80645e:	74 04                	je     806464 <dhcp_coarse_tmr+0x3b>
  806460:	3c 05                	cmp    $0x5,%al
  806462:	75 37                	jne    80649b <dhcp_coarse_tmr+0x72>
    /* just retry to rebind */
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_t2_timeout(): must rebind\n"));
    dhcp_rebind(netif);
  806464:	89 d8                	mov    %ebx,%eax
  806466:	e8 a6 fe ff ff       	call   806311 <dhcp_rebind>
  80646b:	eb 2e                	jmp    80649b <dhcp_coarse_tmr+0x72>
      if (netif->dhcp->t2_timeout-- == 1) {
        LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_coarse_tmr(): t2 timeout\n"));
        /* this clients' rebind timeout triggered */
        dhcp_t2_timeout(netif);
      /* timer is active (non zero), and triggers (zeroes) now */
      } else if (netif->dhcp->t1_timeout-- == 1) {
  80646d:	8b 53 20             	mov    0x20(%ebx),%edx
  806470:	0f b7 42 28          	movzwl 0x28(%edx),%eax
  806474:	8d 48 ff             	lea    -0x1(%eax),%ecx
  806477:	66 89 4a 28          	mov    %cx,0x28(%edx)
  80647b:	66 83 f8 01          	cmp    $0x1,%ax
  80647f:	75 1a                	jne    80649b <dhcp_coarse_tmr+0x72>
static void
dhcp_t1_timeout(struct netif *netif)
{
  struct dhcp *dhcp = netif->dhcp;
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_t1_timeout()\n"));
  if ((dhcp->state == DHCP_REQUESTING) || (dhcp->state == DHCP_BOUND) || (dhcp->state == DHCP_RENEWING)) {
  806481:	8b 43 20             	mov    0x20(%ebx),%eax
  806484:	0f b6 00             	movzbl (%eax),%eax
  806487:	3c 01                	cmp    $0x1,%al
  806489:	74 08                	je     806493 <dhcp_coarse_tmr+0x6a>
  80648b:	3c 0a                	cmp    $0xa,%al
  80648d:	74 04                	je     806493 <dhcp_coarse_tmr+0x6a>
  80648f:	3c 05                	cmp    $0x5,%al
  806491:	75 08                	jne    80649b <dhcp_coarse_tmr+0x72>
    /* just retry to renew - note that the rebind timer (t2) will
     * eventually time-out if renew tries fail. */
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_t1_timeout(): must renew\n"));
    dhcp_renew(netif);
  806493:	89 1c 24             	mov    %ebx,(%esp)
  806496:	e8 03 fc ff ff       	call   80609e <dhcp_renew>
        /* this clients' renewal timeout triggered */
        dhcp_t1_timeout(netif);
      }
    }
    /* proceed to next netif */
    netif = netif->next;
  80649b:	8b 1b                	mov    (%ebx),%ebx
dhcp_coarse_tmr()
{
  struct netif *netif = netif_list;
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_coarse_tmr()\n"));
  /* iterate through all network interfaces */
  while (netif != NULL) {
  80649d:	85 db                	test   %ebx,%ebx
  80649f:	75 99                	jne    80643a <dhcp_coarse_tmr+0x11>
      }
    }
    /* proceed to next netif */
    netif = netif->next;
  }
}
  8064a1:	83 c4 14             	add    $0x14,%esp
  8064a4:	5b                   	pop    %ebx
  8064a5:	5d                   	pop    %ebp
  8064a6:	c3                   	ret    

008064a7 <dhcp_arp_reply>:
 *
 * @param netif the network interface on which the reply was received
 * @param addr The IP address we received a reply from
 */
void dhcp_arp_reply(struct netif *netif, struct ip_addr *addr)
{
  8064a7:	55                   	push   %ebp
  8064a8:	89 e5                	mov    %esp,%ebp
  8064aa:	83 ec 28             	sub    $0x28,%esp
  8064ad:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  8064b0:	89 75 fc             	mov    %esi,-0x4(%ebp)
  8064b3:	8b 75 08             	mov    0x8(%ebp),%esi
  LWIP_ERROR("netif != NULL", (netif != NULL), return;);
  8064b6:	85 f6                	test   %esi,%esi
  8064b8:	75 1c                	jne    8064d6 <dhcp_arp_reply+0x2f>
  8064ba:	c7 44 24 08 fb 33 81 	movl   $0x8133fb,0x8(%esp)
  8064c1:	00 
  8064c2:	c7 44 24 04 b5 02 00 	movl   $0x2b5,0x4(%esp)
  8064c9:	00 
  8064ca:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  8064d1:	e8 c6 a4 ff ff       	call   80099c <_panic>
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 3, ("dhcp_arp_reply()\n"));
  /* is a DHCP client doing an ARP check? */
  if ((netif->dhcp != NULL) && (netif->dhcp->state == DHCP_CHECKING)) {
  8064d6:	8b 5e 20             	mov    0x20(%esi),%ebx
  8064d9:	85 db                	test   %ebx,%ebx
  8064db:	0f 84 04 01 00 00    	je     8065e5 <dhcp_arp_reply+0x13e>
  8064e1:	80 3b 08             	cmpb   $0x8,(%ebx)
  8064e4:	0f 85 fb 00 00 00    	jne    8065e5 <dhcp_arp_reply+0x13e>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_arp_reply(): CHECKING, arp reply for 0x%08"X32_F"\n", addr->addr));
    /* did a host respond with the address we
       were offered by the DHCP server? */
    if (ip_addr_cmp(addr, &netif->dhcp->offered_ip_addr)) {
  8064ea:	8b 45 0c             	mov    0xc(%ebp),%eax
  8064ed:	8b 00                	mov    (%eax),%eax
  8064ef:	3b 43 30             	cmp    0x30(%ebx),%eax
  8064f2:	0f 85 ed 00 00 00    	jne    8065e5 <dhcp_arp_reply+0x13e>
{
  struct dhcp *dhcp = netif->dhcp;
  err_t result = ERR_OK;
  u16_t msecs;
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 3, ("dhcp_decline()\n"));
  dhcp_set_state(dhcp, DHCP_BACKING_OFF);
  8064f8:	ba 0c 00 00 00       	mov    $0xc,%edx
  8064fd:	89 d8                	mov    %ebx,%eax
  8064ff:	e8 cc f2 ff ff       	call   8057d0 <dhcp_set_state>
  /* create and initialize the DHCP message header */
  result = dhcp_create_request(netif);
  806504:	89 f0                	mov    %esi,%eax
  806506:	e8 35 f8 ff ff       	call   805d40 <dhcp_create_request>
  if (result == ERR_OK) {
  80650b:	84 c0                	test   %al,%al
  80650d:	0f 85 c8 00 00 00    	jne    8065db <dhcp_arp_reply+0x134>
    dhcp_option(dhcp, DHCP_OPTION_MESSAGE_TYPE, DHCP_OPTION_MESSAGE_TYPE_LEN);
  806513:	b9 01 00 00 00       	mov    $0x1,%ecx
  806518:	ba 35 00 00 00       	mov    $0x35,%edx
  80651d:	89 d8                	mov    %ebx,%eax
  80651f:	e8 f8 f3 ff ff       	call   80591c <dhcp_option>
    dhcp_option_byte(dhcp, DHCP_DECLINE);
  806524:	ba 04 00 00 00       	mov    $0x4,%edx
  806529:	89 d8                	mov    %ebx,%eax
  80652b:	e8 5b f4 ff ff       	call   80598b <dhcp_option_byte>

    dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);
  806530:	b9 02 00 00 00       	mov    $0x2,%ecx
  806535:	ba 39 00 00 00       	mov    $0x39,%edx
  80653a:	89 d8                	mov    %ebx,%eax
  80653c:	e8 db f3 ff ff       	call   80591c <dhcp_option>
    dhcp_option_short(dhcp, 576);
  806541:	ba 40 02 00 00       	mov    $0x240,%edx
  806546:	89 d8                	mov    %ebx,%eax
  806548:	e8 58 f5 ff ff       	call   805aa5 <dhcp_option_short>

    dhcp_option(dhcp, DHCP_OPTION_REQUESTED_IP, 4);
  80654d:	b9 04 00 00 00       	mov    $0x4,%ecx
  806552:	ba 32 00 00 00       	mov    $0x32,%edx
  806557:	89 d8                	mov    %ebx,%eax
  806559:	e8 be f3 ff ff       	call   80591c <dhcp_option>
    dhcp_option_long(dhcp, ntohl(dhcp->offered_ip_addr.addr));
  80655e:	8b 43 30             	mov    0x30(%ebx),%eax
  806561:	89 04 24             	mov    %eax,(%esp)
  806564:	e8 cc 49 00 00       	call   80af35 <ntohl>
  806569:	89 c2                	mov    %eax,%edx
  80656b:	89 d8                	mov    %ebx,%eax
  80656d:	e8 b2 f5 ff ff       	call   805b24 <dhcp_option_long>

    dhcp_option_trailer(dhcp);
  806572:	89 d8                	mov    %ebx,%eax
  806574:	e8 62 f4 ff ff       	call   8059db <dhcp_option_trailer>
    /* resize pbuf to reflect true size of options */
    pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
  806579:	0f b7 43 24          	movzwl 0x24(%ebx),%eax
  80657d:	66 05 f0 00          	add    $0xf0,%ax
  806581:	0f b7 c0             	movzwl %ax,%eax
  806584:	89 44 24 04          	mov    %eax,0x4(%esp)
  806588:	8b 43 1c             	mov    0x1c(%ebx),%eax
  80658b:	89 04 24             	mov    %eax,(%esp)
  80658e:	e8 f6 1a 00 00       	call   808089 <pbuf_realloc>

    /* @todo: should we really connect here? we are performing sendto() */
    udp_connect(dhcp->pcb, IP_ADDR_ANY, DHCP_SERVER_PORT);
  806593:	c7 44 24 08 43 00 00 	movl   $0x43,0x8(%esp)
  80659a:	00 
  80659b:	c7 44 24 04 a4 3c 81 	movl   $0x813ca4,0x4(%esp)
  8065a2:	00 
  8065a3:	8b 43 08             	mov    0x8(%ebx),%eax
  8065a6:	89 04 24             	mov    %eax,(%esp)
  8065a9:	e8 50 5c 00 00       	call   80c1fe <udp_connect>
    /* per section 4.4.4, broadcast DECLINE messages */
    udp_sendto_if(dhcp->pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif);
  8065ae:	89 74 24 10          	mov    %esi,0x10(%esp)
  8065b2:	c7 44 24 0c 43 00 00 	movl   $0x43,0xc(%esp)
  8065b9:	00 
  8065ba:	c7 44 24 08 a8 3c 81 	movl   $0x813ca8,0x8(%esp)
  8065c1:	00 
  8065c2:	8b 43 1c             	mov    0x1c(%ebx),%eax
  8065c5:	89 44 24 04          	mov    %eax,0x4(%esp)
  8065c9:	8b 43 08             	mov    0x8(%ebx),%eax
  8065cc:	89 04 24             	mov    %eax,(%esp)
  8065cf:	e8 ac 5c 00 00       	call   80c280 <udp_sendto_if>
    dhcp_delete_request(netif);
  8065d4:	89 f0                	mov    %esi,%eax
  8065d6:	e8 fa f5 ff ff       	call   805bd5 <dhcp_delete_request>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_decline: BACKING OFF\n"));
  } else {
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 2, ("dhcp_decline: could not allocate DHCP request\n"));
  }
  dhcp->tries++;
  8065db:	80 43 01 01          	addb   $0x1,0x1(%ebx)
  msecs = 10*1000;
  dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
  8065df:	66 c7 43 26 14 00    	movw   $0x14,0x26(%ebx)
      /* we will not accept the offered address */
      LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE | 1, ("dhcp_arp_reply(): arp reply matched with offered address, declining\n"));
      dhcp_decline(netif);
    }
  }
}
  8065e5:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  8065e8:	8b 75 fc             	mov    -0x4(%ebp),%esi
  8065eb:	89 ec                	mov    %ebp,%esp
  8065ed:	5d                   	pop    %ebp
  8065ee:	c3                   	ret    

008065ef <dhcp_select>:
 * @param netif the netif under DHCP control
 * @return lwIP specific error (see error.h)
 */
static err_t
dhcp_select(struct netif *netif)
{
  8065ef:	55                   	push   %ebp
  8065f0:	89 e5                	mov    %esp,%ebp
  8065f2:	57                   	push   %edi
  8065f3:	56                   	push   %esi
  8065f4:	53                   	push   %ebx
  8065f5:	83 ec 2c             	sub    $0x2c,%esp
  8065f8:	89 c7                	mov    %eax,%edi
  struct dhcp *dhcp = netif->dhcp;
  8065fa:	8b 58 20             	mov    0x20(%eax),%ebx
#endif /* LWIP_NETIF_HOSTNAME */

  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 3, ("dhcp_select(netif=%p) %c%c%"U16_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));

  /* create and initialize the DHCP message header */
  result = dhcp_create_request(netif);
  8065fd:	e8 3e f7 ff ff       	call   805d40 <dhcp_create_request>
  806602:	89 c6                	mov    %eax,%esi
  if (result == ERR_OK) {
  806604:	84 c0                	test   %al,%al
  806606:	0f 85 3a 01 00 00    	jne    806746 <dhcp_select+0x157>
    dhcp_option(dhcp, DHCP_OPTION_MESSAGE_TYPE, DHCP_OPTION_MESSAGE_TYPE_LEN);
  80660c:	b9 01 00 00 00       	mov    $0x1,%ecx
  806611:	ba 35 00 00 00       	mov    $0x35,%edx
  806616:	89 d8                	mov    %ebx,%eax
  806618:	e8 ff f2 ff ff       	call   80591c <dhcp_option>
    dhcp_option_byte(dhcp, DHCP_REQUEST);
  80661d:	ba 03 00 00 00       	mov    $0x3,%edx
  806622:	89 d8                	mov    %ebx,%eax
  806624:	e8 62 f3 ff ff       	call   80598b <dhcp_option_byte>

    dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);
  806629:	b9 02 00 00 00       	mov    $0x2,%ecx
  80662e:	ba 39 00 00 00       	mov    $0x39,%edx
  806633:	89 d8                	mov    %ebx,%eax
  806635:	e8 e2 f2 ff ff       	call   80591c <dhcp_option>
    dhcp_option_short(dhcp, 576);
  80663a:	ba 40 02 00 00       	mov    $0x240,%edx
  80663f:	89 d8                	mov    %ebx,%eax
  806641:	e8 5f f4 ff ff       	call   805aa5 <dhcp_option_short>

    /* MUST request the offered IP address */
    dhcp_option(dhcp, DHCP_OPTION_REQUESTED_IP, 4);
  806646:	b9 04 00 00 00       	mov    $0x4,%ecx
  80664b:	ba 32 00 00 00       	mov    $0x32,%edx
  806650:	89 d8                	mov    %ebx,%eax
  806652:	e8 c5 f2 ff ff       	call   80591c <dhcp_option>
    dhcp_option_long(dhcp, ntohl(dhcp->offered_ip_addr.addr));
  806657:	8b 43 30             	mov    0x30(%ebx),%eax
  80665a:	89 04 24             	mov    %eax,(%esp)
  80665d:	e8 d3 48 00 00       	call   80af35 <ntohl>
  806662:	89 c2                	mov    %eax,%edx
  806664:	89 d8                	mov    %ebx,%eax
  806666:	e8 b9 f4 ff ff       	call   805b24 <dhcp_option_long>

    dhcp_option(dhcp, DHCP_OPTION_SERVER_ID, 4);
  80666b:	b9 04 00 00 00       	mov    $0x4,%ecx
  806670:	ba 36 00 00 00       	mov    $0x36,%edx
  806675:	89 d8                	mov    %ebx,%eax
  806677:	e8 a0 f2 ff ff       	call   80591c <dhcp_option>
    dhcp_option_long(dhcp, ntohl(dhcp->server_ip_addr.addr));
  80667c:	8b 43 2c             	mov    0x2c(%ebx),%eax
  80667f:	89 04 24             	mov    %eax,(%esp)
  806682:	e8 ae 48 00 00       	call   80af35 <ntohl>
  806687:	89 c2                	mov    %eax,%edx
  806689:	89 d8                	mov    %ebx,%eax
  80668b:	e8 94 f4 ff ff       	call   805b24 <dhcp_option_long>

    dhcp_option(dhcp, DHCP_OPTION_PARAMETER_REQUEST_LIST, 4/*num options*/);
  806690:	b9 04 00 00 00       	mov    $0x4,%ecx
  806695:	ba 37 00 00 00       	mov    $0x37,%edx
  80669a:	89 d8                	mov    %ebx,%eax
  80669c:	e8 7b f2 ff ff       	call   80591c <dhcp_option>
    dhcp_option_byte(dhcp, DHCP_OPTION_SUBNET_MASK);
  8066a1:	ba 01 00 00 00       	mov    $0x1,%edx
  8066a6:	89 d8                	mov    %ebx,%eax
  8066a8:	e8 de f2 ff ff       	call   80598b <dhcp_option_byte>
    dhcp_option_byte(dhcp, DHCP_OPTION_ROUTER);
  8066ad:	ba 03 00 00 00       	mov    $0x3,%edx
  8066b2:	89 d8                	mov    %ebx,%eax
  8066b4:	e8 d2 f2 ff ff       	call   80598b <dhcp_option_byte>
    dhcp_option_byte(dhcp, DHCP_OPTION_BROADCAST);
  8066b9:	ba 1c 00 00 00       	mov    $0x1c,%edx
  8066be:	89 d8                	mov    %ebx,%eax
  8066c0:	e8 c6 f2 ff ff       	call   80598b <dhcp_option_byte>
    dhcp_option_byte(dhcp, DHCP_OPTION_DNS_SERVER);
  8066c5:	ba 06 00 00 00       	mov    $0x6,%edx
  8066ca:	89 d8                	mov    %ebx,%eax
  8066cc:	e8 ba f2 ff ff       	call   80598b <dhcp_option_byte>
        dhcp_option_byte(dhcp, *p++);
      }
    }
#endif /* LWIP_NETIF_HOSTNAME */

    dhcp_option_trailer(dhcp);
  8066d1:	89 d8                	mov    %ebx,%eax
  8066d3:	e8 03 f3 ff ff       	call   8059db <dhcp_option_trailer>
    /* shrink the pbuf to the actual content length */
    pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
  8066d8:	0f b7 43 24          	movzwl 0x24(%ebx),%eax
  8066dc:	66 05 f0 00          	add    $0xf0,%ax
  8066e0:	0f b7 c0             	movzwl %ax,%eax
  8066e3:	89 44 24 04          	mov    %eax,0x4(%esp)
  8066e7:	8b 43 1c             	mov    0x1c(%ebx),%eax
  8066ea:	89 04 24             	mov    %eax,(%esp)
  8066ed:	e8 97 19 00 00       	call   808089 <pbuf_realloc>

    /* TODO: we really should bind to a specific local interface here
       but we cannot specify an unconfigured netif as it is addressless */
    /* send broadcast to any DHCP server */
    udp_sendto_if(dhcp->pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif);
  8066f2:	89 7c 24 10          	mov    %edi,0x10(%esp)
  8066f6:	c7 44 24 0c 43 00 00 	movl   $0x43,0xc(%esp)
  8066fd:	00 
  8066fe:	c7 44 24 08 a8 3c 81 	movl   $0x813ca8,0x8(%esp)
  806705:	00 
  806706:	8b 43 1c             	mov    0x1c(%ebx),%eax
  806709:	89 44 24 04          	mov    %eax,0x4(%esp)
  80670d:	8b 43 08             	mov    0x8(%ebx),%eax
  806710:	89 04 24             	mov    %eax,(%esp)
  806713:	e8 68 5b 00 00       	call   80c280 <udp_sendto_if>
    /* reconnect to any (or to server here?!) */
    udp_connect(dhcp->pcb, IP_ADDR_ANY, DHCP_SERVER_PORT);
  806718:	c7 44 24 08 43 00 00 	movl   $0x43,0x8(%esp)
  80671f:	00 
  806720:	c7 44 24 04 a4 3c 81 	movl   $0x813ca4,0x4(%esp)
  806727:	00 
  806728:	8b 43 08             	mov    0x8(%ebx),%eax
  80672b:	89 04 24             	mov    %eax,(%esp)
  80672e:	e8 cb 5a 00 00       	call   80c1fe <udp_connect>
    dhcp_delete_request(netif);
  806733:	89 f8                	mov    %edi,%eax
  806735:	e8 9b f4 ff ff       	call   805bd5 <dhcp_delete_request>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_select: REQUESTING\n"));
    dhcp_set_state(dhcp, DHCP_REQUESTING);
  80673a:	ba 01 00 00 00       	mov    $0x1,%edx
  80673f:	89 d8                	mov    %ebx,%eax
  806741:	e8 8a f0 ff ff       	call   8057d0 <dhcp_set_state>
  } else {
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 2, ("dhcp_select: could not allocate DHCP request\n"));
  }
  dhcp->tries++;
  806746:	0f b6 4b 01          	movzbl 0x1(%ebx),%ecx
  80674a:	83 c1 01             	add    $0x1,%ecx
  80674d:	88 4b 01             	mov    %cl,0x1(%ebx)
  msecs = dhcp->tries < 4 ? dhcp->tries * 1000 : 4 * 1000;
  806750:	ba a0 0f 00 00       	mov    $0xfa0,%edx
  806755:	80 f9 03             	cmp    $0x3,%cl
  806758:	77 08                	ja     806762 <dhcp_select+0x173>
  80675a:	0f b6 c9             	movzbl %cl,%ecx
  80675d:	66 69 d1 e8 03       	imul   $0x3e8,%cx,%dx
  dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
  806762:	0f b7 d2             	movzwl %dx,%edx
  806765:	81 c2 f3 01 00 00    	add    $0x1f3,%edx
  80676b:	b9 d3 4d 62 10       	mov    $0x10624dd3,%ecx
  806770:	89 d0                	mov    %edx,%eax
  806772:	f7 e9                	imul   %ecx
  806774:	c1 fa 05             	sar    $0x5,%edx
  806777:	66 89 53 26          	mov    %dx,0x26(%ebx)
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_select(): set request timeout %"U16_F" msecs\n", msecs));
  return result;
}
  80677b:	89 f0                	mov    %esi,%eax
  80677d:	83 c4 2c             	add    $0x2c,%esp
  806780:	5b                   	pop    %ebx
  806781:	5e                   	pop    %esi
  806782:	5f                   	pop    %edi
  806783:	5d                   	pop    %ebp
  806784:	c3                   	ret    

00806785 <dhcp_inform>:
 *
 * @param netif The lwIP network interface
 */
void
dhcp_inform(struct netif *netif)
{
  806785:	55                   	push   %ebp
  806786:	89 e5                	mov    %esp,%ebp
  806788:	83 ec 38             	sub    $0x38,%esp
  80678b:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  80678e:	89 75 f8             	mov    %esi,-0x8(%ebp)
  806791:	89 7d fc             	mov    %edi,-0x4(%ebp)
  806794:	8b 75 08             	mov    0x8(%ebp),%esi
  struct dhcp *dhcp, *old_dhcp = netif->dhcp;
  806797:	8b 7e 20             	mov    0x20(%esi),%edi
  err_t result = ERR_OK;
  dhcp = mem_malloc(sizeof(struct dhcp));
  80679a:	c7 04 24 58 00 00 00 	movl   $0x58,(%esp)
  8067a1:	e8 ba 09 00 00       	call   807160 <mem_malloc>
  8067a6:	89 c3                	mov    %eax,%ebx
  if (dhcp == NULL) {
  8067a8:	85 c0                	test   %eax,%eax
  8067aa:	0f 84 40 01 00 00    	je     8068f0 <dhcp_inform+0x16b>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 2, ("dhcp_inform(): could not allocate dhcp\n"));
    return;
  }
  netif->dhcp = dhcp;
  8067b0:	89 46 20             	mov    %eax,0x20(%esi)
  memset(dhcp, 0, sizeof(struct dhcp));
  8067b3:	c7 44 24 08 58 00 00 	movl   $0x58,0x8(%esp)
  8067ba:	00 
  8067bb:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  8067c2:	00 
  8067c3:	89 04 24             	mov    %eax,(%esp)
  8067c6:	e8 bb aa ff ff       	call   801286 <memset>

  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_inform(): allocated dhcp\n"));
  dhcp->pcb = udp_new();
  8067cb:	e8 df 58 00 00       	call   80c0af <udp_new>
  8067d0:	89 43 08             	mov    %eax,0x8(%ebx)
  if (dhcp->pcb == NULL) {
  8067d3:	85 c0                	test   %eax,%eax
  8067d5:	75 0e                	jne    8067e5 <dhcp_inform+0x60>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 2, ("dhcp_inform(): could not obtain pcb"));
    mem_free((void *)dhcp);
  8067d7:	89 1c 24             	mov    %ebx,(%esp)
  8067da:	e8 16 0d 00 00       	call   8074f5 <mem_free>
    return;
  8067df:	90                   	nop
  8067e0:	e9 0b 01 00 00       	jmp    8068f0 <dhcp_inform+0x16b>
  }
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_inform(): created new udp pcb\n"));
  /* create and initialize the DHCP message header */
  result = dhcp_create_request(netif);
  8067e5:	89 f0                	mov    %esi,%eax
  8067e7:	e8 54 f5 ff ff       	call   805d40 <dhcp_create_request>
  if (result == ERR_OK) {
  8067ec:	84 c0                	test   %al,%al
  8067ee:	66 90                	xchg   %ax,%ax
  8067f0:	0f 85 d9 00 00 00    	jne    8068cf <dhcp_inform+0x14a>

    dhcp_option(dhcp, DHCP_OPTION_MESSAGE_TYPE, DHCP_OPTION_MESSAGE_TYPE_LEN);
  8067f6:	b9 01 00 00 00       	mov    $0x1,%ecx
  8067fb:	ba 35 00 00 00       	mov    $0x35,%edx
  806800:	89 d8                	mov    %ebx,%eax
  806802:	e8 15 f1 ff ff       	call   80591c <dhcp_option>
    dhcp_option_byte(dhcp, DHCP_INFORM);
  806807:	ba 08 00 00 00       	mov    $0x8,%edx
  80680c:	89 d8                	mov    %ebx,%eax
  80680e:	e8 78 f1 ff ff       	call   80598b <dhcp_option_byte>

    dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);
  806813:	b9 02 00 00 00       	mov    $0x2,%ecx
  806818:	ba 39 00 00 00       	mov    $0x39,%edx
  80681d:	89 d8                	mov    %ebx,%eax
  80681f:	e8 f8 f0 ff ff       	call   80591c <dhcp_option>
    /* TODO: use netif->mtu ?! */
    dhcp_option_short(dhcp, 576);
  806824:	ba 40 02 00 00       	mov    $0x240,%edx
  806829:	89 d8                	mov    %ebx,%eax
  80682b:	e8 75 f2 ff ff       	call   805aa5 <dhcp_option_short>

    dhcp_option_trailer(dhcp);
  806830:	89 d8                	mov    %ebx,%eax
  806832:	e8 a4 f1 ff ff       	call   8059db <dhcp_option_trailer>

    pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
  806837:	0f b7 43 24          	movzwl 0x24(%ebx),%eax
  80683b:	66 05 f0 00          	add    $0xf0,%ax
  80683f:	0f b7 c0             	movzwl %ax,%eax
  806842:	89 44 24 04          	mov    %eax,0x4(%esp)
  806846:	8b 43 1c             	mov    0x1c(%ebx),%eax
  806849:	89 04 24             	mov    %eax,(%esp)
  80684c:	e8 38 18 00 00       	call   808089 <pbuf_realloc>

    udp_bind(dhcp->pcb, IP_ADDR_ANY, DHCP_CLIENT_PORT);
  806851:	c7 44 24 08 44 00 00 	movl   $0x44,0x8(%esp)
  806858:	00 
  806859:	c7 44 24 04 a4 3c 81 	movl   $0x813ca4,0x4(%esp)
  806860:	00 
  806861:	8b 43 08             	mov    0x8(%ebx),%eax
  806864:	89 04 24             	mov    %eax,(%esp)
  806867:	e8 cc 58 00 00       	call   80c138 <udp_bind>
    udp_connect(dhcp->pcb, IP_ADDR_BROADCAST, DHCP_SERVER_PORT);
  80686c:	c7 44 24 08 43 00 00 	movl   $0x43,0x8(%esp)
  806873:	00 
  806874:	c7 44 24 04 a8 3c 81 	movl   $0x813ca8,0x4(%esp)
  80687b:	00 
  80687c:	8b 43 08             	mov    0x8(%ebx),%eax
  80687f:	89 04 24             	mov    %eax,(%esp)
  806882:	e8 77 59 00 00       	call   80c1fe <udp_connect>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_inform: INFORMING\n"));
    udp_sendto_if(dhcp->pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif);
  806887:	89 74 24 10          	mov    %esi,0x10(%esp)
  80688b:	c7 44 24 0c 43 00 00 	movl   $0x43,0xc(%esp)
  806892:	00 
  806893:	c7 44 24 08 a8 3c 81 	movl   $0x813ca8,0x8(%esp)
  80689a:	00 
  80689b:	8b 43 1c             	mov    0x1c(%ebx),%eax
  80689e:	89 44 24 04          	mov    %eax,0x4(%esp)
  8068a2:	8b 43 08             	mov    0x8(%ebx),%eax
  8068a5:	89 04 24             	mov    %eax,(%esp)
  8068a8:	e8 d3 59 00 00       	call   80c280 <udp_sendto_if>
    udp_connect(dhcp->pcb, IP_ADDR_ANY, DHCP_SERVER_PORT);
  8068ad:	c7 44 24 08 43 00 00 	movl   $0x43,0x8(%esp)
  8068b4:	00 
  8068b5:	c7 44 24 04 a4 3c 81 	movl   $0x813ca4,0x4(%esp)
  8068bc:	00 
  8068bd:	8b 43 08             	mov    0x8(%ebx),%eax
  8068c0:	89 04 24             	mov    %eax,(%esp)
  8068c3:	e8 36 59 00 00       	call   80c1fe <udp_connect>
    dhcp_delete_request(netif);
  8068c8:	89 f0                	mov    %esi,%eax
  8068ca:	e8 06 f3 ff ff       	call   805bd5 <dhcp_delete_request>
  } else {
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 2, ("dhcp_inform: could not allocate DHCP request\n"));
  }

  if (dhcp != NULL) {
    if (dhcp->pcb != NULL) {
  8068cf:	8b 43 08             	mov    0x8(%ebx),%eax
  8068d2:	85 c0                	test   %eax,%eax
  8068d4:	74 08                	je     8068de <dhcp_inform+0x159>
      udp_remove(dhcp->pcb);
  8068d6:	89 04 24             	mov    %eax,(%esp)
  8068d9:	e8 0e 58 00 00       	call   80c0ec <udp_remove>
    }
    dhcp->pcb = NULL;
  8068de:	c7 43 08 00 00 00 00 	movl   $0x0,0x8(%ebx)
    mem_free((void *)dhcp);
  8068e5:	89 1c 24             	mov    %ebx,(%esp)
  8068e8:	e8 08 0c 00 00       	call   8074f5 <mem_free>
    netif->dhcp = old_dhcp;
  8068ed:	89 7e 20             	mov    %edi,0x20(%esi)
  }
}
  8068f0:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  8068f3:	8b 75 f8             	mov    -0x8(%ebp),%esi
  8068f6:	8b 7d fc             	mov    -0x4(%ebp),%edi
  8068f9:	89 ec                	mov    %ebp,%esp
  8068fb:	5d                   	pop    %ebp
  8068fc:	c3                   	ret    

008068fd <dhcp_start>:
 * - ERR_OK - No error
 * - ERR_MEM - Out of memory
 */
err_t
dhcp_start(struct netif *netif)
{
  8068fd:	55                   	push   %ebp
  8068fe:	89 e5                	mov    %esp,%ebp
  806900:	56                   	push   %esi
  806901:	53                   	push   %ebx
  806902:	83 ec 10             	sub    $0x10,%esp
  806905:	8b 75 08             	mov    0x8(%ebp),%esi
  struct dhcp *dhcp;
  err_t result = ERR_OK;

  LWIP_ERROR("netif != NULL", (netif != NULL), return ERR_ARG;);
  806908:	85 f6                	test   %esi,%esi
  80690a:	75 1c                	jne    806928 <dhcp_start+0x2b>
  80690c:	c7 44 24 08 fb 33 81 	movl   $0x8133fb,0x8(%esp)
  806913:	00 
  806914:	c7 44 24 04 38 02 00 	movl   $0x238,0x4(%esp)
  80691b:	00 
  80691c:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  806923:	e8 74 a0 ff ff       	call   80099c <_panic>
  dhcp = netif->dhcp;
  806928:	8b 5e 20             	mov    0x20(%esi),%ebx
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_start(netif=%p) %c%c%"U16_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));
  /* Remove the flag that says this netif is handled by DHCP,
     it is set when we succeeded starting. */
  netif->flags &= ~NETIF_FLAG_DHCP;
  80692b:	80 66 2e f7          	andb   $0xf7,0x2e(%esi)

  /* no DHCP client attached yet? */
  if (dhcp == NULL) {
  80692f:	85 db                	test   %ebx,%ebx
  806931:	75 1e                	jne    806951 <dhcp_start+0x54>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): starting new DHCP client\n"));
    dhcp = mem_malloc(sizeof(struct dhcp));
  806933:	c7 04 24 58 00 00 00 	movl   $0x58,(%esp)
  80693a:	e8 21 08 00 00       	call   807160 <mem_malloc>
  80693f:	89 c3                	mov    %eax,%ebx
    if (dhcp == NULL) {
  806941:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  806946:	85 db                	test   %ebx,%ebx
  806948:	0f 84 a5 00 00 00    	je     8069f3 <dhcp_start+0xf6>
      LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): could not allocate dhcp\n"));
      return ERR_MEM;
    }
    /* store this dhcp client in the netif */
    netif->dhcp = dhcp;
  80694e:	89 5e 20             	mov    %ebx,0x20(%esi)
  } else {
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE | 3, ("dhcp_start(): restarting DHCP configuration\n"));
  }
    
  /* clear data structure */
  memset(dhcp, 0, sizeof(struct dhcp));
  806951:	c7 44 24 08 58 00 00 	movl   $0x58,0x8(%esp)
  806958:	00 
  806959:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  806960:	00 
  806961:	89 1c 24             	mov    %ebx,(%esp)
  806964:	e8 1d a9 ff ff       	call   801286 <memset>
  /* allocate UDP PCB */
  dhcp->pcb = udp_new();
  806969:	e8 41 57 00 00       	call   80c0af <udp_new>
  80696e:	89 43 08             	mov    %eax,0x8(%ebx)
  if (dhcp->pcb == NULL) {
  806971:	85 c0                	test   %eax,%eax
  806973:	75 16                	jne    80698b <dhcp_start+0x8e>
    LWIP_DEBUGF(DHCP_DEBUG  | LWIP_DBG_TRACE, ("dhcp_start(): could not obtain pcb\n"));
    mem_free((void *)dhcp);
  806975:	89 1c 24             	mov    %ebx,(%esp)
  806978:	e8 78 0b 00 00       	call   8074f5 <mem_free>
    netif->dhcp = dhcp = NULL;
  80697d:	c7 46 20 00 00 00 00 	movl   $0x0,0x20(%esi)
  806984:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
    return ERR_MEM;
  806989:	eb 68                	jmp    8069f3 <dhcp_start+0xf6>
  }
  /* set up local and remote port for the pcb */
  udp_bind(dhcp->pcb, IP_ADDR_ANY, DHCP_CLIENT_PORT);
  80698b:	c7 44 24 08 44 00 00 	movl   $0x44,0x8(%esp)
  806992:	00 
  806993:	c7 44 24 04 a4 3c 81 	movl   $0x813ca4,0x4(%esp)
  80699a:	00 
  80699b:	89 04 24             	mov    %eax,(%esp)
  80699e:	e8 95 57 00 00       	call   80c138 <udp_bind>
  udp_connect(dhcp->pcb, IP_ADDR_ANY, DHCP_SERVER_PORT);
  8069a3:	c7 44 24 08 43 00 00 	movl   $0x43,0x8(%esp)
  8069aa:	00 
  8069ab:	c7 44 24 04 a4 3c 81 	movl   $0x813ca4,0x4(%esp)
  8069b2:	00 
  8069b3:	8b 43 08             	mov    0x8(%ebx),%eax
  8069b6:	89 04 24             	mov    %eax,(%esp)
  8069b9:	e8 40 58 00 00       	call   80c1fe <udp_connect>
  /* set up the recv callback and argument */
  udp_recv(dhcp->pcb, dhcp_recv, netif);
  8069be:	89 74 24 08          	mov    %esi,0x8(%esp)
  8069c2:	c7 44 24 04 d2 6b 80 	movl   $0x806bd2,0x4(%esp)
  8069c9:	00 
  8069ca:	8b 43 08             	mov    0x8(%ebx),%eax
  8069cd:	89 04 24             	mov    %eax,(%esp)
  8069d0:	e8 c6 56 00 00       	call   80c09b <udp_recv>
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): starting DHCP configuration\n"));
  /* (re)start the DHCP negotiation */
  result = dhcp_discover(netif);
  8069d5:	89 f0                	mov    %esi,%eax
  8069d7:	e8 dc f7 ff ff       	call   8061b8 <dhcp_discover>
  if (result != ERR_OK) {
  8069dc:	84 c0                	test   %al,%al
  8069de:	74 0f                	je     8069ef <dhcp_start+0xf2>
    /* free resources allocated above */
    dhcp_stop(netif);
  8069e0:	89 34 24             	mov    %esi,(%esp)
  8069e3:	e8 d9 f2 ff ff       	call   805cc1 <dhcp_stop>
  8069e8:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
    return ERR_MEM;
  8069ed:	eb 04                	jmp    8069f3 <dhcp_start+0xf6>
  }
  /* Set the flag that says this netif is handled by DHCP. */
  netif->flags |= NETIF_FLAG_DHCP;
  8069ef:	80 4e 2e 08          	orb    $0x8,0x2e(%esi)
  return result;
}
  8069f3:	83 c4 10             	add    $0x10,%esp
  8069f6:	5b                   	pop    %ebx
  8069f7:	5e                   	pop    %esi
  8069f8:	5d                   	pop    %ebp
  8069f9:	c3                   	ret    

008069fa <dhcp_check>:
 *
 * @param netif the netif under DHCP control
 */
static void
dhcp_check(struct netif *netif)
{
  8069fa:	55                   	push   %ebp
  8069fb:	89 e5                	mov    %esp,%ebp
  8069fd:	53                   	push   %ebx
  8069fe:	83 ec 14             	sub    $0x14,%esp
  struct dhcp *dhcp = netif->dhcp;
  806a01:	8b 58 20             	mov    0x20(%eax),%ebx
  u16_t msecs;
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 3, ("dhcp_check(netif=%p) %c%c\n", (void *)netif, (s16_t)netif->name[0],
    (s16_t)netif->name[1]));
  /* create an ARP query for the offered IP address, expecting that no host
     responds, as the IP address should not be in use. */
  result = etharp_query(netif, &dhcp->offered_ip_addr, NULL);
  806a04:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  806a0b:	00 
  806a0c:	8d 53 30             	lea    0x30(%ebx),%edx
  806a0f:	89 54 24 04          	mov    %edx,0x4(%esp)
  806a13:	89 04 24             	mov    %eax,(%esp)
  806a16:	e8 9c 62 00 00       	call   80ccb7 <etharp_query>
  if (result != ERR_OK) {
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 2, ("dhcp_check: could not perform ARP query\n"));
  }
  dhcp->tries++;
  806a1b:	80 43 01 01          	addb   $0x1,0x1(%ebx)
  msecs = 500;
  dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
  806a1f:	66 c7 43 26 01 00    	movw   $0x1,0x26(%ebx)
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_check(): set request timeout %"U16_F" msecs\n", msecs));
  dhcp_set_state(dhcp, DHCP_CHECKING);
  806a25:	ba 08 00 00 00       	mov    $0x8,%edx
  806a2a:	89 d8                	mov    %ebx,%eax
  806a2c:	e8 9f ed ff ff       	call   8057d0 <dhcp_set_state>
}
  806a31:	83 c4 14             	add    $0x14,%esp
  806a34:	5b                   	pop    %ebx
  806a35:	5d                   	pop    %ebp
  806a36:	c3                   	ret    

00806a37 <dhcp_bind>:
 *
 * @param netif network interface to bind to the offered address
 */
static void
dhcp_bind(struct netif *netif)
{
  806a37:	55                   	push   %ebp
  806a38:	89 e5                	mov    %esp,%ebp
  806a3a:	57                   	push   %edi
  806a3b:	56                   	push   %esi
  806a3c:	53                   	push   %ebx
  806a3d:	83 ec 2c             	sub    $0x2c,%esp
  806a40:	89 c6                	mov    %eax,%esi
  u32_t timeout;
  struct dhcp *dhcp;
  struct ip_addr sn_mask, gw_addr;
  LWIP_ERROR("dhcp_bind: netif != NULL", (netif != NULL), return;);
  806a42:	85 c0                	test   %eax,%eax
  806a44:	75 1c                	jne    806a62 <dhcp_bind+0x2b>
  806a46:	c7 44 24 08 f0 33 81 	movl   $0x8133f0,0x8(%esp)
  806a4d:	00 
  806a4e:	c7 44 24 04 3d 03 00 	movl   $0x33d,0x4(%esp)
  806a55:	00 
  806a56:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  806a5d:	e8 3a 9f ff ff       	call   80099c <_panic>
  dhcp = netif->dhcp;
  806a62:	8b 58 20             	mov    0x20(%eax),%ebx
  LWIP_ERROR("dhcp_bind: dhcp != NULL", (dhcp != NULL), return;);
  806a65:	85 db                	test   %ebx,%ebx
  806a67:	75 1c                	jne    806a85 <dhcp_bind+0x4e>
  806a69:	c7 44 24 08 09 34 81 	movl   $0x813409,0x8(%esp)
  806a70:	00 
  806a71:	c7 44 24 04 3f 03 00 	movl   $0x33f,0x4(%esp)
  806a78:	00 
  806a79:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  806a80:	e8 17 9f ff ff       	call   80099c <_panic>
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 3, ("dhcp_bind(netif=%p) %c%c%"U16_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));

  /* temporary DHCP lease? */
  if (dhcp->offered_t1_renew != 0xffffffffUL) {
  806a85:	8b 53 50             	mov    0x50(%ebx),%edx
  806a88:	83 fa ff             	cmp    $0xffffffff,%edx
  806a8b:	74 2c                	je     806ab9 <dhcp_bind+0x82>
    /* set renewal period timer */
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_bind(): t1 renewal timer %"U32_F" secs\n", dhcp->offered_t1_renew));
    timeout = (dhcp->offered_t1_renew + DHCP_COARSE_TIMER_SECS / 2) / DHCP_COARSE_TIMER_SECS;
  806a8d:	83 c2 1e             	add    $0x1e,%edx
  806a90:	b9 89 88 88 88       	mov    $0x88888889,%ecx
  806a95:	89 d0                	mov    %edx,%eax
  806a97:	f7 e1                	mul    %ecx
  806a99:	c1 ea 05             	shr    $0x5,%edx
    if(timeout > 0xffff) {
      timeout = 0xffff;
    }
    dhcp->t1_timeout = (u16_t)timeout;
  806a9c:	81 fa ff ff 00 00    	cmp    $0xffff,%edx
  806aa2:	b8 ff ff 00 00       	mov    $0xffff,%eax
  806aa7:	0f 47 d0             	cmova  %eax,%edx
    if (dhcp->t1_timeout == 0) {
      dhcp->t1_timeout = 1;
  806aaa:	66 85 d2             	test   %dx,%dx
  806aad:	b8 01 00 00 00       	mov    $0x1,%eax
  806ab2:	0f 44 d0             	cmove  %eax,%edx
  806ab5:	66 89 53 28          	mov    %dx,0x28(%ebx)
    }
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_bind(): set request timeout %"U32_F" msecs\n", dhcp->offered_t1_renew*1000));
  }
  /* set renewal period timer */
  if (dhcp->offered_t2_rebind != 0xffffffffUL) {
  806ab9:	8b 53 54             	mov    0x54(%ebx),%edx
  806abc:	83 fa ff             	cmp    $0xffffffff,%edx
  806abf:	74 2c                	je     806aed <dhcp_bind+0xb6>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_bind(): t2 rebind timer %"U32_F" secs\n", dhcp->offered_t2_rebind));
    timeout = (dhcp->offered_t2_rebind + DHCP_COARSE_TIMER_SECS / 2) / DHCP_COARSE_TIMER_SECS;
  806ac1:	83 c2 1e             	add    $0x1e,%edx
  806ac4:	b9 89 88 88 88       	mov    $0x88888889,%ecx
  806ac9:	89 d0                	mov    %edx,%eax
  806acb:	f7 e1                	mul    %ecx
  806acd:	c1 ea 05             	shr    $0x5,%edx
    if(timeout > 0xffff) {
      timeout = 0xffff;
    }
    dhcp->t2_timeout = (u16_t)timeout;
  806ad0:	81 fa ff ff 00 00    	cmp    $0xffff,%edx
  806ad6:	b8 ff ff 00 00       	mov    $0xffff,%eax
  806adb:	0f 47 d0             	cmova  %eax,%edx
    if (dhcp->t2_timeout == 0) {
      dhcp->t2_timeout = 1;
  806ade:	66 85 d2             	test   %dx,%dx
  806ae1:	b8 01 00 00 00       	mov    $0x1,%eax
  806ae6:	0f 44 d0             	cmove  %eax,%edx
  806ae9:	66 89 53 2a          	mov    %dx,0x2a(%ebx)
    }
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_bind(): set request timeout %"U32_F" msecs\n", dhcp->offered_t2_rebind*1000));
  }
  /* copy offered network mask */
  ip_addr_set(&sn_mask, &dhcp->offered_sn_mask);
  806aed:	83 fb cc             	cmp    $0xffffffcc,%ebx
  806af0:	0f 84 c5 00 00 00    	je     806bbb <dhcp_bind+0x184>
  806af6:	8b 43 34             	mov    0x34(%ebx),%eax
  806af9:	89 45 e4             	mov    %eax,-0x1c(%ebp)

  /* subnet mask not given? */
  /* TODO: this is not a valid check. what if the network mask is 0? */
  if (sn_mask.addr == 0) {
  806afc:	85 c0                	test   %eax,%eax
  806afe:	75 49                	jne    806b49 <dhcp_bind+0x112>
    /* choose a safe subnet mask given the network class */
    u8_t first_octet = ip4_addr1(&sn_mask);
  806b00:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  806b07:	e8 29 44 00 00       	call   80af35 <ntohl>
  806b0c:	c1 e8 18             	shr    $0x18,%eax
    if (first_octet <= 127) {
  806b0f:	84 c0                	test   %al,%al
  806b11:	78 11                	js     806b24 <dhcp_bind+0xed>
      sn_mask.addr = htonl(0xff000000);
  806b13:	c7 04 24 00 00 00 ff 	movl   $0xff000000,(%esp)
  806b1a:	e8 f5 41 00 00       	call   80ad14 <htonl>
  806b1f:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  806b22:	eb 25                	jmp    806b49 <dhcp_bind+0x112>
    } else if (first_octet >= 192) {
  806b24:	3c bf                	cmp    $0xbf,%al
  806b26:	76 12                	jbe    806b3a <dhcp_bind+0x103>
      sn_mask.addr = htonl(0xffffff00);
  806b28:	c7 04 24 00 ff ff ff 	movl   $0xffffff00,(%esp)
  806b2f:	90                   	nop
  806b30:	e8 df 41 00 00       	call   80ad14 <htonl>
  806b35:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  806b38:	eb 0f                	jmp    806b49 <dhcp_bind+0x112>
    } else {
      sn_mask.addr = htonl(0xffff0000);
  806b3a:	c7 04 24 00 00 ff ff 	movl   $0xffff0000,(%esp)
  806b41:	e8 ce 41 00 00       	call   80ad14 <htonl>
  806b46:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    }
  }

  ip_addr_set(&gw_addr, &dhcp->offered_gw_addr);
  806b49:	83 fb c8             	cmp    $0xffffffc8,%ebx
  806b4c:	74 79                	je     806bc7 <dhcp_bind+0x190>
  806b4e:	8b 43 38             	mov    0x38(%ebx),%eax
  806b51:	89 45 e0             	mov    %eax,-0x20(%ebp)
  /* gateway address not given? */
  if (gw_addr.addr == 0) {
  806b54:	85 c0                	test   %eax,%eax
  806b56:	75 1a                	jne    806b72 <dhcp_bind+0x13b>
    /* copy network address */
    gw_addr.addr = (dhcp->offered_ip_addr.addr & sn_mask.addr);
  806b58:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  806b5b:	23 7b 30             	and    0x30(%ebx),%edi
  806b5e:	89 7d e0             	mov    %edi,-0x20(%ebp)
    /* use first host address on network as gateway */
    gw_addr.addr |= htonl(0x00000001);
  806b61:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  806b68:	e8 a7 41 00 00       	call   80ad14 <htonl>
  806b6d:	09 c7                	or     %eax,%edi
  806b6f:	89 7d e0             	mov    %edi,-0x20(%ebp)
  }

  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_bind(): IP: 0x%08"X32_F"\n", dhcp->offered_ip_addr.addr));
  netif_set_ipaddr(netif, &dhcp->offered_ip_addr);
  806b72:	8d 43 30             	lea    0x30(%ebx),%eax
  806b75:	89 44 24 04          	mov    %eax,0x4(%esp)
  806b79:	89 34 24             	mov    %esi,(%esp)
  806b7c:	e8 d3 0d 00 00       	call   807954 <netif_set_ipaddr>
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_bind(): SN: 0x%08"X32_F"\n", sn_mask.addr));
  netif_set_netmask(netif, &sn_mask);
  806b81:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  806b84:	89 44 24 04          	mov    %eax,0x4(%esp)
  806b88:	89 34 24             	mov    %esi,(%esp)
  806b8b:	e8 e8 0c 00 00       	call   807878 <netif_set_netmask>
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_bind(): GW: 0x%08"X32_F"\n", gw_addr.addr));
  netif_set_gw(netif, &gw_addr);
  806b90:	8d 45 e0             	lea    -0x20(%ebp),%eax
  806b93:	89 44 24 04          	mov    %eax,0x4(%esp)
  806b97:	89 34 24             	mov    %esi,(%esp)
  806b9a:	e8 c0 0c 00 00       	call   80785f <netif_set_gw>
  /* bring the interface up */
  netif_set_up(netif);
  806b9f:	89 34 24             	mov    %esi,(%esp)
  806ba2:	e8 77 0d 00 00       	call   80791e <netif_set_up>
  /* netif is now bound to DHCP leased address */
  dhcp_set_state(dhcp, DHCP_BOUND);
  806ba7:	ba 0a 00 00 00       	mov    $0xa,%edx
  806bac:	89 d8                	mov    %ebx,%eax
  806bae:	e8 1d ec ff ff       	call   8057d0 <dhcp_set_state>
}
  806bb3:	83 c4 2c             	add    $0x2c,%esp
  806bb6:	5b                   	pop    %ebx
  806bb7:	5e                   	pop    %esi
  806bb8:	5f                   	pop    %edi
  806bb9:	5d                   	pop    %ebp
  806bba:	c3                   	ret    
      dhcp->t2_timeout = 1;
    }
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_bind(): set request timeout %"U32_F" msecs\n", dhcp->offered_t2_rebind*1000));
  }
  /* copy offered network mask */
  ip_addr_set(&sn_mask, &dhcp->offered_sn_mask);
  806bbb:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  806bc2:	e9 39 ff ff ff       	jmp    806b00 <dhcp_bind+0xc9>
    } else {
      sn_mask.addr = htonl(0xffff0000);
    }
  }

  ip_addr_set(&gw_addr, &dhcp->offered_gw_addr);
  806bc7:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
  806bce:	66 90                	xchg   %ax,%ax
  806bd0:	eb 86                	jmp    806b58 <dhcp_bind+0x121>

00806bd2 <dhcp_recv>:

/**
 * If an incoming DHCP message is in response to us, then trigger the state machine
 */
static void dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct ip_addr *addr, u16_t port)
{
  806bd2:	55                   	push   %ebp
  806bd3:	89 e5                	mov    %esp,%ebp
  806bd5:	57                   	push   %edi
  806bd6:	56                   	push   %esi
  806bd7:	53                   	push   %ebx
  806bd8:	83 ec 2c             	sub    $0x2c,%esp
  struct netif *netif = (struct netif *)arg;
  806bdb:	8b 45 08             	mov    0x8(%ebp),%eax
  806bde:	89 45 e0             	mov    %eax,-0x20(%ebp)
  struct dhcp *dhcp = netif->dhcp;
  806be1:	8b 50 20             	mov    0x20(%eax),%edx
  806be4:	89 55 e4             	mov    %edx,-0x1c(%ebp)
  struct dhcp_msg *reply_msg = (struct dhcp_msg *)p->payload;
  806be7:	8b 4d 10             	mov    0x10(%ebp),%ecx
  806bea:	8b 71 04             	mov    0x4(%ecx),%esi
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("pbuf->tot_len = %"U16_F"\n", p->tot_len));
  /* prevent warnings about unused arguments */
  LWIP_UNUSED_ARG(pcb);
  LWIP_UNUSED_ARG(addr);
  LWIP_UNUSED_ARG(port);
  dhcp->p = p;
  806bed:	89 4a 0c             	mov    %ecx,0xc(%edx)
  /* TODO: check packet length before reading them */
  if (reply_msg->op != DHCP_BOOTREPLY) {
  806bf0:	80 3e 02             	cmpb   $0x2,(%esi)
  806bf3:	0f 85 33 04 00 00    	jne    80702c <dhcp_recv+0x45a>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 1, ("not a DHCP reply message, but type %"U16_F"\n", (u16_t)reply_msg->op));
    goto free_pbuf_and_return;
  }
  /* iterate through hardware address and match against DHCP message */
  for (i = 0; i < netif->hwaddr_len; i++) {
  806bf9:	0f b6 78 24          	movzbl 0x24(%eax),%edi
  806bfd:	89 fb                	mov    %edi,%ebx
  806bff:	84 db                	test   %bl,%bl
  806c01:	74 35                	je     806c38 <dhcp_recv+0x66>
    if (netif->hwaddr[i] != reply_msg->chaddr[i]) {
  806c03:	0f b6 48 25          	movzbl 0x25(%eax),%ecx
  806c07:	89 c2                	mov    %eax,%edx
  806c09:	b8 00 00 00 00       	mov    $0x0,%eax
  806c0e:	3a 4e 1c             	cmp    0x1c(%esi),%cl
  806c11:	74 1c                	je     806c2f <dhcp_recv+0x5d>
  806c13:	e9 14 04 00 00       	jmp    80702c <dhcp_recv+0x45a>
  806c18:	0f b6 5a 26          	movzbl 0x26(%edx),%ebx
  806c1c:	0f b6 4c 06 1d       	movzbl 0x1d(%esi,%eax,1),%ecx
  806c21:	83 c0 01             	add    $0x1,%eax
  806c24:	83 c2 01             	add    $0x1,%edx
  806c27:	38 cb                	cmp    %cl,%bl
  806c29:	0f 85 fd 03 00 00    	jne    80702c <dhcp_recv+0x45a>
  if (reply_msg->op != DHCP_BOOTREPLY) {
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 1, ("not a DHCP reply message, but type %"U16_F"\n", (u16_t)reply_msg->op));
    goto free_pbuf_and_return;
  }
  /* iterate through hardware address and match against DHCP message */
  for (i = 0; i < netif->hwaddr_len; i++) {
  806c2f:	8d 48 01             	lea    0x1(%eax),%ecx
  806c32:	89 fb                	mov    %edi,%ebx
  806c34:	38 cb                	cmp    %cl,%bl
  806c36:	77 e0                	ja     806c18 <dhcp_recv+0x46>
        (u16_t)i, (u16_t)netif->hwaddr[i], (u16_t)i, (u16_t)reply_msg->chaddr[i]));
      goto free_pbuf_and_return;
    }
  }
  /* match transaction ID against what we expected */
  if (ntohl(reply_msg->xid) != dhcp->xid) {
  806c38:	8b 46 04             	mov    0x4(%esi),%eax
  806c3b:	89 04 24             	mov    %eax,(%esp)
  806c3e:	e8 f2 42 00 00       	call   80af35 <ntohl>
  806c43:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  806c46:	3b 42 04             	cmp    0x4(%edx),%eax
  806c49:	0f 85 dd 03 00 00    	jne    80702c <dhcp_recv+0x45a>
 */
static err_t
dhcp_unfold_reply(struct dhcp *dhcp)
{
  u16_t ret;
  LWIP_ERROR("dhcp != NULL", (dhcp != NULL), return ERR_ARG;);
  806c4f:	85 d2                	test   %edx,%edx
  806c51:	75 1c                	jne    806c6f <dhcp_recv+0x9d>
  806c53:	c7 44 24 08 14 34 81 	movl   $0x813414,0x8(%esp)
  806c5a:	00 
  806c5b:	c7 44 24 04 89 04 00 	movl   $0x489,0x4(%esp)
  806c62:	00 
  806c63:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  806c6a:	e8 2d 9d ff ff       	call   80099c <_panic>
  LWIP_ERROR("dhcp->p != NULL", (dhcp->p != NULL), return ERR_VAL;);
  806c6f:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  806c72:	83 79 0c 00          	cmpl   $0x0,0xc(%ecx)
  806c76:	75 1c                	jne    806c94 <dhcp_recv+0xc2>
  806c78:	c7 44 24 08 21 34 81 	movl   $0x813421,0x8(%esp)
  806c7f:	00 
  806c80:	c7 44 24 04 8a 04 00 	movl   $0x48a,0x4(%esp)
  806c87:	00 
  806c88:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  806c8f:	e8 08 9d ff ff       	call   80099c <_panic>
  /* free any left-overs from previous unfolds */
  dhcp_free_reply(dhcp);
  806c94:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  806c97:	e8 e4 ef ff ff       	call   805c80 <dhcp_free_reply>
  /* options present? */
  if (dhcp->p->tot_len > (sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN)) {
  806c9c:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
  806c9f:	8b 43 0c             	mov    0xc(%ebx),%eax
  806ca2:	0f b7 40 08          	movzwl 0x8(%eax),%eax
  806ca6:	66 3d f0 00          	cmp    $0xf0,%ax
  806caa:	76 1e                	jbe    806cca <dhcp_recv+0xf8>
    dhcp->options_in_len = dhcp->p->tot_len - (sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN);
  806cac:	66 2d f0 00          	sub    $0xf0,%ax
  806cb0:	66 89 43 18          	mov    %ax,0x18(%ebx)
    dhcp->options_in = mem_malloc(dhcp->options_in_len);
  806cb4:	0f b7 c0             	movzwl %ax,%eax
  806cb7:	89 04 24             	mov    %eax,(%esp)
  806cba:	e8 a1 04 00 00       	call   807160 <mem_malloc>
  806cbf:	89 43 14             	mov    %eax,0x14(%ebx)
    if (dhcp->options_in == NULL) {
  806cc2:	85 c0                	test   %eax,%eax
  806cc4:	0f 84 62 03 00 00    	je     80702c <dhcp_recv+0x45a>
      LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 2, ("dhcp_unfold_reply(): could not allocate dhcp->options\n"));
      return ERR_MEM;
    }
  }
  dhcp->msg_in = mem_malloc(sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN);
  806cca:	c7 04 24 f0 00 00 00 	movl   $0xf0,(%esp)
  806cd1:	e8 8a 04 00 00       	call   807160 <mem_malloc>
  806cd6:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  806cd9:	89 42 10             	mov    %eax,0x10(%edx)
  if (dhcp->msg_in == NULL) {
  806cdc:	85 c0                	test   %eax,%eax
  806cde:	75 1a                	jne    806cfa <dhcp_recv+0x128>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 2, ("dhcp_unfold_reply(): could not allocate dhcp->msg_in\n"));
    mem_free((void *)dhcp->options_in);
  806ce0:	8b 42 14             	mov    0x14(%edx),%eax
  806ce3:	89 04 24             	mov    %eax,(%esp)
  806ce6:	e8 0a 08 00 00       	call   8074f5 <mem_free>
    dhcp->options_in = NULL;
  806ceb:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  806cee:	c7 41 14 00 00 00 00 	movl   $0x0,0x14(%ecx)
  806cf5:	e9 32 03 00 00       	jmp    80702c <dhcp_recv+0x45a>
    return ERR_MEM;
  }

  /** copy the DHCP message without options */
  ret = pbuf_copy_partial(dhcp->p, dhcp->msg_in, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN, 0);
  806cfa:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  806d01:	00 
  806d02:	c7 44 24 08 f0 00 00 	movl   $0xf0,0x8(%esp)
  806d09:	00 
  806d0a:	89 44 24 04          	mov    %eax,0x4(%esp)
  806d0e:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
  806d11:	8b 43 0c             	mov    0xc(%ebx),%eax
  806d14:	89 04 24             	mov    %eax,(%esp)
  806d17:	e8 6a 0f 00 00       	call   807c86 <pbuf_copy_partial>
  LWIP_ASSERT("ret == sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN", ret == sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN);
  806d1c:	66 3d f0 00          	cmp    $0xf0,%ax
  806d20:	74 1c                	je     806d3e <dhcp_recv+0x16c>
  806d22:	c7 44 24 08 90 33 81 	movl   $0x813390,0x8(%esp)
  806d29:	00 
  806d2a:	c7 44 24 04 a0 04 00 	movl   $0x4a0,0x4(%esp)
  806d31:	00 
  806d32:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  806d39:	e8 5e 9c ff ff       	call   80099c <_panic>
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_unfold_reply(): copied %"U16_F" bytes into dhcp->msg_in[]\n",
     sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN));

  if (dhcp->options_in != NULL) {
  806d3e:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  806d41:	8b 42 14             	mov    0x14(%edx),%eax
  806d44:	85 c0                	test   %eax,%eax
  806d46:	0f 84 fd 02 00 00    	je     807049 <dhcp_recv+0x477>
    /** copy the DHCP options */
    ret = pbuf_copy_partial(dhcp->p, dhcp->options_in, dhcp->options_in_len, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN);
  806d4c:	c7 44 24 0c f0 00 00 	movl   $0xf0,0xc(%esp)
  806d53:	00 
  806d54:	89 d1                	mov    %edx,%ecx
  806d56:	0f b7 52 18          	movzwl 0x18(%edx),%edx
  806d5a:	89 54 24 08          	mov    %edx,0x8(%esp)
  806d5e:	89 44 24 04          	mov    %eax,0x4(%esp)
  806d62:	8b 41 0c             	mov    0xc(%ecx),%eax
  806d65:	89 04 24             	mov    %eax,(%esp)
  806d68:	e8 19 0f 00 00       	call   807c86 <pbuf_copy_partial>
    LWIP_ASSERT("ret == dhcp->options_in_len", ret == dhcp->options_in_len);
  806d6d:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
  806d70:	66 3b 43 18          	cmp    0x18(%ebx),%ax
  806d74:	0f 84 cf 02 00 00    	je     807049 <dhcp_recv+0x477>
  806d7a:	c7 44 24 08 31 34 81 	movl   $0x813431,0x8(%esp)
  806d81:	00 
  806d82:	c7 44 24 04 a7 04 00 	movl   $0x4a7,0x4(%esp)
  806d89:	00 
  806d8a:	c7 04 24 c2 33 81 00 	movl   $0x8133c2,(%esp)
  806d91:	e8 06 9c ff ff       	call   80099c <_panic>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 1, ("DHCP_OPTION_MESSAGE_TYPE option not found\n"));
    goto free_pbuf_and_return;
  }

  /* read DHCP message type */
  msg_type = dhcp_get_option_byte(options_ptr + 2);
  806d96:	83 c0 02             	add    $0x2,%eax
  806d99:	e8 4d eb ff ff       	call   8058eb <dhcp_get_option_byte>
  /* message type is DHCP ACK? */
  if (msg_type == DHCP_ACK) {
  806d9e:	3c 05                	cmp    $0x5,%al
  806da0:	0f 85 a5 01 00 00    	jne    806f4b <dhcp_recv+0x379>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 1, ("DHCP_ACK received\n"));
    /* in requesting state? */
    if (dhcp->state == DHCP_REQUESTING) {
  806da6:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  806da9:	0f b6 02             	movzbl (%edx),%eax
  806dac:	3c 01                	cmp    $0x1,%al
  806dae:	0f 85 76 01 00 00    	jne    806f2a <dhcp_recv+0x358>
 * @param netif the netif under DHCP control
 */
static void
dhcp_handle_ack(struct netif *netif)
{
  struct dhcp *dhcp = netif->dhcp;
  806db4:	8b 4d e0             	mov    -0x20(%ebp),%ecx
  806db7:	8b 59 20             	mov    0x20(%ecx),%ebx
  u8_t *option_ptr;
  /* clear options we might not get from the ACK */
  dhcp->offered_sn_mask.addr = 0;
  806dba:	c7 43 34 00 00 00 00 	movl   $0x0,0x34(%ebx)
  dhcp->offered_gw_addr.addr = 0;
  806dc1:	c7 43 38 00 00 00 00 	movl   $0x0,0x38(%ebx)
  dhcp->offered_bc_addr.addr = 0;
  806dc8:	c7 43 3c 00 00 00 00 	movl   $0x0,0x3c(%ebx)

  /* lease time given? */
  option_ptr = dhcp_get_option_ptr(dhcp, DHCP_OPTION_LEASE_TIME);
  806dcf:	ba 33 00 00 00       	mov    $0x33,%edx
  806dd4:	89 d8                	mov    %ebx,%eax
  806dd6:	e8 04 ea ff ff       	call   8057df <dhcp_get_option_ptr>
  if (option_ptr != NULL) {
  806ddb:	85 c0                	test   %eax,%eax
  806ddd:	74 0b                	je     806dea <dhcp_recv+0x218>
    /* remember offered lease time */
    dhcp->offered_t0_lease = dhcp_get_option_long(option_ptr + 2);
  806ddf:	83 c0 02             	add    $0x2,%eax
  806de2:	e8 0c eb ff ff       	call   8058f3 <dhcp_get_option_long>
  806de7:	89 43 4c             	mov    %eax,0x4c(%ebx)
  }
  /* renewal period given? */
  option_ptr = dhcp_get_option_ptr(dhcp, DHCP_OPTION_T1);
  806dea:	ba 3a 00 00 00       	mov    $0x3a,%edx
  806def:	89 d8                	mov    %ebx,%eax
  806df1:	e8 e9 e9 ff ff       	call   8057df <dhcp_get_option_ptr>
  if (option_ptr != NULL) {
  806df6:	85 c0                	test   %eax,%eax
  806df8:	74 0d                	je     806e07 <dhcp_recv+0x235>
    /* remember given renewal period */
    dhcp->offered_t1_renew = dhcp_get_option_long(option_ptr + 2);
  806dfa:	83 c0 02             	add    $0x2,%eax
  806dfd:	e8 f1 ea ff ff       	call   8058f3 <dhcp_get_option_long>
  806e02:	89 43 50             	mov    %eax,0x50(%ebx)
  806e05:	eb 08                	jmp    806e0f <dhcp_recv+0x23d>
  } else {
    /* calculate safe periods for renewal */
    dhcp->offered_t1_renew = dhcp->offered_t0_lease / 2;
  806e07:	8b 43 4c             	mov    0x4c(%ebx),%eax
  806e0a:	d1 e8                	shr    %eax
  806e0c:	89 43 50             	mov    %eax,0x50(%ebx)
  }

  /* renewal period given? */
  option_ptr = dhcp_get_option_ptr(dhcp, DHCP_OPTION_T2);
  806e0f:	ba 3b 00 00 00       	mov    $0x3b,%edx
  806e14:	89 d8                	mov    %ebx,%eax
  806e16:	e8 c4 e9 ff ff       	call   8057df <dhcp_get_option_ptr>
  if (option_ptr != NULL) {
  806e1b:	85 c0                	test   %eax,%eax
  806e1d:	74 0d                	je     806e2c <dhcp_recv+0x25a>
    /* remember given rebind period */
    dhcp->offered_t2_rebind = dhcp_get_option_long(option_ptr + 2);
  806e1f:	83 c0 02             	add    $0x2,%eax
  806e22:	e8 cc ea ff ff       	call   8058f3 <dhcp_get_option_long>
  806e27:	89 43 54             	mov    %eax,0x54(%ebx)
  806e2a:	eb 06                	jmp    806e32 <dhcp_recv+0x260>
  } else {
    /* calculate safe periods for rebinding */
    dhcp->offered_t2_rebind = dhcp->offered_t0_lease;
  806e2c:	8b 43 4c             	mov    0x4c(%ebx),%eax
  806e2f:	89 43 54             	mov    %eax,0x54(%ebx)
  }

  /* (y)our internet address */
  ip_addr_set(&dhcp->offered_ip_addr, &dhcp->msg_in->yiaddr);
  806e32:	8b 53 10             	mov    0x10(%ebx),%edx
  806e35:	b8 00 00 00 00       	mov    $0x0,%eax
  806e3a:	83 fa f0             	cmp    $0xfffffff0,%edx
  806e3d:	74 03                	je     806e42 <dhcp_recv+0x270>
  806e3f:	8b 42 10             	mov    0x10(%edx),%eax
  806e42:	89 43 30             	mov    %eax,0x30(%ebx)
    strcpy(dhcp->boot_file_name, dhcp->msg_in->file);
  }
#endif

  /* subnet mask */
  option_ptr = dhcp_get_option_ptr(dhcp, DHCP_OPTION_SUBNET_MASK);
  806e45:	ba 01 00 00 00       	mov    $0x1,%edx
  806e4a:	89 d8                	mov    %ebx,%eax
  806e4c:	e8 8e e9 ff ff       	call   8057df <dhcp_get_option_ptr>
  /* subnet mask given? */
  if (option_ptr != NULL) {
  806e51:	85 c0                	test   %eax,%eax
  806e53:	74 13                	je     806e68 <dhcp_recv+0x296>
    dhcp->offered_sn_mask.addr = htonl(dhcp_get_option_long(&option_ptr[2]));
  806e55:	83 c0 02             	add    $0x2,%eax
  806e58:	e8 96 ea ff ff       	call   8058f3 <dhcp_get_option_long>
  806e5d:	89 04 24             	mov    %eax,(%esp)
  806e60:	e8 af 3e 00 00       	call   80ad14 <htonl>
  806e65:	89 43 34             	mov    %eax,0x34(%ebx)
  }

  /* gateway router */
  option_ptr = dhcp_get_option_ptr(dhcp, DHCP_OPTION_ROUTER);
  806e68:	ba 03 00 00 00       	mov    $0x3,%edx
  806e6d:	89 d8                	mov    %ebx,%eax
  806e6f:	e8 6b e9 ff ff       	call   8057df <dhcp_get_option_ptr>
  if (option_ptr != NULL) {
  806e74:	85 c0                	test   %eax,%eax
  806e76:	74 13                	je     806e8b <dhcp_recv+0x2b9>
    dhcp->offered_gw_addr.addr = htonl(dhcp_get_option_long(&option_ptr[2]));
  806e78:	83 c0 02             	add    $0x2,%eax
  806e7b:	e8 73 ea ff ff       	call   8058f3 <dhcp_get_option_long>
  806e80:	89 04 24             	mov    %eax,(%esp)
  806e83:	e8 8c 3e 00 00       	call   80ad14 <htonl>
  806e88:	89 43 38             	mov    %eax,0x38(%ebx)
  }

  /* broadcast address */
  option_ptr = dhcp_get_option_ptr(dhcp, DHCP_OPTION_BROADCAST);
  806e8b:	ba 1c 00 00 00       	mov    $0x1c,%edx
  806e90:	89 d8                	mov    %ebx,%eax
  806e92:	e8 48 e9 ff ff       	call   8057df <dhcp_get_option_ptr>
  if (option_ptr != NULL) {
  806e97:	85 c0                	test   %eax,%eax
  806e99:	74 13                	je     806eae <dhcp_recv+0x2dc>
    dhcp->offered_bc_addr.addr = htonl(dhcp_get_option_long(&option_ptr[2]));
  806e9b:	83 c0 02             	add    $0x2,%eax
  806e9e:	e8 50 ea ff ff       	call   8058f3 <dhcp_get_option_long>
  806ea3:	89 04 24             	mov    %eax,(%esp)
  806ea6:	e8 69 3e 00 00       	call   80ad14 <htonl>
  806eab:	89 43 3c             	mov    %eax,0x3c(%ebx)
  }
  
  /* DNS servers */
  option_ptr = dhcp_get_option_ptr(dhcp, DHCP_OPTION_DNS_SERVER);
  806eae:	ba 06 00 00 00       	mov    $0x6,%edx
  806eb3:	89 d8                	mov    %ebx,%eax
  806eb5:	e8 25 e9 ff ff       	call   8057df <dhcp_get_option_ptr>
  806eba:	89 c6                	mov    %eax,%esi
  if (option_ptr != NULL) {
  806ebc:	85 c0                	test   %eax,%eax
  806ebe:	74 54                	je     806f14 <dhcp_recv+0x342>
    u8_t n;
    dhcp->dns_count = dhcp_get_option_byte(&option_ptr[1]) / (u32_t)sizeof(struct ip_addr);
  806ec0:	8d 40 01             	lea    0x1(%eax),%eax
  806ec3:	e8 23 ea ff ff       	call   8058eb <dhcp_get_option_byte>
  806ec8:	c0 e8 02             	shr    $0x2,%al
  806ecb:	0f b6 c0             	movzbl %al,%eax
    /* limit to at most DHCP_MAX_DNS DNS servers */
    if (dhcp->dns_count > DHCP_MAX_DNS)
      dhcp->dns_count = DHCP_MAX_DNS;
  806ece:	83 f8 03             	cmp    $0x3,%eax
  806ed1:	ba 02 00 00 00       	mov    $0x2,%edx
  806ed6:	0f 43 c2             	cmovae %edx,%eax
  806ed9:	89 43 40             	mov    %eax,0x40(%ebx)
  806edc:	bf 00 00 00 00       	mov    $0x0,%edi
  806ee1:	89 f8                	mov    %edi,%eax
  806ee3:	89 f7                	mov    %esi,%edi
  806ee5:	89 de                	mov    %ebx,%esi
  806ee7:	89 c3                	mov    %eax,%ebx
  806ee9:	eb 21                	jmp    806f0c <dhcp_recv+0x33a>
    for (n = 0; n < dhcp->dns_count; n++) {
      dhcp->offered_dns_addr[n].addr = htonl(dhcp_get_option_long(&option_ptr[2 + n * 4]));
  806eeb:	0f b6 c3             	movzbl %bl,%eax
  806eee:	89 45 dc             	mov    %eax,-0x24(%ebp)
  806ef1:	8d 44 87 02          	lea    0x2(%edi,%eax,4),%eax
  806ef5:	e8 f9 e9 ff ff       	call   8058f3 <dhcp_get_option_long>
  806efa:	89 04 24             	mov    %eax,(%esp)
  806efd:	e8 12 3e 00 00       	call   80ad14 <htonl>
  806f02:	8b 55 dc             	mov    -0x24(%ebp),%edx
  806f05:	89 44 96 44          	mov    %eax,0x44(%esi,%edx,4)
    u8_t n;
    dhcp->dns_count = dhcp_get_option_byte(&option_ptr[1]) / (u32_t)sizeof(struct ip_addr);
    /* limit to at most DHCP_MAX_DNS DNS servers */
    if (dhcp->dns_count > DHCP_MAX_DNS)
      dhcp->dns_count = DHCP_MAX_DNS;
    for (n = 0; n < dhcp->dns_count; n++) {
  806f09:	83 c3 01             	add    $0x1,%ebx
  806f0c:	0f b6 c3             	movzbl %bl,%eax
  806f0f:	3b 46 40             	cmp    0x40(%esi),%eax
  806f12:	72 d7                	jb     806eeb <dhcp_recv+0x319>
  if (msg_type == DHCP_ACK) {
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 1, ("DHCP_ACK received\n"));
    /* in requesting state? */
    if (dhcp->state == DHCP_REQUESTING) {
      dhcp_handle_ack(netif);
      dhcp->request_timeout = 0;
  806f14:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  806f17:	66 c7 41 26 00 00    	movw   $0x0,0x26(%ecx)
#if DHCP_DOES_ARP_CHECK
      /* check if the acknowledged lease address is already in use */
      dhcp_check(netif);
  806f1d:	8b 45 e0             	mov    -0x20(%ebp),%eax
  806f20:	e8 d5 fa ff ff       	call   8069fa <dhcp_check>
  806f25:	e9 02 01 00 00       	jmp    80702c <dhcp_recv+0x45a>
      /* bind interface to the acknowledged lease address */
      dhcp_bind(netif);
#endif
    }
    /* already bound to the given lease address? */
    else if ((dhcp->state == DHCP_REBOOTING) || (dhcp->state == DHCP_REBINDING) || (dhcp->state == DHCP_RENEWING)) {
  806f2a:	83 e8 03             	sub    $0x3,%eax
  806f2d:	3c 02                	cmp    $0x2,%al
  806f2f:	0f 87 f7 00 00 00    	ja     80702c <dhcp_recv+0x45a>
      dhcp->request_timeout = 0;
  806f35:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
  806f38:	66 c7 43 26 00 00    	movw   $0x0,0x26(%ebx)
      dhcp_bind(netif);
  806f3e:	8b 45 e0             	mov    -0x20(%ebp),%eax
  806f41:	e8 f1 fa ff ff       	call   806a37 <dhcp_bind>
  806f46:	e9 e1 00 00 00       	jmp    80702c <dhcp_recv+0x45a>
    }
  }
  /* received a DHCP_NAK in appropriate state? */
  else if ((msg_type == DHCP_NAK) &&
  806f4b:	3c 06                	cmp    $0x6,%al
  806f4d:	0f 85 80 00 00 00    	jne    806fd3 <dhcp_recv+0x401>
    ((dhcp->state == DHCP_REBOOTING) || (dhcp->state == DHCP_REQUESTING) ||
  806f53:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  806f56:	0f b6 02             	movzbl (%edx),%eax
      dhcp->request_timeout = 0;
      dhcp_bind(netif);
    }
  }
  /* received a DHCP_NAK in appropriate state? */
  else if ((msg_type == DHCP_NAK) &&
  806f59:	3c 03                	cmp    $0x3,%al
  806f5b:	74 10                	je     806f6d <dhcp_recv+0x39b>
  806f5d:	3c 01                	cmp    $0x1,%al
  806f5f:	74 0c                	je     806f6d <dhcp_recv+0x39b>
  806f61:	3c 04                	cmp    $0x4,%al
  806f63:	74 08                	je     806f6d <dhcp_recv+0x39b>
  806f65:	3c 05                	cmp    $0x5,%al
  806f67:	0f 85 bf 00 00 00    	jne    80702c <dhcp_recv+0x45a>
    ((dhcp->state == DHCP_REBOOTING) || (dhcp->state == DHCP_REQUESTING) ||
     (dhcp->state == DHCP_REBINDING) || (dhcp->state == DHCP_RENEWING  ))) {
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 1, ("DHCP_NAK received\n"));
    dhcp->request_timeout = 0;
  806f6d:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  806f70:	66 c7 41 26 00 00    	movw   $0x0,0x26(%ecx)
 * @param netif the netif under DHCP control
 */
static void
dhcp_handle_nak(struct netif *netif)
{
  struct dhcp *dhcp = netif->dhcp;
  806f76:	8b 45 e0             	mov    -0x20(%ebp),%eax
  806f79:	8b 58 20             	mov    0x20(%eax),%ebx
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 3, ("dhcp_handle_nak(netif=%p) %c%c%"U16_F"\n", 
    (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));
  /* Set the interface down since the address must no longer be used, as per RFC2131 */
  netif_set_down(netif);
  806f7c:	89 04 24             	mov    %eax,(%esp)
  806f7f:	e8 74 09 00 00       	call   8078f8 <netif_set_down>
  /* remove IP address from interface */
  netif_set_ipaddr(netif, IP_ADDR_ANY);
  806f84:	c7 44 24 04 a4 3c 81 	movl   $0x813ca4,0x4(%esp)
  806f8b:	00 
  806f8c:	8b 55 e0             	mov    -0x20(%ebp),%edx
  806f8f:	89 14 24             	mov    %edx,(%esp)
  806f92:	e8 bd 09 00 00       	call   807954 <netif_set_ipaddr>
  netif_set_gw(netif, IP_ADDR_ANY);
  806f97:	c7 44 24 04 a4 3c 81 	movl   $0x813ca4,0x4(%esp)
  806f9e:	00 
  806f9f:	8b 4d e0             	mov    -0x20(%ebp),%ecx
  806fa2:	89 0c 24             	mov    %ecx,(%esp)
  806fa5:	e8 b5 08 00 00       	call   80785f <netif_set_gw>
  netif_set_netmask(netif, IP_ADDR_ANY); 
  806faa:	c7 44 24 04 a4 3c 81 	movl   $0x813ca4,0x4(%esp)
  806fb1:	00 
  806fb2:	8b 45 e0             	mov    -0x20(%ebp),%eax
  806fb5:	89 04 24             	mov    %eax,(%esp)
  806fb8:	e8 bb 08 00 00       	call   807878 <netif_set_netmask>
  /* Change to a defined state */
  dhcp_set_state(dhcp, DHCP_BACKING_OFF);
  806fbd:	ba 0c 00 00 00       	mov    $0xc,%edx
  806fc2:	89 d8                	mov    %ebx,%eax
  806fc4:	e8 07 e8 ff ff       	call   8057d0 <dhcp_set_state>
  /* We can immediately restart discovery */
  dhcp_discover(netif);
  806fc9:	8b 45 e0             	mov    -0x20(%ebp),%eax
  806fcc:	e8 e7 f1 ff ff       	call   8061b8 <dhcp_discover>
  806fd1:	eb 59                	jmp    80702c <dhcp_recv+0x45a>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 1, ("DHCP_NAK received\n"));
    dhcp->request_timeout = 0;
    dhcp_handle_nak(netif);
  }
  /* received a DHCP_OFFER in DHCP_SELECTING state? */
  else if ((msg_type == DHCP_OFFER) && (dhcp->state == DHCP_SELECTING)) {
  806fd3:	3c 02                	cmp    $0x2,%al
  806fd5:	75 55                	jne    80702c <dhcp_recv+0x45a>
  806fd7:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  806fda:	80 3a 06             	cmpb   $0x6,(%edx)
  806fdd:	8d 76 00             	lea    0x0(%esi),%esi
  806fe0:	75 4a                	jne    80702c <dhcp_recv+0x45a>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 1, ("DHCP_OFFER received in DHCP_SELECTING state\n"));
    dhcp->request_timeout = 0;
  806fe2:	66 c7 42 26 00 00    	movw   $0x0,0x26(%edx)
 * @param netif the netif under DHCP control
 */
static void
dhcp_handle_offer(struct netif *netif)
{
  struct dhcp *dhcp = netif->dhcp;
  806fe8:	8b 4d e0             	mov    -0x20(%ebp),%ecx
  806feb:	8b 59 20             	mov    0x20(%ecx),%ebx
  /* obtain the server address */
  u8_t *option_ptr = dhcp_get_option_ptr(dhcp, DHCP_OPTION_SERVER_ID);
  806fee:	ba 36 00 00 00       	mov    $0x36,%edx
  806ff3:	89 d8                	mov    %ebx,%eax
  806ff5:	e8 e5 e7 ff ff       	call   8057df <dhcp_get_option_ptr>
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 3, ("dhcp_handle_offer(netif=%p) %c%c%"U16_F"\n",
    (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));
  if (option_ptr != NULL) {
  806ffa:	85 c0                	test   %eax,%eax
  806ffc:	74 2e                	je     80702c <dhcp_recv+0x45a>
    dhcp->server_ip_addr.addr = htonl(dhcp_get_option_long(&option_ptr[2]));
  806ffe:	83 c0 02             	add    $0x2,%eax
  807001:	e8 ed e8 ff ff       	call   8058f3 <dhcp_get_option_long>
  807006:	89 04 24             	mov    %eax,(%esp)
  807009:	e8 06 3d 00 00       	call   80ad14 <htonl>
  80700e:	89 43 2c             	mov    %eax,0x2c(%ebx)
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_handle_offer(): server 0x%08"X32_F"\n", dhcp->server_ip_addr.addr));
    /* remember offered address */
    ip_addr_set(&dhcp->offered_ip_addr, (struct ip_addr *)&dhcp->msg_in->yiaddr);
  807011:	8b 53 10             	mov    0x10(%ebx),%edx
  807014:	b8 00 00 00 00       	mov    $0x0,%eax
  807019:	83 fa f0             	cmp    $0xfffffff0,%edx
  80701c:	74 03                	je     807021 <dhcp_recv+0x44f>
  80701e:	8b 42 10             	mov    0x10(%edx),%eax
  807021:	89 43 30             	mov    %eax,0x30(%ebx)
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_handle_offer(): offer for 0x%08"X32_F"\n", dhcp->offered_ip_addr.addr));

    dhcp_select(netif);
  807024:	8b 45 e0             	mov    -0x20(%ebp),%eax
  807027:	e8 c3 f5 ff ff       	call   8065ef <dhcp_select>
    dhcp->request_timeout = 0;
    /* remember offered lease */
    dhcp_handle_offer(netif);
  }
free_pbuf_and_return:
  pbuf_free(p);
  80702c:	8b 5d 10             	mov    0x10(%ebp),%ebx
  80702f:	89 1c 24             	mov    %ebx,(%esp)
  807032:	e8 c6 0e 00 00       	call   807efd <pbuf_free>
  dhcp->p = NULL;
  807037:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80703a:	c7 40 0c 00 00 00 00 	movl   $0x0,0xc(%eax)
}
  807041:	83 c4 2c             	add    $0x2c,%esp
  807044:	5b                   	pop    %ebx
  807045:	5e                   	pop    %esi
  807046:	5f                   	pop    %edi
  807047:	5d                   	pop    %ebp
  807048:	c3                   	ret    
    goto free_pbuf_and_return;
  }

  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("searching DHCP_OPTION_MESSAGE_TYPE\n"));
  /* obtain pointer to DHCP message type */
  options_ptr = dhcp_get_option_ptr(dhcp, DHCP_OPTION_MESSAGE_TYPE);
  807049:	ba 35 00 00 00       	mov    $0x35,%edx
  80704e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  807051:	e8 89 e7 ff ff       	call   8057df <dhcp_get_option_ptr>
  if (options_ptr == NULL) {
  807056:	85 c0                	test   %eax,%eax
  807058:	0f 85 38 fd ff ff    	jne    806d96 <dhcp_recv+0x1c4>
  80705e:	66 90                	xchg   %ax,%ax
  807060:	eb ca                	jmp    80702c <dhcp_recv+0x45a>

00807062 <dhcp_fine_tmr>:
 * This timer checks whether an outstanding DHCP request is timed out.
 * 
 */
void
dhcp_fine_tmr()
{
  807062:	55                   	push   %ebp
  807063:	89 e5                	mov    %esp,%ebp
  807065:	53                   	push   %ebx
  807066:	83 ec 14             	sub    $0x14,%esp
  struct netif *netif = netif_list;
  807069:	8b 1d 00 f6 b3 00    	mov    0xb3f600,%ebx
  /* loop through netif's */
  while (netif != NULL) {
  80706f:	85 db                	test   %ebx,%ebx
  807071:	0f 84 dd 00 00 00    	je     807154 <dhcp_fine_tmr+0xf2>
    /* only act on DHCP configured interfaces */
    if (netif->dhcp != NULL) {
  807077:	8b 43 20             	mov    0x20(%ebx),%eax
  80707a:	85 c0                	test   %eax,%eax
  80707c:	0f 84 c8 00 00 00    	je     80714a <dhcp_fine_tmr+0xe8>
      /* timer is active (non zero), and is about to trigger now */      
      if (netif->dhcp->request_timeout > 1) {
  807082:	0f b7 50 26          	movzwl 0x26(%eax),%edx
  807086:	66 83 fa 01          	cmp    $0x1,%dx
  80708a:	76 0c                	jbe    807098 <dhcp_fine_tmr+0x36>
        netif->dhcp->request_timeout--;
  80708c:	83 ea 01             	sub    $0x1,%edx
  80708f:	66 89 50 26          	mov    %dx,0x26(%eax)
  807093:	e9 b2 00 00 00       	jmp    80714a <dhcp_fine_tmr+0xe8>
      }
      else if (netif->dhcp->request_timeout == 1) {
  807098:	66 83 fa 01          	cmp    $0x1,%dx
  80709c:	0f 85 a8 00 00 00    	jne    80714a <dhcp_fine_tmr+0xe8>
        netif->dhcp->request_timeout--;
  8070a2:	66 c7 40 26 00 00    	movw   $0x0,0x26(%eax)
 * @param netif the netif under DHCP control
 */
static void
dhcp_timeout(struct netif *netif)
{
  struct dhcp *dhcp = netif->dhcp;
  8070a8:	8b 53 20             	mov    0x20(%ebx),%edx
  LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 3, ("dhcp_timeout()\n"));
  /* back-off period has passed, or server selection timed out */
  if ((dhcp->state == DHCP_BACKING_OFF) || (dhcp->state == DHCP_SELECTING)) {
  8070ab:	0f b6 02             	movzbl (%edx),%eax
  8070ae:	3c 0c                	cmp    $0xc,%al
  8070b0:	74 04                	je     8070b6 <dhcp_fine_tmr+0x54>
  8070b2:	3c 06                	cmp    $0x6,%al
  8070b4:	75 0f                	jne    8070c5 <dhcp_fine_tmr+0x63>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_timeout(): restarting discovery\n"));
    dhcp_discover(netif);
  8070b6:	89 d8                	mov    %ebx,%eax
  8070b8:	e8 fb f0 ff ff       	call   8061b8 <dhcp_discover>
  8070bd:	8d 76 00             	lea    0x0(%esi),%esi
  8070c0:	e9 85 00 00 00       	jmp    80714a <dhcp_fine_tmr+0xe8>
  /* receiving the requested lease timed out */
  } else if (dhcp->state == DHCP_REQUESTING) {
  8070c5:	3c 01                	cmp    $0x1,%al
  8070c7:	75 23                	jne    8070ec <dhcp_fine_tmr+0x8a>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): REQUESTING, DHCP request timed out\n"));
    if (dhcp->tries <= 5) {
  8070c9:	80 7a 01 05          	cmpb   $0x5,0x1(%edx)
  8070cd:	8d 76 00             	lea    0x0(%esi),%esi
  8070d0:	77 09                	ja     8070db <dhcp_fine_tmr+0x79>
      dhcp_select(netif);
  8070d2:	89 d8                	mov    %ebx,%eax
  8070d4:	e8 16 f5 ff ff       	call   8065ef <dhcp_select>
  8070d9:	eb 6f                	jmp    80714a <dhcp_fine_tmr+0xe8>
    } else {
      LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): REQUESTING, releasing, restarting\n"));
      dhcp_release(netif);
  8070db:	89 1c 24             	mov    %ebx,(%esp)
  8070de:	e8 52 ee ff ff       	call   805f35 <dhcp_release>
      dhcp_discover(netif);
  8070e3:	89 d8                	mov    %ebx,%eax
  8070e5:	e8 ce f0 ff ff       	call   8061b8 <dhcp_discover>
  8070ea:	eb 5e                	jmp    80714a <dhcp_fine_tmr+0xe8>
    }
  /* received no ARP reply for the offered address (which is good) */
  } else if (dhcp->state == DHCP_CHECKING) {
  8070ec:	3c 08                	cmp    $0x8,%al
  8070ee:	66 90                	xchg   %ax,%ax
  8070f0:	75 20                	jne    807112 <dhcp_fine_tmr+0xb0>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): CHECKING, ARP request timed out\n"));
    if (dhcp->tries <= 1) {
  8070f2:	80 7a 01 01          	cmpb   $0x1,0x1(%edx)
  8070f6:	66 90                	xchg   %ax,%ax
  8070f8:	77 0d                	ja     807107 <dhcp_fine_tmr+0xa5>
      dhcp_check(netif);
  8070fa:	89 d8                	mov    %ebx,%eax
  8070fc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  807100:	e8 f5 f8 ff ff       	call   8069fa <dhcp_check>
  807105:	eb 43                	jmp    80714a <dhcp_fine_tmr+0xe8>
    /* no ARP replies on the offered address,
       looks like the IP address is indeed free */
    } else {
      /* bind the interface to the offered address */
      dhcp_bind(netif);
  807107:	89 d8                	mov    %ebx,%eax
  807109:	e8 29 f9 ff ff       	call   806a37 <dhcp_bind>
  80710e:	66 90                	xchg   %ax,%ax
  807110:	eb 38                	jmp    80714a <dhcp_fine_tmr+0xe8>
    }
  }
  /* did not get response to renew request? */
  else if (dhcp->state == DHCP_RENEWING) {
  807112:	3c 05                	cmp    $0x5,%al
  807114:	75 11                	jne    807127 <dhcp_fine_tmr+0xc5>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): RENEWING, DHCP request timed out\n"));
    /* just retry renewal */
    /* note that the rebind timer will eventually time-out if renew does not work */
    dhcp_renew(netif);
  807116:	89 1c 24             	mov    %ebx,(%esp)
  807119:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  807120:	e8 79 ef ff ff       	call   80609e <dhcp_renew>
  807125:	eb 23                	jmp    80714a <dhcp_fine_tmr+0xe8>
  /* did not get response to rebind request? */
  } else if (dhcp->state == DHCP_REBINDING) {
  807127:	3c 04                	cmp    $0x4,%al
  807129:	75 1f                	jne    80714a <dhcp_fine_tmr+0xe8>
    LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): REBINDING, DHCP request timed out\n"));
    if (dhcp->tries <= 8) {
  80712b:	80 7a 01 08          	cmpb   $0x8,0x1(%edx)
  80712f:	90                   	nop
  807130:	77 09                	ja     80713b <dhcp_fine_tmr+0xd9>
      dhcp_rebind(netif);
  807132:	89 d8                	mov    %ebx,%eax
  807134:	e8 d8 f1 ff ff       	call   806311 <dhcp_rebind>
  807139:	eb 0f                	jmp    80714a <dhcp_fine_tmr+0xe8>
    } else {
      LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): RELEASING, DISCOVERING\n"));
      dhcp_release(netif);
  80713b:	89 1c 24             	mov    %ebx,(%esp)
  80713e:	e8 f2 ed ff ff       	call   805f35 <dhcp_release>
      dhcp_discover(netif);
  807143:	89 d8                	mov    %ebx,%eax
  807145:	e8 6e f0 ff ff       	call   8061b8 <dhcp_discover>
        /* this clients' request timeout triggered */
        dhcp_timeout(netif);
      }
    }
    /* proceed to next network interface */
    netif = netif->next;
  80714a:	8b 1b                	mov    (%ebx),%ebx
void
dhcp_fine_tmr()
{
  struct netif *netif = netif_list;
  /* loop through netif's */
  while (netif != NULL) {
  80714c:	85 db                	test   %ebx,%ebx
  80714e:	0f 85 23 ff ff ff    	jne    807077 <dhcp_fine_tmr+0x15>
      }
    }
    /* proceed to next network interface */
    netif = netif->next;
  }
}
  807154:	83 c4 14             	add    $0x14,%esp
  807157:	5b                   	pop    %ebx
  807158:	5d                   	pop    %ebp
  807159:	c3                   	ret    
  80715a:	00 00                	add    %al,(%eax)
  80715c:	00 00                	add    %al,(%eax)
	...

00807160 <mem_malloc>:
 *
 * Note that the returned value will always be aligned (as defined by MEM_ALIGNMENT).
 */
void *
mem_malloc(mem_size_t size)
{
  807160:	55                   	push   %ebp
  807161:	89 e5                	mov    %esp,%ebp
  807163:	83 ec 38             	sub    $0x38,%esp
  807166:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  807169:	89 75 f8             	mov    %esi,-0x8(%ebp)
  80716c:	89 7d fc             	mov    %edi,-0x4(%ebp)
  80716f:	8b 45 08             	mov    0x8(%ebp),%eax
#if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT
  u8_t local_mem_free_count = 0;
#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
  LWIP_MEM_ALLOC_DECL_PROTECT();

  if (size == 0) {
  807172:	85 c0                	test   %eax,%eax
  807174:	0f 84 be 01 00 00    	je     807338 <mem_malloc+0x1d8>
    return NULL;
  }

  /* Expand the size of the allocated memory region so that we can
     adjust for alignment. */
  size = LWIP_MEM_ALIGN_SIZE(size);
  80717a:	83 c0 03             	add    $0x3,%eax
  80717d:	83 e0 fc             	and    $0xfffffffc,%eax
  807180:	89 45 e4             	mov    %eax,-0x1c(%ebp)

  if(size < MIN_SIZE_ALIGNED) {
  807183:	83 f8 0b             	cmp    $0xb,%eax
  807186:	77 09                	ja     807191 <mem_malloc+0x31>
  807188:	c7 45 e4 0c 00 00 00 	movl   $0xc,-0x1c(%ebp)
  80718f:	eb 0d                	jmp    80719e <mem_malloc+0x3e>
    /* every data block must be at least MIN_SIZE_ALIGNED long */
    size = MIN_SIZE_ALIGNED;
  }

  if (size > MEM_SIZE_ALIGNED) {
  807191:	81 7d e4 00 00 22 00 	cmpl   $0x220000,-0x1c(%ebp)
  807198:	0f 87 9a 01 00 00    	ja     807338 <mem_malloc+0x1d8>
    return NULL;
  }

  /* protect the heap from concurrent access */
  sys_arch_sem_wait(mem_sem, 0);
  80719e:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  8071a5:	00 
  8071a6:	a1 e8 96 a3 00       	mov    0xa396e8,%eax
  8071ab:	89 04 24             	mov    %eax,(%esp)
  8071ae:	e8 43 67 00 00       	call   80d8f6 <sys_arch_sem_wait>
#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */

    /* Scan through the heap searching for a free block that is big enough,
     * beginning with the lowest free block.
     */
    for (ptr = (u8_t *)lfree - ram; ptr < MEM_SIZE_ALIGNED - size;
  8071b3:	a1 e4 96 a3 00       	mov    0xa396e4,%eax
  8071b8:	89 45 dc             	mov    %eax,-0x24(%ebp)
  8071bb:	8b 15 dc 96 a3 00    	mov    0xa396dc,%edx
  8071c1:	29 d0                	sub    %edx,%eax
  8071c3:	b9 00 00 22 00       	mov    $0x220000,%ecx
  8071c8:	2b 4d e4             	sub    -0x1c(%ebp),%ecx
  8071cb:	39 c8                	cmp    %ecx,%eax
  8071cd:	0f 83 51 01 00 00    	jae    807324 <mem_malloc+0x1c4>
         ptr = ((struct mem *)&ram[ptr])->next) {
      mem = (struct mem *)&ram[ptr];
  8071d3:	89 55 e0             	mov    %edx,-0x20(%ebp)
  8071d6:	8b 75 e0             	mov    -0x20(%ebp),%esi
  8071d9:	8d 1c 02             	lea    (%edx,%eax,1),%ebx
        local_mem_free_count = mem_free_count;
      }
      mem_free_count = 0;
#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */

      if ((!mem->used) &&
  8071dc:	80 7b 08 00          	cmpb   $0x0,0x8(%ebx)
  8071e0:	0f 85 34 01 00 00    	jne    80731a <mem_malloc+0x1ba>
          (mem->next - (ptr + SIZEOF_STRUCT_MEM)) >= size) {
  8071e6:	8b 3b                	mov    (%ebx),%edi
  8071e8:	83 ef 0c             	sub    $0xc,%edi
  8071eb:	29 c7                	sub    %eax,%edi
        local_mem_free_count = mem_free_count;
      }
      mem_free_count = 0;
#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */

      if ((!mem->used) &&
  8071ed:	39 7d e4             	cmp    %edi,-0x1c(%ebp)
  8071f0:	0f 87 24 01 00 00    	ja     80731a <mem_malloc+0x1ba>
          (mem->next - (ptr + SIZEOF_STRUCT_MEM)) >= size) {
        /* mem is not used and at least perfect fit is possible:
         * mem->next - (ptr + SIZEOF_STRUCT_MEM) gives us the 'user data size' of mem */

        if (mem->next - (ptr + SIZEOF_STRUCT_MEM) >= (size + SIZEOF_STRUCT_MEM + MIN_SIZE_ALIGNED)) {
  8071f6:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  8071f9:	83 c2 18             	add    $0x18,%edx
  8071fc:	39 d7                	cmp    %edx,%edi
  8071fe:	72 2a                	jb     80722a <mem_malloc+0xca>
           * struct mem would fit in but no data between mem2 and mem2->next
           * @todo we could leave out MIN_SIZE_ALIGNED. We would create an empty
           *       region that couldn't hold data, but when mem->next gets freed,
           *       the 2 regions would be combined, resulting in more free memory
           */
          ptr2 = ptr + SIZEOF_STRUCT_MEM + size;
  807200:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  807203:	8d 4c 02 0c          	lea    0xc(%edx,%eax,1),%ecx
          /* create mem2 struct */
          mem2 = (struct mem *)&ram[ptr2];
  807207:	8d 14 0e             	lea    (%esi,%ecx,1),%edx
          mem2->used = 0;
  80720a:	c6 42 08 00          	movb   $0x0,0x8(%edx)
          mem2->next = mem->next;
  80720e:	8b 3b                	mov    (%ebx),%edi
  807210:	89 3a                	mov    %edi,(%edx)
          mem2->prev = ptr;
  807212:	89 42 04             	mov    %eax,0x4(%edx)
          /* and insert it between mem and mem->next */
          mem->next = ptr2;
  807215:	89 0b                	mov    %ecx,(%ebx)
          mem->used = 1;
  807217:	c6 43 08 01          	movb   $0x1,0x8(%ebx)

          if (mem2->next != MEM_SIZE_ALIGNED) {
  80721b:	8b 02                	mov    (%edx),%eax
  80721d:	3d 00 00 22 00       	cmp    $0x220000,%eax
  807222:	74 0a                	je     80722e <mem_malloc+0xce>
            ((struct mem *)&ram[mem2->next])->prev = ptr2;
  807224:	89 4c 06 04          	mov    %ecx,0x4(%esi,%eax,1)
  807228:	eb 04                	jmp    80722e <mem_malloc+0xce>
           * take care of this).
           * -> near fit or excact fit: do not split, no mem2 creation
           * also can't move mem->next directly behind mem, since mem->next
           * will always be used at this point!
           */
          mem->used = 1;
  80722a:	c6 43 08 01          	movb   $0x1,0x8(%ebx)
          MEM_STATS_INC_USED(used, mem->next - ((u8_t *)mem - ram));
        }

        if (mem == lfree) {
  80722e:	39 5d dc             	cmp    %ebx,-0x24(%ebp)
  807231:	75 67                	jne    80729a <mem_malloc+0x13a>
          /* Find next free block after mem and update lowest free pointer */
          while (lfree->used && lfree != ram_end) {
  807233:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  807236:	0f b6 41 08          	movzbl 0x8(%ecx),%eax
  80723a:	84 c0                	test   %al,%al
  80723c:	74 31                	je     80726f <mem_malloc+0x10f>
  80723e:	8b 15 e0 96 a3 00    	mov    0xa396e0,%edx
  807244:	39 d1                	cmp    %edx,%ecx
  807246:	74 52                	je     80729a <mem_malloc+0x13a>
            LWIP_MEM_ALLOC_UNPROTECT();
            /* prevent high interrupt latency... */
            LWIP_MEM_ALLOC_PROTECT();
            lfree = (struct mem *)&ram[lfree->next];
  807248:	8b 09                	mov    (%ecx),%ecx
  80724a:	8d 0c 0e             	lea    (%esi,%ecx,1),%ecx
          MEM_STATS_INC_USED(used, mem->next - ((u8_t *)mem - ram));
        }

        if (mem == lfree) {
          /* Find next free block after mem and update lowest free pointer */
          while (lfree->used && lfree != ram_end) {
  80724d:	0f b6 41 08          	movzbl 0x8(%ecx),%eax
  807251:	84 c0                	test   %al,%al
  807253:	75 0b                	jne    807260 <mem_malloc+0x100>
  807255:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  807258:	89 0d e4 96 a3 00    	mov    %ecx,0xa396e4
  80725e:	eb 0f                	jmp    80726f <mem_malloc+0x10f>
  807260:	39 d1                	cmp    %edx,%ecx
  807262:	75 e4                	jne    807248 <mem_malloc+0xe8>
  807264:	89 4d dc             	mov    %ecx,-0x24(%ebp)
#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
  LWIP_DEBUGF(MEM_DEBUG | 2, ("mem_malloc: could not allocate %"S16_F" bytes\n", (s16_t)size));
  MEM_STATS_INC(err);
  LWIP_MEM_ALLOC_UNPROTECT();
  sys_sem_signal(mem_sem);
  return NULL;
  807267:	89 0d e4 96 a3 00    	mov    %ecx,0xa396e4
  80726d:	eb 2b                	jmp    80729a <mem_malloc+0x13a>
            LWIP_MEM_ALLOC_UNPROTECT();
            /* prevent high interrupt latency... */
            LWIP_MEM_ALLOC_PROTECT();
            lfree = (struct mem *)&ram[lfree->next];
          }
          LWIP_ASSERT("mem_malloc: !lfree->used", ((lfree == ram_end) || (!lfree->used)));
  80726f:	8b 55 dc             	mov    -0x24(%ebp),%edx
  807272:	3b 15 e0 96 a3 00    	cmp    0xa396e0,%edx
  807278:	74 20                	je     80729a <mem_malloc+0x13a>
  80727a:	84 c0                	test   %al,%al
  80727c:	74 1c                	je     80729a <mem_malloc+0x13a>
  80727e:	c7 44 24 08 4d 34 81 	movl   $0x81344d,0x8(%esp)
  807285:	00 
  807286:	c7 44 24 04 46 02 00 	movl   $0x246,0x4(%esp)
  80728d:	00 
  80728e:	c7 04 24 66 34 81 00 	movl   $0x813466,(%esp)
  807295:	e8 02 97 ff ff       	call   80099c <_panic>
        }
        LWIP_MEM_ALLOC_UNPROTECT();
        sys_sem_signal(mem_sem);
  80729a:	a1 e8 96 a3 00       	mov    0xa396e8,%eax
  80729f:	89 04 24             	mov    %eax,(%esp)
  8072a2:	e8 40 69 00 00       	call   80dbe7 <sys_sem_signal>
        LWIP_ASSERT("mem_malloc: allocated memory not above ram_end.",
  8072a7:	89 d8                	mov    %ebx,%eax
  8072a9:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  8072ac:	8d 54 19 0c          	lea    0xc(%ecx,%ebx,1),%edx
  8072b0:	3b 15 e0 96 a3 00    	cmp    0xa396e0,%edx
  8072b6:	76 1c                	jbe    8072d4 <mem_malloc+0x174>
  8072b8:	c7 44 24 08 f0 34 81 	movl   $0x8134f0,0x8(%esp)
  8072bf:	00 
  8072c0:	c7 44 24 04 4b 02 00 	movl   $0x24b,0x4(%esp)
  8072c7:	00 
  8072c8:	c7 04 24 66 34 81 00 	movl   $0x813466,(%esp)
  8072cf:	e8 c8 96 ff ff       	call   80099c <_panic>
         (mem_ptr_t)mem + SIZEOF_STRUCT_MEM + size <= (mem_ptr_t)ram_end);
        LWIP_ASSERT("mem_malloc: allocated memory properly aligned.",
  8072d4:	f6 c3 03             	test   $0x3,%bl
  8072d7:	74 1c                	je     8072f5 <mem_malloc+0x195>
  8072d9:	c7 44 24 08 20 35 81 	movl   $0x813520,0x8(%esp)
  8072e0:	00 
  8072e1:	c7 44 24 04 4d 02 00 	movl   $0x24d,0x4(%esp)
  8072e8:	00 
  8072e9:	c7 04 24 66 34 81 00 	movl   $0x813466,(%esp)
  8072f0:	e8 a7 96 ff ff       	call   80099c <_panic>
         (unsigned long)((u8_t *)mem + SIZEOF_STRUCT_MEM) % MEM_ALIGNMENT == 0);
        LWIP_ASSERT("mem_malloc: sanity check alignment",
  8072f5:	a8 03                	test   $0x3,%al
  8072f7:	74 1c                	je     807315 <mem_malloc+0x1b5>
  8072f9:	c7 44 24 08 50 35 81 	movl   $0x813550,0x8(%esp)
  807300:	00 
  807301:	c7 44 24 04 4f 02 00 	movl   $0x24f,0x4(%esp)
  807308:	00 
  807309:	c7 04 24 66 34 81 00 	movl   $0x813466,(%esp)
  807310:	e8 87 96 ff ff       	call   80099c <_panic>
          (((mem_ptr_t)mem) & (MEM_ALIGNMENT-1)) == 0);

        return (u8_t *)mem + SIZEOF_STRUCT_MEM;
  807315:	8d 43 0c             	lea    0xc(%ebx),%eax
  807318:	eb 23                	jmp    80733d <mem_malloc+0x1dd>

    /* Scan through the heap searching for a free block that is big enough,
     * beginning with the lowest free block.
     */
    for (ptr = (u8_t *)lfree - ram; ptr < MEM_SIZE_ALIGNED - size;
         ptr = ((struct mem *)&ram[ptr])->next) {
  80731a:	8b 03                	mov    (%ebx),%eax
#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */

    /* Scan through the heap searching for a free block that is big enough,
     * beginning with the lowest free block.
     */
    for (ptr = (u8_t *)lfree - ram; ptr < MEM_SIZE_ALIGNED - size;
  80731c:	39 c1                	cmp    %eax,%ecx
  80731e:	0f 87 b2 fe ff ff    	ja     8071d6 <mem_malloc+0x76>
  } while(local_mem_free_count != 0);
#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
  LWIP_DEBUGF(MEM_DEBUG | 2, ("mem_malloc: could not allocate %"S16_F" bytes\n", (s16_t)size));
  MEM_STATS_INC(err);
  LWIP_MEM_ALLOC_UNPROTECT();
  sys_sem_signal(mem_sem);
  807324:	a1 e8 96 a3 00       	mov    0xa396e8,%eax
  807329:	89 04 24             	mov    %eax,(%esp)
  80732c:	e8 b6 68 00 00       	call   80dbe7 <sys_sem_signal>
  807331:	b8 00 00 00 00       	mov    $0x0,%eax
  return NULL;
  807336:	eb 05                	jmp    80733d <mem_malloc+0x1dd>
  807338:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80733d:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  807340:	8b 75 f8             	mov    -0x8(%ebp),%esi
  807343:	8b 7d fc             	mov    -0x4(%ebp),%edi
  807346:	89 ec                	mov    %ebp,%esp
  807348:	5d                   	pop    %ebp
  807349:	c3                   	ret    

0080734a <mem_calloc>:
 * @param count number of objects to allocate
 * @param size size of the objects to allocate
 * @return pointer to allocated memory / NULL pointer if there is an error
 */
void *mem_calloc(mem_size_t count, mem_size_t size)
{
  80734a:	55                   	push   %ebp
  80734b:	89 e5                	mov    %esp,%ebp
  80734d:	83 ec 18             	sub    $0x18,%esp
  807350:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  807353:	89 75 fc             	mov    %esi,-0x4(%ebp)
  void *p;

  /* allocate 'count' objects of size 'size' */
  p = mem_malloc(count * size);
  807356:	8b 75 0c             	mov    0xc(%ebp),%esi
  807359:	0f af 75 08          	imul   0x8(%ebp),%esi
  80735d:	89 34 24             	mov    %esi,(%esp)
  807360:	e8 fb fd ff ff       	call   807160 <mem_malloc>
  807365:	89 c3                	mov    %eax,%ebx
  if (p) {
  807367:	85 c0                	test   %eax,%eax
  807369:	74 14                	je     80737f <mem_calloc+0x35>
    /* zero the memory */
    memset(p, 0, count * size);
  80736b:	89 74 24 08          	mov    %esi,0x8(%esp)
  80736f:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  807376:	00 
  807377:	89 04 24             	mov    %eax,(%esp)
  80737a:	e8 07 9f ff ff       	call   801286 <memset>
  }
  return p;
}
  80737f:	89 d8                	mov    %ebx,%eax
  807381:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  807384:	8b 75 fc             	mov    -0x4(%ebp),%esi
  807387:	89 ec                	mov    %ebp,%esp
  807389:	5d                   	pop    %ebp
  80738a:	c3                   	ret    

0080738b <mem_realloc>:
 *         or NULL if newsize is > old size, in which case rmem is NOT touched
 *         or freed!
 */
void *
mem_realloc(void *rmem, mem_size_t newsize)
{
  80738b:	55                   	push   %ebp
  80738c:	89 e5                	mov    %esp,%ebp
  80738e:	83 ec 38             	sub    $0x38,%esp
  807391:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  807394:	89 75 f8             	mov    %esi,-0x8(%ebp)
  807397:	89 7d fc             	mov    %edi,-0x4(%ebp)
  80739a:	8b 75 08             	mov    0x8(%ebp),%esi
  /* use the FREE_PROTECT here: it protects with sem OR SYS_ARCH_PROTECT */
  LWIP_MEM_FREE_DECL_PROTECT();

  /* Expand the size of the allocated memory region so that we can
     adjust for alignment. */
  newsize = LWIP_MEM_ALIGN_SIZE(newsize);
  80739d:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  8073a0:	83 c3 03             	add    $0x3,%ebx
  8073a3:	83 e3 fc             	and    $0xfffffffc,%ebx

  if(newsize < MIN_SIZE_ALIGNED) {
  8073a6:	83 fb 0b             	cmp    $0xb,%ebx
  8073a9:	77 07                	ja     8073b2 <mem_realloc+0x27>
  8073ab:	bb 0c 00 00 00       	mov    $0xc,%ebx
  8073b0:	eb 13                	jmp    8073c5 <mem_realloc+0x3a>
    /* every data block must be at least MIN_SIZE_ALIGNED long */
    newsize = MIN_SIZE_ALIGNED;
  }

  if (newsize > MEM_SIZE_ALIGNED) {
  8073b2:	81 fb 00 00 22 00    	cmp    $0x220000,%ebx
  8073b8:	76 0b                	jbe    8073c5 <mem_realloc+0x3a>
  8073ba:	be 00 00 00 00       	mov    $0x0,%esi
  8073bf:	90                   	nop
  8073c0:	e9 21 01 00 00       	jmp    8074e6 <mem_realloc+0x15b>
    return NULL;
  }

  LWIP_ASSERT("mem_realloc: legal memory", (u8_t *)rmem >= (u8_t *)ram &&
  8073c5:	a1 dc 96 a3 00       	mov    0xa396dc,%eax
  8073ca:	39 c6                	cmp    %eax,%esi
  8073cc:	72 08                	jb     8073d6 <mem_realloc+0x4b>
  8073ce:	3b 35 e0 96 a3 00    	cmp    0xa396e0,%esi
  8073d4:	72 1c                	jb     8073f2 <mem_realloc+0x67>
  8073d6:	c7 44 24 08 7a 34 81 	movl   $0x81347a,0x8(%esp)
  8073dd:	00 
  8073de:	c7 44 24 04 79 01 00 	movl   $0x179,0x4(%esp)
  8073e5:	00 
  8073e6:	c7 04 24 66 34 81 00 	movl   $0x813466,(%esp)
  8073ed:	e8 aa 95 ff ff       	call   80099c <_panic>
    MEM_STATS_INC(illegal);
    SYS_ARCH_UNPROTECT(lev);
    return rmem;
  }
  /* Get the corresponding struct mem ... */
  mem = (struct mem *)((u8_t *)rmem - SIZEOF_STRUCT_MEM);
  8073f2:	8d 7e f4             	lea    -0xc(%esi),%edi
  /* ... and its offset pointer */
  ptr = (u8_t *)mem - ram;
  8073f5:	89 fa                	mov    %edi,%edx
  8073f7:	29 c2                	sub    %eax,%edx
  8073f9:	89 55 e0             	mov    %edx,-0x20(%ebp)

  size = mem->next - ptr - SIZEOF_STRUCT_MEM;
  8073fc:	8b 07                	mov    (%edi),%eax
  8073fe:	83 e8 0c             	sub    $0xc,%eax
  807401:	29 d0                	sub    %edx,%eax
  807403:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  LWIP_ASSERT("mem_realloc can only shrink memory", newsize <= size);
  807406:	39 d8                	cmp    %ebx,%eax
  807408:	73 1c                	jae    807426 <mem_realloc+0x9b>
  80740a:	c7 44 24 08 74 35 81 	movl   $0x813574,0x8(%esp)
  807411:	00 
  807412:	c7 44 24 04 8a 01 00 	movl   $0x18a,0x4(%esp)
  807419:	00 
  80741a:	c7 04 24 66 34 81 00 	movl   $0x813466,(%esp)
  807421:	e8 76 95 ff ff       	call   80099c <_panic>
  if (newsize > size) {
    /* not supported */
    return NULL;
  }
  if (newsize == size) {
  807426:	3b 5d e4             	cmp    -0x1c(%ebp),%ebx
  807429:	0f 84 b7 00 00 00    	je     8074e6 <mem_realloc+0x15b>
    /* No change in size, simply return */
    return rmem;
  }

  /* protect the heap from concurrent access */
  LWIP_MEM_FREE_PROTECT();
  80742f:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  807436:	00 
  807437:	a1 e8 96 a3 00       	mov    0xa396e8,%eax
  80743c:	89 04 24             	mov    %eax,(%esp)
  80743f:	e8 b2 64 00 00       	call   80d8f6 <sys_arch_sem_wait>

  MEM_STATS_DEC_USED(used, (size - newsize));

  mem2 = (struct mem *)&ram[mem->next];
  807444:	a1 dc 96 a3 00       	mov    0xa396dc,%eax
  807449:	89 c2                	mov    %eax,%edx
  80744b:	03 17                	add    (%edi),%edx
  if(mem2->used == 0) {
  80744d:	80 7a 08 00          	cmpb   $0x0,0x8(%edx)
  807451:	75 41                	jne    807494 <mem_realloc+0x109>
    /* The next struct is unused, we can simply move it at little */
    mem_size_t next;
    /* remember the old next pointer */
    next = mem2->next;
  807453:	8b 0a                	mov    (%edx),%ecx
  807455:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
    /* create new struct mem which is moved directly after the shrinked mem */
    ptr2 = ptr + SIZEOF_STRUCT_MEM + newsize;
  807458:	8b 4d e0             	mov    -0x20(%ebp),%ecx
  80745b:	8d 5c 0b 0c          	lea    0xc(%ebx,%ecx,1),%ebx
    if (lfree == mem2) {
  80745f:	39 15 e4 96 a3 00    	cmp    %edx,0xa396e4
  807465:	75 09                	jne    807470 <mem_realloc+0xe5>
      lfree = (struct mem *)&ram[ptr2];
  807467:	8d 14 18             	lea    (%eax,%ebx,1),%edx
  80746a:	89 15 e4 96 a3 00    	mov    %edx,0xa396e4
    }
    mem2 = (struct mem *)&ram[ptr2];
  807470:	8d 14 18             	lea    (%eax,%ebx,1),%edx
    mem2->used = 0;
  807473:	c6 42 08 00          	movb   $0x0,0x8(%edx)
    /* restore the next pointer */
    mem2->next = next;
  807477:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  80747a:	89 0a                	mov    %ecx,(%edx)
    /* link it back to mem */
    mem2->prev = ptr;
  80747c:	8b 4d e0             	mov    -0x20(%ebp),%ecx
  80747f:	89 4a 04             	mov    %ecx,0x4(%edx)
    /* link mem to it */
    mem->next = ptr2;
  807482:	89 1f                	mov    %ebx,(%edi)
    /* last thing to restore linked list: as we have moved mem2,
     * let 'mem2->next->prev' point to mem2 again. but only if mem2->next is not
     * the end of the heap */
    if (mem2->next != MEM_SIZE_ALIGNED) {
  807484:	8b 12                	mov    (%edx),%edx
  807486:	81 fa 00 00 22 00    	cmp    $0x220000,%edx
  80748c:	74 4b                	je     8074d9 <mem_realloc+0x14e>
      ((struct mem *)&ram[mem2->next])->prev = ptr2;
  80748e:	89 5c 10 04          	mov    %ebx,0x4(%eax,%edx,1)
  807492:	eb 45                	jmp    8074d9 <mem_realloc+0x14e>
    }
    /* no need to plug holes, we've already done that */
  } else if (newsize + SIZEOF_STRUCT_MEM + MIN_SIZE_ALIGNED <= size) {
  807494:	8d 53 18             	lea    0x18(%ebx),%edx
  807497:	39 55 e4             	cmp    %edx,-0x1c(%ebp)
  80749a:	72 3d                	jb     8074d9 <mem_realloc+0x14e>
     * Old size ('size') must be big enough to contain at least 'newsize' plus a struct mem
     * ('SIZEOF_STRUCT_MEM') with some data ('MIN_SIZE_ALIGNED').
     * @todo we could leave out MIN_SIZE_ALIGNED. We would create an empty
     *       region that couldn't hold data, but when mem->next gets freed,
     *       the 2 regions would be combined, resulting in more free memory */
    ptr2 = ptr + SIZEOF_STRUCT_MEM + newsize;
  80749c:	8b 55 e0             	mov    -0x20(%ebp),%edx
  80749f:	8d 5c 13 0c          	lea    0xc(%ebx,%edx,1),%ebx
    mem2 = (struct mem *)&ram[ptr2];
  8074a3:	8d 14 18             	lea    (%eax,%ebx,1),%edx
    if (mem2 < lfree) {
      lfree = mem2;
  8074a6:	3b 15 e4 96 a3 00    	cmp    0xa396e4,%edx
  8074ac:	8b 0d e4 96 a3 00    	mov    0xa396e4,%ecx
  8074b2:	0f 42 ca             	cmovb  %edx,%ecx
  8074b5:	89 0d e4 96 a3 00    	mov    %ecx,0xa396e4
    }
    mem2->used = 0;
  8074bb:	c6 42 08 00          	movb   $0x0,0x8(%edx)
    mem2->next = mem->next;
  8074bf:	8b 0f                	mov    (%edi),%ecx
  8074c1:	89 0a                	mov    %ecx,(%edx)
    mem2->prev = ptr;
  8074c3:	8b 4d e0             	mov    -0x20(%ebp),%ecx
  8074c6:	89 4a 04             	mov    %ecx,0x4(%edx)
    mem->next = ptr2;
  8074c9:	89 1f                	mov    %ebx,(%edi)
    if (mem2->next != MEM_SIZE_ALIGNED) {
  8074cb:	8b 12                	mov    (%edx),%edx
  8074cd:	81 fa 00 00 22 00    	cmp    $0x220000,%edx
  8074d3:	74 04                	je     8074d9 <mem_realloc+0x14e>
      ((struct mem *)&ram[mem2->next])->prev = ptr2;
  8074d5:	89 5c 10 04          	mov    %ebx,0x4(%eax,%edx,1)
    -> the remaining space stays unused since it is too small
  } */
#if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT
  mem_free_count = 1;
#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
  LWIP_MEM_FREE_UNPROTECT();
  8074d9:	a1 e8 96 a3 00       	mov    0xa396e8,%eax
  8074de:	89 04 24             	mov    %eax,(%esp)
  8074e1:	e8 01 67 00 00       	call   80dbe7 <sys_sem_signal>
  return rmem;
}
  8074e6:	89 f0                	mov    %esi,%eax
  8074e8:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  8074eb:	8b 75 f8             	mov    -0x8(%ebp),%esi
  8074ee:	8b 7d fc             	mov    -0x4(%ebp),%edi
  8074f1:	89 ec                	mov    %ebp,%esp
  8074f3:	5d                   	pop    %ebp
  8074f4:	c3                   	ret    

008074f5 <mem_free>:
 * @param rmem is the data portion of a struct mem as returned by a previous
 *             call to mem_malloc()
 */
void
mem_free(void *rmem)
{
  8074f5:	55                   	push   %ebp
  8074f6:	89 e5                	mov    %esp,%ebp
  8074f8:	83 ec 18             	sub    $0x18,%esp
  8074fb:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  8074fe:	89 75 fc             	mov    %esi,-0x4(%ebp)
  807501:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct mem *mem;
  LWIP_MEM_FREE_DECL_PROTECT();

  if (rmem == NULL) {
  807504:	85 db                	test   %ebx,%ebx
  807506:	0f 84 7d 01 00 00    	je     807689 <mem_free+0x194>
    LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_TRACE | 2, ("mem_free(p == NULL) was called.\n"));
    return;
  }
  LWIP_ASSERT("mem_free: sanity check alignment", (((mem_ptr_t)rmem) & (MEM_ALIGNMENT-1)) == 0);
  80750c:	f6 c3 03             	test   $0x3,%bl
  80750f:	74 1c                	je     80752d <mem_free+0x38>
  807511:	c7 44 24 08 98 35 81 	movl   $0x813598,0x8(%esp)
  807518:	00 
  807519:	c7 44 24 04 30 01 00 	movl   $0x130,0x4(%esp)
  807520:	00 
  807521:	c7 04 24 66 34 81 00 	movl   $0x813466,(%esp)
  807528:	e8 6f 94 ff ff       	call   80099c <_panic>

  LWIP_ASSERT("mem_free: legal memory", (u8_t *)rmem >= (u8_t *)ram &&
  80752d:	3b 1d dc 96 a3 00    	cmp    0xa396dc,%ebx
  807533:	72 08                	jb     80753d <mem_free+0x48>
  807535:	3b 1d e0 96 a3 00    	cmp    0xa396e0,%ebx
  80753b:	72 1c                	jb     807559 <mem_free+0x64>
  80753d:	c7 44 24 08 94 34 81 	movl   $0x813494,0x8(%esp)
  807544:	00 
  807545:	c7 44 24 04 33 01 00 	movl   $0x133,0x4(%esp)
  80754c:	00 
  80754d:	c7 04 24 66 34 81 00 	movl   $0x813466,(%esp)
  807554:	e8 43 94 ff ff       	call   80099c <_panic>
    MEM_STATS_INC(illegal);
    SYS_ARCH_UNPROTECT(lev);
    return;
  }
  /* protect the heap from concurrent access */
  LWIP_MEM_FREE_PROTECT();
  807559:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  807560:	00 
  807561:	a1 e8 96 a3 00       	mov    0xa396e8,%eax
  807566:	89 04 24             	mov    %eax,(%esp)
  807569:	e8 88 63 00 00       	call   80d8f6 <sys_arch_sem_wait>
  /* Get the corresponding struct mem ... */
  mem = (struct mem *)((u8_t *)rmem - SIZEOF_STRUCT_MEM);
  80756e:	83 eb 0c             	sub    $0xc,%ebx
  /* ... which has to be in a used state ... */
  LWIP_ASSERT("mem_free: mem->used", mem->used);
  807571:	80 7b 08 00          	cmpb   $0x0,0x8(%ebx)
  807575:	75 1c                	jne    807593 <mem_free+0x9e>
  807577:	c7 44 24 08 ab 34 81 	movl   $0x8134ab,0x8(%esp)
  80757e:	00 
  80757f:	c7 44 24 04 43 01 00 	movl   $0x143,0x4(%esp)
  807586:	00 
  807587:	c7 04 24 66 34 81 00 	movl   $0x813466,(%esp)
  80758e:	e8 09 94 ff ff       	call   80099c <_panic>
  /* ... and is now unused. */
  mem->used = 0;
  807593:	c6 43 08 00          	movb   $0x0,0x8(%ebx)

  if (mem < lfree) {
  807597:	3b 1d e4 96 a3 00    	cmp    0xa396e4,%ebx
  80759d:	73 06                	jae    8075a5 <mem_free+0xb0>
    /* the newly freed struct is now the lowest */
    lfree = mem;
  80759f:	89 1d e4 96 a3 00    	mov    %ebx,0xa396e4
plug_holes(struct mem *mem)
{
  struct mem *nmem;
  struct mem *pmem;

  LWIP_ASSERT("plug_holes: mem >= ram", (u8_t *)mem >= ram);
  8075a5:	a1 dc 96 a3 00       	mov    0xa396dc,%eax
  8075aa:	39 c3                	cmp    %eax,%ebx
  8075ac:	73 1c                	jae    8075ca <mem_free+0xd5>
  8075ae:	c7 44 24 08 bf 34 81 	movl   $0x8134bf,0x8(%esp)
  8075b5:	00 
  8075b6:	c7 44 24 04 e3 00 00 	movl   $0xe3,0x4(%esp)
  8075bd:	00 
  8075be:	c7 04 24 66 34 81 00 	movl   $0x813466,(%esp)
  8075c5:	e8 d2 93 ff ff       	call   80099c <_panic>
  LWIP_ASSERT("plug_holes: mem < ram_end", (u8_t *)mem < (u8_t *)ram_end);
  8075ca:	8b 35 e0 96 a3 00    	mov    0xa396e0,%esi
  8075d0:	39 f3                	cmp    %esi,%ebx
  8075d2:	72 1c                	jb     8075f0 <mem_free+0xfb>
  8075d4:	c7 44 24 08 d6 34 81 	movl   $0x8134d6,0x8(%esp)
  8075db:	00 
  8075dc:	c7 44 24 04 e4 00 00 	movl   $0xe4,0x4(%esp)
  8075e3:	00 
  8075e4:	c7 04 24 66 34 81 00 	movl   $0x813466,(%esp)
  8075eb:	e8 ac 93 ff ff       	call   80099c <_panic>
  LWIP_ASSERT("plug_holes: mem->used == 0", mem->used == 0);

  /* plug hole forward */
  LWIP_ASSERT("plug_holes: mem->next <= MEM_SIZE_ALIGNED", mem->next <= MEM_SIZE_ALIGNED);
  8075f0:	8b 13                	mov    (%ebx),%edx
  8075f2:	81 fa 00 00 22 00    	cmp    $0x220000,%edx
  8075f8:	76 1c                	jbe    807616 <mem_free+0x121>
  8075fa:	c7 44 24 08 bc 35 81 	movl   $0x8135bc,0x8(%esp)
  807601:	00 
  807602:	c7 44 24 04 e8 00 00 	movl   $0xe8,0x4(%esp)
  807609:	00 
  80760a:	c7 04 24 66 34 81 00 	movl   $0x813466,(%esp)
  807611:	e8 86 93 ff ff       	call   80099c <_panic>

  nmem = (struct mem *)&ram[mem->next];
  807616:	89 c1                	mov    %eax,%ecx
  807618:	8d 14 10             	lea    (%eax,%edx,1),%edx
  if (mem != nmem && nmem->used == 0 && (u8_t *)nmem != (u8_t *)ram_end) {
  80761b:	39 d3                	cmp    %edx,%ebx
  80761d:	74 2d                	je     80764c <mem_free+0x157>
  80761f:	80 7a 08 00          	cmpb   $0x0,0x8(%edx)
  807623:	75 27                	jne    80764c <mem_free+0x157>
  807625:	39 d6                	cmp    %edx,%esi
  807627:	74 23                	je     80764c <mem_free+0x157>
    /* if mem->next is unused and not end of ram, combine mem and mem->next */
    if (lfree == nmem) {
      lfree = mem;
  807629:	3b 15 e4 96 a3 00    	cmp    0xa396e4,%edx
  80762f:	8b 35 e4 96 a3 00    	mov    0xa396e4,%esi
  807635:	0f 44 f3             	cmove  %ebx,%esi
  807638:	89 35 e4 96 a3 00    	mov    %esi,0xa396e4
    }
    mem->next = nmem->next;
  80763e:	8b 32                	mov    (%edx),%esi
  807640:	89 33                	mov    %esi,(%ebx)
    ((struct mem *)&ram[nmem->next])->prev = (u8_t *)mem - ram;
  807642:	8b 12                	mov    (%edx),%edx
  807644:	89 de                	mov    %ebx,%esi
  807646:	29 c6                	sub    %eax,%esi
  807648:	89 74 10 04          	mov    %esi,0x4(%eax,%edx,1)
  }

  /* plug hole backward */
  pmem = (struct mem *)&ram[mem->prev];
  80764c:	89 ca                	mov    %ecx,%edx
  80764e:	03 53 04             	add    0x4(%ebx),%edx
  if (pmem != mem && pmem->used == 0) {
  807651:	39 d3                	cmp    %edx,%ebx
  807653:	74 27                	je     80767c <mem_free+0x187>
  807655:	80 7a 08 00          	cmpb   $0x0,0x8(%edx)
  807659:	75 21                	jne    80767c <mem_free+0x187>
    /* if mem->prev is unused, combine mem and mem->prev */
    if (lfree == mem) {
      lfree = pmem;
  80765b:	3b 1d e4 96 a3 00    	cmp    0xa396e4,%ebx
  807661:	8b 35 e4 96 a3 00    	mov    0xa396e4,%esi
  807667:	0f 44 f2             	cmove  %edx,%esi
  80766a:	89 35 e4 96 a3 00    	mov    %esi,0xa396e4
    }
    pmem->next = mem->next;
  807670:	8b 33                	mov    (%ebx),%esi
  807672:	89 32                	mov    %esi,(%edx)
    ((struct mem *)&ram[mem->next])->prev = (u8_t *)pmem - ram;
  807674:	8b 1b                	mov    (%ebx),%ebx
  807676:	29 c2                	sub    %eax,%edx
  807678:	89 54 19 04          	mov    %edx,0x4(%ecx,%ebx,1)
  /* finally, see if prev or next are free also */
  plug_holes(mem);
#if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT
  mem_free_count = 1;
#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
  LWIP_MEM_FREE_UNPROTECT();
  80767c:	a1 e8 96 a3 00       	mov    0xa396e8,%eax
  807681:	89 04 24             	mov    %eax,(%esp)
  807684:	e8 5e 65 00 00       	call   80dbe7 <sys_sem_signal>
}
  807689:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  80768c:	8b 75 fc             	mov    -0x4(%ebp),%esi
  80768f:	89 ec                	mov    %ebp,%esp
  807691:	5d                   	pop    %ebp
  807692:	c3                   	ret    

00807693 <mem_init>:
/**
 * Zero the heap and initialize start, end and lowest-free
 */
void
mem_init(void)
{
  807693:	55                   	push   %ebp
  807694:	89 e5                	mov    %esp,%ebp
  807696:	83 ec 18             	sub    $0x18,%esp

  LWIP_ASSERT("Sanity check alignment",
    (SIZEOF_STRUCT_MEM & (MEM_ALIGNMENT-1)) == 0);

  /* align the heap */
  ram = LWIP_MEM_ALIGN(ram_heap);
  807699:	b8 c3 96 81 00       	mov    $0x8196c3,%eax
  80769e:	83 e0 fc             	and    $0xfffffffc,%eax
  8076a1:	a3 dc 96 a3 00       	mov    %eax,0xa396dc
  /* initialize the start of the heap */
  mem = (struct mem *)ram;
  mem->next = MEM_SIZE_ALIGNED;
  8076a6:	c7 00 00 00 22 00    	movl   $0x220000,(%eax)
  mem->prev = 0;
  8076ac:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
  mem->used = 0;
  8076b3:	c6 40 08 00          	movb   $0x0,0x8(%eax)
  /* initialize the end of the heap */
  ram_end = (struct mem *)&ram[MEM_SIZE_ALIGNED];
  8076b7:	05 00 00 22 00       	add    $0x220000,%eax
  8076bc:	a3 e0 96 a3 00       	mov    %eax,0xa396e0
  ram_end->used = 1;
  8076c1:	c6 40 08 01          	movb   $0x1,0x8(%eax)
  ram_end->next = MEM_SIZE_ALIGNED;
  8076c5:	c7 00 00 00 22 00    	movl   $0x220000,(%eax)
  ram_end->prev = MEM_SIZE_ALIGNED;
  8076cb:	c7 40 04 00 00 22 00 	movl   $0x220000,0x4(%eax)

  mem_sem = sys_sem_new(1);
  8076d2:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  8076d9:	e8 67 63 00 00       	call   80da45 <sys_sem_new>
  8076de:	a3 e8 96 a3 00       	mov    %eax,0xa396e8

  /* initialize the lowest-free pointer to the start of the heap */
  lfree = (struct mem *)ram;
  8076e3:	a1 dc 96 a3 00       	mov    0xa396dc,%eax
  8076e8:	a3 e4 96 a3 00       	mov    %eax,0xa396e4

  MEM_STATS_AVAIL(avail, MEM_SIZE_ALIGNED);
}
  8076ed:	c9                   	leave  
  8076ee:	c3                   	ret    
	...

008076f0 <memp_init>:
 * 
 * Carves out memp_memory into linked lists for each pool-type.
 */
void
memp_init(void)
{
  8076f0:	55                   	push   %ebp
  8076f1:	89 e5                	mov    %esp,%ebp
  8076f3:	57                   	push   %edi
  8076f4:	56                   	push   %esi
  8076f5:	53                   	push   %ebx
  8076f6:	83 ec 04             	sub    $0x4,%esp
    MEMP_STATS_AVAIL(max, i, 0);
    MEMP_STATS_AVAIL(err, i, 0);
    MEMP_STATS_AVAIL(avail, i, memp_num[i]);
  }

  memp = LWIP_MEM_ALIGN(memp_memory);
  8076f9:	b8 43 97 a3 00       	mov    $0xa39743,%eax
  8076fe:	83 e0 fc             	and    $0xfffffffc,%eax
  807701:	89 45 f0             	mov    %eax,-0x10(%ebp)
  807704:	bf 00 00 00 00       	mov    $0x0,%edi
  /* for every pool: */
  for (i = 0; i < MEMP_MAX; ++i) {
    memp_tab[i] = NULL;
  807709:	c7 84 3f 00 97 a3 00 	movl   $0x0,0xa39700(%edi,%edi,1)
  807710:	00 00 00 00 
    /* create a linked list of memp elements */
    for (j = 0; j < memp_num[i]; ++j) {
  807714:	0f b7 9f 7a 36 81 00 	movzwl 0x81367a(%edi),%ebx
  80771b:	8b 45 f0             	mov    -0x10(%ebp),%eax
  80771e:	66 85 db             	test   %bx,%bx
  807721:	74 3c                	je     80775f <memp_init+0x6f>
      memp->next = memp_tab[i];
      memp_tab[i] = memp;
      memp = (struct memp *)((u8_t *)memp + MEMP_SIZE + memp_sizes[i]);
  807723:	0f b7 b7 5e 36 81 00 	movzwl 0x81365e(%edi),%esi
  80772a:	b9 00 00 00 00       	mov    $0x0,%ecx
  80772f:	ba 00 00 00 00       	mov    $0x0,%edx
  /* for every pool: */
  for (i = 0; i < MEMP_MAX; ++i) {
    memp_tab[i] = NULL;
    /* create a linked list of memp elements */
    for (j = 0; j < memp_num[i]; ++j) {
      memp->next = memp_tab[i];
  807734:	89 08                	mov    %ecx,(%eax)
  memp = LWIP_MEM_ALIGN(memp_memory);
  /* for every pool: */
  for (i = 0; i < MEMP_MAX; ++i) {
    memp_tab[i] = NULL;
    /* create a linked list of memp elements */
    for (j = 0; j < memp_num[i]; ++j) {
  807736:	83 c2 01             	add    $0x1,%edx
  807739:	89 c1                	mov    %eax,%ecx
  80773b:	8d 04 30             	lea    (%eax,%esi,1),%eax
  80773e:	66 39 da             	cmp    %bx,%dx
  807741:	72 f1                	jb     807734 <memp_init+0x44>
 * Initialize this module.
 * 
 * Carves out memp_memory into linked lists for each pool-type.
 */
void
memp_init(void)
  807743:	83 eb 01             	sub    $0x1,%ebx
  807746:	0f b7 db             	movzwl %bx,%ebx
  807749:	8d 43 01             	lea    0x1(%ebx),%eax
  80774c:	0f af c6             	imul   %esi,%eax
  80774f:	03 45 f0             	add    -0x10(%ebp),%eax
  807752:	0f af de             	imul   %esi,%ebx
  807755:	03 5d f0             	add    -0x10(%ebp),%ebx
  807758:	89 9c 3f 00 97 a3 00 	mov    %ebx,0xa39700(%edi,%edi,1)
  80775f:	83 c7 02             	add    $0x2,%edi
    MEMP_STATS_AVAIL(avail, i, memp_num[i]);
  }

  memp = LWIP_MEM_ALIGN(memp_memory);
  /* for every pool: */
  for (i = 0; i < MEMP_MAX; ++i) {
  807762:	83 ff 1c             	cmp    $0x1c,%edi
  807765:	74 05                	je     80776c <memp_init+0x7c>
  807767:	89 45 f0             	mov    %eax,-0x10(%ebp)
  80776a:	eb 9d                	jmp    807709 <memp_init+0x19>
#if MEMP_OVERFLOW_CHECK
  memp_overflow_init();
  /* check everything a first time to see if it worked */
  memp_overflow_check_all();
#endif /* MEMP_OVERFLOW_CHECK */
}
  80776c:	83 c4 04             	add    $0x4,%esp
  80776f:	5b                   	pop    %ebx
  807770:	5e                   	pop    %esi
  807771:	5f                   	pop    %edi
  807772:	5d                   	pop    %ebp
  807773:	c3                   	ret    

00807774 <memp_free>:
 * @param type the pool where to put mem
 * @param mem the memp element to free
 */
void
memp_free(memp_t type, void *mem)
{
  807774:	55                   	push   %ebp
  807775:	89 e5                	mov    %esp,%ebp
  807777:	53                   	push   %ebx
  807778:	83 ec 14             	sub    $0x14,%esp
  80777b:	8b 55 08             	mov    0x8(%ebp),%edx
  80777e:	8b 45 0c             	mov    0xc(%ebp),%eax
  struct memp *memp;
  SYS_ARCH_DECL_PROTECT(old_level);

  if (mem == NULL) {
  807781:	85 c0                	test   %eax,%eax
  807783:	74 2d                	je     8077b2 <memp_free+0x3e>
    return;
  }
  LWIP_ASSERT("memp_free: mem properly aligned",
  807785:	a8 03                	test   $0x3,%al
  807787:	74 1c                	je     8077a5 <memp_free+0x31>
  807789:	c7 44 24 08 e8 35 81 	movl   $0x8135e8,0x8(%esp)
  807790:	00 
  807791:	c7 44 24 04 5b 01 00 	movl   $0x15b,0x4(%esp)
  807798:	00 
  807799:	c7 04 24 2b 36 81 00 	movl   $0x81362b,(%esp)
  8077a0:	e8 f7 91 ff ff       	call   80099c <_panic>
#endif /* MEMP_OVERFLOW_CHECK >= 2 */
#endif /* MEMP_OVERFLOW_CHECK */

  MEMP_STATS_DEC(used, type); 
  
  memp->next = memp_tab[type]; 
  8077a5:	b9 00 97 a3 00       	mov    $0xa39700,%ecx
  8077aa:	8b 1c 91             	mov    (%ecx,%edx,4),%ebx
  8077ad:	89 18                	mov    %ebx,(%eax)
  memp_tab[type] = memp;
  8077af:	89 04 91             	mov    %eax,(%ecx,%edx,4)
#if MEMP_SANITY_CHECK
  LWIP_ASSERT("memp sanity", memp_sanity());
#endif /* MEMP_SANITY_CHECK */

  SYS_ARCH_UNPROTECT(old_level);
}
  8077b2:	83 c4 14             	add    $0x14,%esp
  8077b5:	5b                   	pop    %ebx
  8077b6:	5d                   	pop    %ebp
  8077b7:	c3                   	ret    

008077b8 <memp_malloc>:
#if !MEMP_OVERFLOW_CHECK
memp_malloc(memp_t type)
#else
memp_malloc_fn(memp_t type, const char* file, const int line)
#endif
{
  8077b8:	55                   	push   %ebp
  8077b9:	89 e5                	mov    %esp,%ebp
  8077bb:	83 ec 18             	sub    $0x18,%esp
  8077be:	8b 55 08             	mov    0x8(%ebp),%edx
  struct memp *memp;
  SYS_ARCH_DECL_PROTECT(old_level);
 
  LWIP_ERROR("memp_malloc: type < MEMP_MAX", (type < MEMP_MAX), return NULL;);
  8077c1:	83 fa 0d             	cmp    $0xd,%edx
  8077c4:	76 1c                	jbe    8077e2 <memp_malloc+0x2a>
  8077c6:	c7 44 24 08 40 36 81 	movl   $0x813640,0x8(%esp)
  8077cd:	00 
  8077ce:	c7 44 24 04 2d 01 00 	movl   $0x12d,0x4(%esp)
  8077d5:	00 
  8077d6:	c7 04 24 2b 36 81 00 	movl   $0x81362b,(%esp)
  8077dd:	e8 ba 91 ff ff       	call   80099c <_panic>
  SYS_ARCH_PROTECT(old_level);
#if MEMP_OVERFLOW_CHECK >= 2
  memp_overflow_check_all();
#endif /* MEMP_OVERFLOW_CHECK >= 2 */

  memp = memp_tab[type];
  8077e2:	8b 04 95 00 97 a3 00 	mov    0xa39700(,%edx,4),%eax
  
  if (memp != NULL) {    
  8077e9:	85 c0                	test   %eax,%eax
  8077eb:	74 29                	je     807816 <memp_malloc+0x5e>
    memp_tab[type] = memp->next;    
  8077ed:	8b 08                	mov    (%eax),%ecx
  8077ef:	89 0c 95 00 97 a3 00 	mov    %ecx,0xa39700(,%edx,4)
    memp->next = NULL;
    memp->file = file;
    memp->line = line;
#endif /* MEMP_OVERFLOW_CHECK */
    MEMP_STATS_INC_USED(used, type);
    LWIP_ASSERT("memp_malloc: memp properly aligned",
  8077f6:	a8 03                	test   $0x3,%al
  8077f8:	74 1c                	je     807816 <memp_malloc+0x5e>
  8077fa:	c7 44 24 08 08 36 81 	movl   $0x813608,0x8(%esp)
  807801:	00 
  807802:	c7 44 24 04 3f 01 00 	movl   $0x13f,0x4(%esp)
  807809:	00 
  80780a:	c7 04 24 2b 36 81 00 	movl   $0x81362b,(%esp)
  807811:	e8 86 91 ff ff       	call   80099c <_panic>
  }

  SYS_ARCH_UNPROTECT(old_level);

  return memp;
}
  807816:	c9                   	leave  
  807817:	c3                   	ret    
	...

00807820 <netif_find>:
 * @param name the name of the netif (like netif->name) plus concatenated number
 * in ascii representation (e.g. 'en0')
 */
struct netif *
netif_find(char *name)
{
  807820:	55                   	push   %ebp
  807821:	89 e5                	mov    %esp,%ebp
  807823:	53                   	push   %ebx
  807824:	8b 55 08             	mov    0x8(%ebp),%edx
  struct netif *netif;
  u8_t num;

  if (name == NULL) {
  807827:	b8 00 00 00 00       	mov    $0x0,%eax
  80782c:	85 d2                	test   %edx,%edx
  80782e:	74 2c                	je     80785c <netif_find+0x3c>
    return NULL;
  }

  num = name[2] - '0';
  807830:	0f b6 5a 02          	movzbl 0x2(%edx),%ebx
  807834:	83 eb 30             	sub    $0x30,%ebx

  for(netif = netif_list; netif != NULL; netif = netif->next) {
  807837:	a1 00 f6 b3 00       	mov    0xb3f600,%eax
  80783c:	85 c0                	test   %eax,%eax
  80783e:	74 1c                	je     80785c <netif_find+0x3c>
    if (num == netif->num &&
  807840:	38 58 31             	cmp    %bl,0x31(%eax)
  807843:	75 11                	jne    807856 <netif_find+0x36>
       name[0] == netif->name[0] &&
  807845:	0f b6 0a             	movzbl (%edx),%ecx
  807848:	3a 48 2f             	cmp    0x2f(%eax),%cl
  80784b:	75 09                	jne    807856 <netif_find+0x36>
       name[1] == netif->name[1]) {
  80784d:	0f b6 4a 01          	movzbl 0x1(%edx),%ecx
  807851:	3a 48 30             	cmp    0x30(%eax),%cl
  807854:	74 06                	je     80785c <netif_find+0x3c>
    return NULL;
  }

  num = name[2] - '0';

  for(netif = netif_list; netif != NULL; netif = netif->next) {
  807856:	8b 00                	mov    (%eax),%eax
  807858:	85 c0                	test   %eax,%eax
  80785a:	75 e4                	jne    807840 <netif_find+0x20>
      return netif;
    }
  }
  LWIP_DEBUGF(NETIF_DEBUG, ("netif_find: didn't find %c%c\n", name[0], name[1]));
  return NULL;
}
  80785c:	5b                   	pop    %ebx
  80785d:	5d                   	pop    %ebp
  80785e:	c3                   	ret    

0080785f <netif_set_gw>:
 *
 * @note call netif_set_addr() if you also want to change ip address and netmask
 */
void
netif_set_gw(struct netif *netif, struct ip_addr *gw)
{
  80785f:	55                   	push   %ebp
  807860:	89 e5                	mov    %esp,%ebp
  807862:	8b 55 0c             	mov    0xc(%ebp),%edx
  ip_addr_set(&(netif->gw), gw);
  807865:	b8 00 00 00 00       	mov    $0x0,%eax
  80786a:	85 d2                	test   %edx,%edx
  80786c:	74 02                	je     807870 <netif_set_gw+0x11>
  80786e:	8b 02                	mov    (%edx),%eax
  807870:	8b 55 08             	mov    0x8(%ebp),%edx
  807873:	89 42 0c             	mov    %eax,0xc(%edx)
    netif->name[0], netif->name[1],
    ip4_addr1(&netif->gw),
    ip4_addr2(&netif->gw),
    ip4_addr3(&netif->gw),
    ip4_addr4(&netif->gw)));
}
  807876:	5d                   	pop    %ebp
  807877:	c3                   	ret    

00807878 <netif_set_netmask>:
 * @note call netif_set_addr() if you also want to change ip address and
 * default gateway
 */
void
netif_set_netmask(struct netif *netif, struct ip_addr *netmask)
{
  807878:	55                   	push   %ebp
  807879:	89 e5                	mov    %esp,%ebp
  80787b:	8b 55 0c             	mov    0xc(%ebp),%edx
  snmp_delete_iprteidx_tree(0, netif);
  /* set new netmask to netif */
  ip_addr_set(&(netif->netmask), netmask);
  80787e:	b8 00 00 00 00       	mov    $0x0,%eax
  807883:	85 d2                	test   %edx,%edx
  807885:	74 02                	je     807889 <netif_set_netmask+0x11>
  807887:	8b 02                	mov    (%edx),%eax
  807889:	8b 55 08             	mov    0x8(%ebp),%edx
  80788c:	89 42 08             	mov    %eax,0x8(%edx)
    netif->name[0], netif->name[1],
    ip4_addr1(&netif->netmask),
    ip4_addr2(&netif->netmask),
    ip4_addr3(&netif->netmask),
    ip4_addr4(&netif->netmask)));
}
  80788f:	5d                   	pop    %ebp
  807890:	c3                   	ret    

00807891 <netif_set_default>:
 *
 * @param netif the default network interface
 */
void
netif_set_default(struct netif *netif)
{
  807891:	55                   	push   %ebp
  807892:	89 e5                	mov    %esp,%ebp
  else
  {
    /* install default route */
    snmp_insert_iprteidx_tree(1, netif);
  }
  netif_default = netif;
  807894:	8b 45 08             	mov    0x8(%ebp),%eax
  807897:	a3 04 f6 b3 00       	mov    %eax,0xb3f604
  LWIP_DEBUGF(NETIF_DEBUG, ("netif: setting default interface %c%c\n",
           netif ? netif->name[0] : '\'', netif ? netif->name[1] : '\''));
}
  80789c:	5d                   	pop    %ebp
  80789d:	c3                   	ret    

0080789e <netif_remove>:
 * Remove a network interface from the list of lwIP netifs.
 *
 * @param netif the network interface to remove
 */
void netif_remove(struct netif * netif)
{
  80789e:	55                   	push   %ebp
  80789f:	89 e5                	mov    %esp,%ebp
  8078a1:	83 ec 04             	sub    $0x4,%esp
  8078a4:	8b 4d 08             	mov    0x8(%ebp),%ecx
  if ( netif == NULL ) return;
  8078a7:	85 c9                	test   %ecx,%ecx
  8078a9:	74 4b                	je     8078f6 <netif_remove+0x58>
#endif /* LWIP_IGMP */

  snmp_delete_ipaddridx_tree(netif);

  /*  is it the first netif? */
  if (netif_list == netif) {
  8078ab:	a1 00 f6 b3 00       	mov    0xb3f600,%eax
  8078b0:	39 c8                	cmp    %ecx,%eax
  8078b2:	75 1e                	jne    8078d2 <netif_remove+0x34>
    netif_list = netif->next;
  8078b4:	8b 00                	mov    (%eax),%eax
  8078b6:	a3 00 f6 b3 00       	mov    %eax,0xb3f600
  8078bb:	eb 25                	jmp    8078e2 <netif_remove+0x44>
  }
  else {
    /*  look for netif further down the list */
    struct netif * tmpNetif;
    for (tmpNetif = netif_list; tmpNetif != NULL; tmpNetif = tmpNetif->next) {
      if (tmpNetif->next == netif) {
  8078bd:	8b 10                	mov    (%eax),%edx
  8078bf:	39 ca                	cmp    %ecx,%edx
  8078c1:	74 08                	je     8078cb <netif_remove+0x2d>
  8078c3:	89 d0                	mov    %edx,%eax
    snmp_dec_iflist();
  }
  else {
    /*  look for netif further down the list */
    struct netif * tmpNetif;
    for (tmpNetif = netif_list; tmpNetif != NULL; tmpNetif = tmpNetif->next) {
  8078c5:	85 c0                	test   %eax,%eax
  8078c7:	75 f4                	jne    8078bd <netif_remove+0x1f>
  8078c9:	eb 2b                	jmp    8078f6 <netif_remove+0x58>
      if (tmpNetif->next == netif) {
        tmpNetif->next = netif->next;
  8078cb:	8b 11                	mov    (%ecx),%edx
  8078cd:	89 10                	mov    %edx,(%eax)
  8078cf:	90                   	nop
  8078d0:	eb 10                	jmp    8078e2 <netif_remove+0x44>
    snmp_dec_iflist();
  }
  else {
    /*  look for netif further down the list */
    struct netif * tmpNetif;
    for (tmpNetif = netif_list; tmpNetif != NULL; tmpNetif = tmpNetif->next) {
  8078d2:	85 c0                	test   %eax,%eax
  8078d4:	74 20                	je     8078f6 <netif_remove+0x58>
      if (tmpNetif->next == netif) {
  8078d6:	8b 10                	mov    (%eax),%edx
  8078d8:	39 ca                	cmp    %ecx,%edx
  8078da:	74 ef                	je     8078cb <netif_remove+0x2d>
  8078dc:	89 d0                	mov    %edx,%eax
  8078de:	66 90                	xchg   %ax,%ax
  8078e0:	eb e3                	jmp    8078c5 <netif_remove+0x27>
    }
    if (tmpNetif == NULL)
      return; /*  we didn't find any netif today */
  }
  /* this netif is default? */
  if (netif_default == netif)
  8078e2:	39 0d 04 f6 b3 00    	cmp    %ecx,0xb3f604
  8078e8:	75 0c                	jne    8078f6 <netif_remove+0x58>
    /* reset default netif */
    netif_set_default(NULL);
  8078ea:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  8078f1:	e8 9b ff ff ff       	call   807891 <netif_set_default>
  LWIP_DEBUGF( NETIF_DEBUG, ("netif_remove: removed netif\n") );
}
  8078f6:	c9                   	leave  
  8078f7:	c3                   	ret    

008078f8 <netif_set_down>:
 * up once configured.
 * 
 * @see dhcp_start()
 */ 
void netif_set_down(struct netif *netif)
{
  8078f8:	55                   	push   %ebp
  8078f9:	89 e5                	mov    %esp,%ebp
  8078fb:	8b 45 08             	mov    0x8(%ebp),%eax
  if ( netif->flags & NETIF_FLAG_UP )
  8078fe:	0f b6 50 2e          	movzbl 0x2e(%eax),%edx
  807902:	f6 c2 01             	test   $0x1,%dl
  807905:	74 06                	je     80790d <netif_set_down+0x15>
    {
      netif->flags &= ~NETIF_FLAG_UP;
  807907:	83 e2 fe             	and    $0xfffffffe,%edx
  80790a:	88 50 2e             	mov    %dl,0x2e(%eax)
#endif
      
      NETIF_LINK_CALLBACK(netif);
      NETIF_STATUS_CALLBACK(netif);
    }
}
  80790d:	5d                   	pop    %ebp
  80790e:	c3                   	ret    

0080790f <netif_is_up>:

/**
 * Ask if an interface is up
 */ 
u8_t netif_is_up(struct netif *netif)
{
  80790f:	55                   	push   %ebp
  807910:	89 e5                	mov    %esp,%ebp
  807912:	8b 45 08             	mov    0x8(%ebp),%eax
  807915:	0f b6 40 2e          	movzbl 0x2e(%eax),%eax
  807919:	83 e0 01             	and    $0x1,%eax
  return (netif->flags & NETIF_FLAG_UP)?1:0;
}
  80791c:	5d                   	pop    %ebp
  80791d:	c3                   	ret    

0080791e <netif_set_up>:
 * up once configured.
 * 
 * @see dhcp_start()
 */ 
void netif_set_up(struct netif *netif)
{
  80791e:	55                   	push   %ebp
  80791f:	89 e5                	mov    %esp,%ebp
  807921:	83 ec 18             	sub    $0x18,%esp
  807924:	8b 45 08             	mov    0x8(%ebp),%eax
  if ( !(netif->flags & NETIF_FLAG_UP )) {
  807927:	0f b6 50 2e          	movzbl 0x2e(%eax),%edx
  80792b:	f6 c2 01             	test   $0x1,%dl
  80792e:	75 22                	jne    807952 <netif_set_up+0x34>
    netif->flags |= NETIF_FLAG_UP;
  807930:	83 ca 01             	or     $0x1,%edx
  807933:	88 50 2e             	mov    %dl,0x2e(%eax)
    /** For Ethernet network interfaces, we would like to send a
     *  "gratuitous ARP"; this is an ARP packet sent by a node in order
     *  to spontaneously cause other nodes to update an entry in their
     *  ARP cache. From RFC 3220 "IP Mobility Support for IPv4" section 4.6.
     */ 
    if (netif->flags & NETIF_FLAG_ETHARP) {
  807936:	f6 c2 20             	test   $0x20,%dl
  807939:	74 17                	je     807952 <netif_set_up+0x34>
      etharp_query(netif, &(netif->ip_addr), NULL);
  80793b:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  807942:	00 
  807943:	8d 50 04             	lea    0x4(%eax),%edx
  807946:	89 54 24 04          	mov    %edx,0x4(%esp)
  80794a:	89 04 24             	mov    %eax,(%esp)
  80794d:	e8 65 53 00 00       	call   80ccb7 <etharp_query>
    }
#endif /* LWIP_ARP */
    
  }
}
  807952:	c9                   	leave  
  807953:	c3                   	ret    

00807954 <netif_set_ipaddr>:
 * @note call netif_set_addr() if you also want to change netmask and
 * default gateway
 */
void
netif_set_ipaddr(struct netif *netif, struct ip_addr *ipaddr)
{
  807954:	55                   	push   %ebp
  807955:	89 e5                	mov    %esp,%ebp
  807957:	57                   	push   %edi
  807958:	56                   	push   %esi
  807959:	53                   	push   %ebx
  80795a:	83 ec 1c             	sub    $0x1c,%esp
  80795d:	8b 5d 08             	mov    0x8(%ebp),%ebx
  807960:	8b 75 0c             	mov    0xc(%ebp),%esi
#if LWIP_TCP
  struct tcp_pcb *pcb;
  struct tcp_pcb_listen *lpcb;

  /* address is actually being changed? */
  if ((ip_addr_cmp(ipaddr, &(netif->ip_addr))) == 0)
  807963:	8b 06                	mov    (%esi),%eax
  807965:	3b 43 04             	cmp    0x4(%ebx),%eax
  807968:	74 54                	je     8079be <netif_set_ipaddr+0x6a>
  {
    /* extern struct tcp_pcb *tcp_active_pcbs; defined by tcp.h */
    LWIP_DEBUGF(NETIF_DEBUG | 1, ("netif_set_ipaddr: netif address being changed\n"));
    pcb = tcp_active_pcbs;
  80796a:	a1 08 f6 b3 00       	mov    0xb3f608,%eax
    while (pcb != NULL) {
  80796f:	85 c0                	test   %eax,%eax
  807971:	74 1d                	je     807990 <netif_set_ipaddr+0x3c>
      /* PCB bound to current local interface address? */
      if (ip_addr_cmp(&(pcb->local_ip), &(netif->ip_addr))) {
  807973:	8b 10                	mov    (%eax),%edx
  807975:	3b 53 04             	cmp    0x4(%ebx),%edx
  807978:	75 0f                	jne    807989 <netif_set_ipaddr+0x35>
        /* this connection must be aborted */
        struct tcp_pcb *next = pcb->next;
  80797a:	8b 78 0c             	mov    0xc(%eax),%edi
        LWIP_DEBUGF(NETIF_DEBUG | 1, ("netif_set_ipaddr: aborting TCP pcb %p\n", (void *)pcb));
        tcp_abort(pcb);
  80797d:	89 04 24             	mov    %eax,(%esp)
  807980:	e8 99 16 00 00       	call   80901e <tcp_abort>
  807985:	89 f8                	mov    %edi,%eax
  807987:	eb 03                	jmp    80798c <netif_set_ipaddr+0x38>
        pcb = next;
      } else {
        pcb = pcb->next;
  807989:	8b 40 0c             	mov    0xc(%eax),%eax
  if ((ip_addr_cmp(ipaddr, &(netif->ip_addr))) == 0)
  {
    /* extern struct tcp_pcb *tcp_active_pcbs; defined by tcp.h */
    LWIP_DEBUGF(NETIF_DEBUG | 1, ("netif_set_ipaddr: netif address being changed\n"));
    pcb = tcp_active_pcbs;
    while (pcb != NULL) {
  80798c:	85 c0                	test   %eax,%eax
  80798e:	75 e3                	jne    807973 <netif_set_ipaddr+0x1f>
        pcb = next;
      } else {
        pcb = pcb->next;
      }
    }
    for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
  807990:	a1 10 f6 b3 00       	mov    0xb3f610,%eax
  807995:	85 c0                	test   %eax,%eax
  807997:	74 25                	je     8079be <netif_set_ipaddr+0x6a>
      /* PCB bound to current local interface address? */
      if ((!(ip_addr_isany(&(lpcb->local_ip)))) &&
          (ip_addr_cmp(&(lpcb->local_ip), &(netif->ip_addr)))) {
        /* The PCB is listening to the old ipaddr and
         * is set to listen to the new one instead */
        ip_addr_set(&(lpcb->local_ip), ipaddr);
  807999:	b9 00 00 00 00       	mov    $0x0,%ecx
        pcb = pcb->next;
      }
    }
    for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
      /* PCB bound to current local interface address? */
      if ((!(ip_addr_isany(&(lpcb->local_ip)))) &&
  80799e:	85 c0                	test   %eax,%eax
  8079a0:	74 15                	je     8079b7 <netif_set_ipaddr+0x63>
  8079a2:	8b 10                	mov    (%eax),%edx
  8079a4:	85 d2                	test   %edx,%edx
  8079a6:	74 0f                	je     8079b7 <netif_set_ipaddr+0x63>
          (ip_addr_cmp(&(lpcb->local_ip), &(netif->ip_addr)))) {
  8079a8:	3b 53 04             	cmp    0x4(%ebx),%edx
  8079ab:	75 0a                	jne    8079b7 <netif_set_ipaddr+0x63>
        /* The PCB is listening to the old ipaddr and
         * is set to listen to the new one instead */
        ip_addr_set(&(lpcb->local_ip), ipaddr);
  8079ad:	89 ca                	mov    %ecx,%edx
  8079af:	85 f6                	test   %esi,%esi
  8079b1:	74 02                	je     8079b5 <netif_set_ipaddr+0x61>
  8079b3:	8b 16                	mov    (%esi),%edx
  8079b5:	89 10                	mov    %edx,(%eax)
        pcb = next;
      } else {
        pcb = pcb->next;
      }
    }
    for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
  8079b7:	8b 40 0c             	mov    0xc(%eax),%eax
  8079ba:	85 c0                	test   %eax,%eax
  8079bc:	75 e0                	jne    80799e <netif_set_ipaddr+0x4a>
  }
#endif
  snmp_delete_ipaddridx_tree(netif);
  snmp_delete_iprteidx_tree(0,netif);
  /* set new IP address to netif */
  ip_addr_set(&(netif->ip_addr), ipaddr);
  8079be:	b8 00 00 00 00       	mov    $0x0,%eax
  8079c3:	85 f6                	test   %esi,%esi
  8079c5:	74 02                	je     8079c9 <netif_set_ipaddr+0x75>
  8079c7:	8b 06                	mov    (%esi),%eax
  8079c9:	89 43 04             	mov    %eax,0x4(%ebx)
    netif->name[0], netif->name[1],
    ip4_addr1(&netif->ip_addr),
    ip4_addr2(&netif->ip_addr),
    ip4_addr3(&netif->ip_addr),
    ip4_addr4(&netif->ip_addr)));
}
  8079cc:	83 c4 1c             	add    $0x1c,%esp
  8079cf:	5b                   	pop    %ebx
  8079d0:	5e                   	pop    %esi
  8079d1:	5f                   	pop    %edi
  8079d2:	5d                   	pop    %ebp
  8079d3:	c3                   	ret    

008079d4 <netif_set_addr>:
 * @param gw the new default gateway
 */
void
netif_set_addr(struct netif *netif, struct ip_addr *ipaddr, struct ip_addr *netmask,
    struct ip_addr *gw)
{
  8079d4:	55                   	push   %ebp
  8079d5:	89 e5                	mov    %esp,%ebp
  8079d7:	53                   	push   %ebx
  8079d8:	83 ec 14             	sub    $0x14,%esp
  8079db:	8b 5d 08             	mov    0x8(%ebp),%ebx
  netif_set_ipaddr(netif, ipaddr);
  8079de:	8b 45 0c             	mov    0xc(%ebp),%eax
  8079e1:	89 44 24 04          	mov    %eax,0x4(%esp)
  8079e5:	89 1c 24             	mov    %ebx,(%esp)
  8079e8:	e8 67 ff ff ff       	call   807954 <netif_set_ipaddr>
  netif_set_netmask(netif, netmask);
  8079ed:	8b 45 10             	mov    0x10(%ebp),%eax
  8079f0:	89 44 24 04          	mov    %eax,0x4(%esp)
  8079f4:	89 1c 24             	mov    %ebx,(%esp)
  8079f7:	e8 7c fe ff ff       	call   807878 <netif_set_netmask>
  netif_set_gw(netif, gw);
  8079fc:	8b 45 14             	mov    0x14(%ebp),%eax
  8079ff:	89 44 24 04          	mov    %eax,0x4(%esp)
  807a03:	89 1c 24             	mov    %ebx,(%esp)
  807a06:	e8 54 fe ff ff       	call   80785f <netif_set_gw>
}
  807a0b:	83 c4 14             	add    $0x14,%esp
  807a0e:	5b                   	pop    %ebx
  807a0f:	5d                   	pop    %ebp
  807a10:	c3                   	ret    

00807a11 <netif_add>:
netif_add(struct netif *netif, struct ip_addr *ipaddr, struct ip_addr *netmask,
  struct ip_addr *gw,
  void *state,
  err_t (* init)(struct netif *netif),
  err_t (* input)(struct pbuf *p, struct netif *netif))
{
  807a11:	55                   	push   %ebp
  807a12:	89 e5                	mov    %esp,%ebp
  807a14:	53                   	push   %ebx
  807a15:	83 ec 14             	sub    $0x14,%esp
  807a18:	8b 5d 08             	mov    0x8(%ebp),%ebx
  static u8_t netifnum = 0;

  /* reset new interface configuration state */
  netif->ip_addr.addr = 0;
  807a1b:	c7 43 04 00 00 00 00 	movl   $0x0,0x4(%ebx)
  netif->netmask.addr = 0;
  807a22:	c7 43 08 00 00 00 00 	movl   $0x0,0x8(%ebx)
  netif->gw.addr = 0;
  807a29:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
  netif->flags = 0;
  807a30:	c6 43 2e 00          	movb   $0x0,0x2e(%ebx)
#if LWIP_DHCP
  /* netif not under DHCP control by default */
  netif->dhcp = NULL;
  807a34:	c7 43 20 00 00 00 00 	movl   $0x0,0x20(%ebx)
  netif->loop_first = NULL;
  netif->loop_last = NULL;
#endif /* ENABLE_LOOPBACK */

  /* remember netif specific state information data */
  netif->state = state;
  807a3b:	8b 45 18             	mov    0x18(%ebp),%eax
  807a3e:	89 43 1c             	mov    %eax,0x1c(%ebx)
  netif->num = netifnum++;
  807a41:	0f b6 05 a4 87 b3 00 	movzbl 0xb387a4,%eax
  807a48:	88 43 31             	mov    %al,0x31(%ebx)
  807a4b:	83 c0 01             	add    $0x1,%eax
  807a4e:	a2 a4 87 b3 00       	mov    %al,0xb387a4
  netif->input = input;
  807a53:	8b 45 20             	mov    0x20(%ebp),%eax
  807a56:	89 43 10             	mov    %eax,0x10(%ebx)
#endif /* LWIP_NETIF_HWADDRHINT*/
#if ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS
  netif->loop_cnt_current = 0;
#endif /* ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS */

  netif_set_addr(netif, ipaddr, netmask, gw);
  807a59:	8b 45 14             	mov    0x14(%ebp),%eax
  807a5c:	89 44 24 0c          	mov    %eax,0xc(%esp)
  807a60:	8b 45 10             	mov    0x10(%ebp),%eax
  807a63:	89 44 24 08          	mov    %eax,0x8(%esp)
  807a67:	8b 45 0c             	mov    0xc(%ebp),%eax
  807a6a:	89 44 24 04          	mov    %eax,0x4(%esp)
  807a6e:	89 1c 24             	mov    %ebx,(%esp)
  807a71:	e8 5e ff ff ff       	call   8079d4 <netif_set_addr>

  /* call user specified initialization function for netif */
  if (init(netif) != ERR_OK) {
  807a76:	89 1c 24             	mov    %ebx,(%esp)
  807a79:	ff 55 1c             	call   *0x1c(%ebp)
  807a7c:	84 c0                	test   %al,%al
  807a7e:	74 07                	je     807a87 <netif_add+0x76>
  807a80:	bb 00 00 00 00       	mov    $0x0,%ebx
  807a85:	eb 0d                	jmp    807a94 <netif_add+0x83>
    return NULL;
  }

  /* add this netif to the list */
  netif->next = netif_list;
  807a87:	a1 00 f6 b3 00       	mov    0xb3f600,%eax
  807a8c:	89 03                	mov    %eax,(%ebx)
  netif_list = netif;
  807a8e:	89 1d 00 f6 b3 00    	mov    %ebx,0xb3f600
  ip_addr_debug_print(NETIF_DEBUG, netmask);
  LWIP_DEBUGF(NETIF_DEBUG, (" gw "));
  ip_addr_debug_print(NETIF_DEBUG, gw);
  LWIP_DEBUGF(NETIF_DEBUG, ("\n"));
  return netif;
}
  807a94:	89 d8                	mov    %ebx,%eax
  807a96:	83 c4 14             	add    $0x14,%esp
  807a99:	5b                   	pop    %ebx
  807a9a:	5d                   	pop    %ebp
  807a9b:	c3                   	ret    
  807a9c:	00 00                	add    %al,(%eax)
	...

00807aa0 <pbuf_clen>:
 * @return the number of pbufs in a chain
 */

u8_t
pbuf_clen(struct pbuf *p)
{
  807aa0:	55                   	push   %ebp
  807aa1:	89 e5                	mov    %esp,%ebp
  807aa3:	8b 55 08             	mov    0x8(%ebp),%edx
  u8_t len;

  len = 0;
  while (p != NULL) {
  807aa6:	b8 00 00 00 00       	mov    $0x0,%eax
  807aab:	85 d2                	test   %edx,%edx
  807aad:	74 09                	je     807ab8 <pbuf_clen+0x18>
    ++len;
  807aaf:	83 c0 01             	add    $0x1,%eax
    p = p->next;
  807ab2:	8b 12                	mov    (%edx),%edx
pbuf_clen(struct pbuf *p)
{
  u8_t len;

  len = 0;
  while (p != NULL) {
  807ab4:	85 d2                	test   %edx,%edx
  807ab6:	75 f7                	jne    807aaf <pbuf_clen+0xf>
    ++len;
    p = p->next;
  }
  return len;
}
  807ab8:	5d                   	pop    %ebp
  807ab9:	c3                   	ret    

00807aba <pbuf_ref>:
 * @param p pbuf to increase reference counter of
 *
 */
void
pbuf_ref(struct pbuf *p)
{
  807aba:	55                   	push   %ebp
  807abb:	89 e5                	mov    %esp,%ebp
  807abd:	8b 45 08             	mov    0x8(%ebp),%eax
  SYS_ARCH_DECL_PROTECT(old_level);
  /* pbuf given? */
  if (p != NULL) {
  807ac0:	85 c0                	test   %eax,%eax
  807ac2:	74 05                	je     807ac9 <pbuf_ref+0xf>
    SYS_ARCH_PROTECT(old_level);
    ++(p->ref);
  807ac4:	66 83 40 0e 01       	addw   $0x1,0xe(%eax)
    SYS_ARCH_UNPROTECT(old_level);
  }
}
  807ac9:	5d                   	pop    %ebp
  807aca:	c3                   	ret    

00807acb <pbuf_cat>:
 * @see pbuf_chain()
 */

void
pbuf_cat(struct pbuf *h, struct pbuf *t)
{
  807acb:	55                   	push   %ebp
  807acc:	89 e5                	mov    %esp,%ebp
  807ace:	53                   	push   %ebx
  807acf:	83 ec 14             	sub    $0x14,%esp
  807ad2:	8b 5d 08             	mov    0x8(%ebp),%ebx
  807ad5:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  struct pbuf *p;

  LWIP_ERROR("(h != NULL) && (t != NULL) (programmer violates API)",
  807ad8:	85 db                	test   %ebx,%ebx
  807ada:	74 0e                	je     807aea <pbuf_cat+0x1f>
  807adc:	85 c9                	test   %ecx,%ecx
  807ade:	74 0a                	je     807aea <pbuf_cat+0x1f>
             ((h != NULL) && (t != NULL)), return;);

  /* proceed to last pbuf of chain */
  for (p = h; p->next != NULL; p = p->next) {
  807ae0:	8b 13                	mov    (%ebx),%edx
void
pbuf_cat(struct pbuf *h, struct pbuf *t)
{
  struct pbuf *p;

  LWIP_ERROR("(h != NULL) && (t != NULL) (programmer violates API)",
  807ae2:	89 d8                	mov    %ebx,%eax
             ((h != NULL) && (t != NULL)), return;);

  /* proceed to last pbuf of chain */
  for (p = h; p->next != NULL; p = p->next) {
  807ae4:	85 d2                	test   %edx,%edx
  807ae6:	75 1e                	jne    807b06 <pbuf_cat+0x3b>
  807ae8:	eb 2c                	jmp    807b16 <pbuf_cat+0x4b>
void
pbuf_cat(struct pbuf *h, struct pbuf *t)
{
  struct pbuf *p;

  LWIP_ERROR("(h != NULL) && (t != NULL) (programmer violates API)",
  807aea:	c7 44 24 08 98 36 81 	movl   $0x813698,0x8(%esp)
  807af1:	00 
  807af2:	c7 44 24 04 42 02 00 	movl   $0x242,0x4(%esp)
  807af9:	00 
  807afa:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  807b01:	e8 96 8e ff ff       	call   80099c <_panic>
             ((h != NULL) && (t != NULL)), return;);

  /* proceed to last pbuf of chain */
  for (p = h; p->next != NULL; p = p->next) {
    /* add total length of second chain to all totals of first chain */
    p->tot_len += t->tot_len;
  807b06:	0f b7 51 08          	movzwl 0x8(%ecx),%edx
  807b0a:	66 01 50 08          	add    %dx,0x8(%eax)

  LWIP_ERROR("(h != NULL) && (t != NULL) (programmer violates API)",
             ((h != NULL) && (t != NULL)), return;);

  /* proceed to last pbuf of chain */
  for (p = h; p->next != NULL; p = p->next) {
  807b0e:	8b 00                	mov    (%eax),%eax
  807b10:	8b 10                	mov    (%eax),%edx
  807b12:	85 d2                	test   %edx,%edx
  807b14:	75 f0                	jne    807b06 <pbuf_cat+0x3b>
    /* add total length of second chain to all totals of first chain */
    p->tot_len += t->tot_len;
  }
  /* { p is last pbuf of first h chain, p->next == NULL } */
  LWIP_ASSERT("p->tot_len == p->len (of last pbuf in chain)", p->tot_len == p->len);
  807b16:	0f b7 58 08          	movzwl 0x8(%eax),%ebx
  807b1a:	66 3b 58 0a          	cmp    0xa(%eax),%bx
  807b1e:	74 1c                	je     807b3c <pbuf_cat+0x71>
  807b20:	c7 44 24 08 d0 36 81 	movl   $0x8136d0,0x8(%esp)
  807b27:	00 
  807b28:	c7 44 24 04 4a 02 00 	movl   $0x24a,0x4(%esp)
  807b2f:	00 
  807b30:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  807b37:	e8 60 8e ff ff       	call   80099c <_panic>
  LWIP_ASSERT("p->next == NULL", p->next == NULL);
  807b3c:	85 d2                	test   %edx,%edx
  807b3e:	74 1c                	je     807b5c <pbuf_cat+0x91>
  807b40:	c7 44 24 08 42 38 81 	movl   $0x813842,0x8(%esp)
  807b47:	00 
  807b48:	c7 44 24 04 4b 02 00 	movl   $0x24b,0x4(%esp)
  807b4f:	00 
  807b50:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  807b57:	e8 40 8e ff ff       	call   80099c <_panic>
  /* add total length of second chain to last pbuf total of first chain */
  p->tot_len += t->tot_len;
  807b5c:	66 03 59 08          	add    0x8(%ecx),%bx
  807b60:	66 89 58 08          	mov    %bx,0x8(%eax)
  /* chain last pbuf of head (p) with first of tail (t) */
  p->next = t;
  807b64:	89 08                	mov    %ecx,(%eax)
  /* p->next now references t, but the caller will drop its reference to t,
   * so netto there is no change to the reference count of t.
   */
}
  807b66:	83 c4 14             	add    $0x14,%esp
  807b69:	5b                   	pop    %ebx
  807b6a:	5d                   	pop    %ebp
  807b6b:	c3                   	ret    

00807b6c <pbuf_chain>:
 * The ->ref field of the first pbuf of the tail chain is adjusted.
 *
 */
void
pbuf_chain(struct pbuf *h, struct pbuf *t)
{
  807b6c:	55                   	push   %ebp
  807b6d:	89 e5                	mov    %esp,%ebp
  807b6f:	53                   	push   %ebx
  807b70:	83 ec 14             	sub    $0x14,%esp
  807b73:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  pbuf_cat(h, t);
  807b76:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  807b7a:	8b 45 08             	mov    0x8(%ebp),%eax
  807b7d:	89 04 24             	mov    %eax,(%esp)
  807b80:	e8 46 ff ff ff       	call   807acb <pbuf_cat>
  /* t is now referenced by h */
  pbuf_ref(t);
  807b85:	89 1c 24             	mov    %ebx,(%esp)
  807b88:	e8 2d ff ff ff       	call   807aba <pbuf_ref>
  LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_FRESH | 2, ("pbuf_chain: %p references %p\n", (void *)h, (void *)t));
}
  807b8d:	83 c4 14             	add    $0x14,%esp
  807b90:	5b                   	pop    %ebx
  807b91:	5d                   	pop    %ebp
  807b92:	c3                   	ret    

00807b93 <pbuf_header>:
 * @return non-zero on failure, zero on success.
 *
 */
u8_t
pbuf_header(struct pbuf *p, s16_t header_size_increment)
{
  807b93:	55                   	push   %ebp
  807b94:	89 e5                	mov    %esp,%ebp
  807b96:	83 ec 18             	sub    $0x18,%esp
  807b99:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  807b9c:	89 75 fc             	mov    %esi,-0x4(%ebp)
  807b9f:	8b 55 08             	mov    0x8(%ebp),%edx
  807ba2:	0f b7 4d 0c          	movzwl 0xc(%ebp),%ecx
  u16_t type;
  void *payload;
  u16_t increment_magnitude;

  LWIP_ASSERT("p != NULL", p != NULL);
  807ba6:	85 d2                	test   %edx,%edx
  807ba8:	75 1c                	jne    807bc6 <pbuf_header+0x33>
  807baa:	c7 44 24 08 0b 39 81 	movl   $0x81390b,0x8(%esp)
  807bb1:	00 
  807bb2:	c7 44 24 04 64 01 00 	movl   $0x164,0x4(%esp)
  807bb9:	00 
  807bba:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  807bc1:	e8 d6 8d ff ff       	call   80099c <_panic>
  if ((header_size_increment == 0) || (p == NULL))
  807bc6:	b8 00 00 00 00       	mov    $0x0,%eax
  807bcb:	66 85 c9             	test   %cx,%cx
  807bce:	0f 84 a8 00 00 00    	je     807c7c <pbuf_header+0xe9>
  if (header_size_increment < 0){
    increment_magnitude = -header_size_increment;
    /* Check that we aren't going to move off the end of the pbuf */
    LWIP_ERROR("increment_magnitude <= p->len", (increment_magnitude <= p->len), return 1;);
  } else {
    increment_magnitude = header_size_increment;
  807bd4:	89 ce                	mov    %ecx,%esi

  LWIP_ASSERT("p != NULL", p != NULL);
  if ((header_size_increment == 0) || (p == NULL))
    return 0;
 
  if (header_size_increment < 0){
  807bd6:	66 85 c9             	test   %cx,%cx
  807bd9:	79 24                	jns    807bff <pbuf_header+0x6c>
    increment_magnitude = -header_size_increment;
  807bdb:	f7 de                	neg    %esi
    /* Check that we aren't going to move off the end of the pbuf */
    LWIP_ERROR("increment_magnitude <= p->len", (increment_magnitude <= p->len), return 1;);
  807bdd:	66 3b 72 0a          	cmp    0xa(%edx),%si
  807be1:	76 1c                	jbe    807bff <pbuf_header+0x6c>
  807be3:	c7 44 24 08 52 38 81 	movl   $0x813852,0x8(%esp)
  807bea:	00 
  807beb:	c7 44 24 04 6b 01 00 	movl   $0x16b,0x4(%esp)
  807bf2:	00 
  807bf3:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  807bfa:	e8 9d 8d ff ff       	call   80099c <_panic>
    LWIP_ASSERT("p->payload - increment_magnitude >= p + SIZEOF_STRUCT_PBUF",
                (u8_t *)p->payload - increment_magnitude >= (u8_t *)p + SIZEOF_STRUCT_PBUF);
#endif
  }

  type = p->type;
  807bff:	0f b6 42 0c          	movzbl 0xc(%edx),%eax
  /* remember current payload pointer */
  payload = p->payload;
  807c03:	8b 5a 04             	mov    0x4(%edx),%ebx

  /* pbuf types containing payloads? */
  if (type == PBUF_RAM || type == PBUF_POOL) {
  807c06:	66 85 c0             	test   %ax,%ax
  807c09:	74 06                	je     807c11 <pbuf_header+0x7e>
  807c0b:	66 83 f8 03          	cmp    $0x3,%ax
  807c0f:	75 1d                	jne    807c2e <pbuf_header+0x9b>
    /* set new payload pointer */
    p->payload = (u8_t *)p->payload - header_size_increment;
  807c11:	0f bf c1             	movswl %cx,%eax
  807c14:	89 de                	mov    %ebx,%esi
  807c16:	29 c6                	sub    %eax,%esi
  807c18:	89 f0                	mov    %esi,%eax
  807c1a:	89 72 04             	mov    %esi,0x4(%edx)
    /* boundary check fails? */
    if ((u8_t *)p->payload < (u8_t *)p + SIZEOF_STRUCT_PBUF) {
  807c1d:	8d 72 10             	lea    0x10(%edx),%esi
  807c20:	39 f0                	cmp    %esi,%eax
  807c22:	73 44                	jae    807c68 <pbuf_header+0xd5>
      LWIP_DEBUGF( PBUF_DEBUG | 2, ("pbuf_header: failed as %p < %p (not enough space for new header size)\n",
        (void *)p->payload,
        (void *)(p + 1)));\
      /* restore old payload pointer */
      p->payload = payload;
  807c24:	89 5a 04             	mov    %ebx,0x4(%edx)
  807c27:	b8 01 00 00 00       	mov    $0x1,%eax
      /* bail out unsuccesfully */
      return 1;
  807c2c:	eb 4e                	jmp    807c7c <pbuf_header+0xe9>
    }
  /* pbuf types refering to external payloads? */
  } else if (type == PBUF_REF || type == PBUF_ROM) {
  807c2e:	83 e8 01             	sub    $0x1,%eax
  807c31:	66 83 f8 01          	cmp    $0x1,%ax
  807c35:	77 15                	ja     807c4c <pbuf_header+0xb9>
    /* hide a header in the payload? */
    if ((header_size_increment < 0) && (increment_magnitude <= p->len)) {
  807c37:	66 85 c9             	test   %cx,%cx
  807c3a:	79 3b                	jns    807c77 <pbuf_header+0xe4>
  807c3c:	66 3b 72 0a          	cmp    0xa(%edx),%si
  807c40:	77 35                	ja     807c77 <pbuf_header+0xe4>
      /* increase payload pointer */
      p->payload = (u8_t *)p->payload - header_size_increment;
  807c42:	0f bf c1             	movswl %cx,%eax
  807c45:	29 c3                	sub    %eax,%ebx
  807c47:	89 5a 04             	mov    %ebx,0x4(%edx)
  807c4a:	eb 1c                	jmp    807c68 <pbuf_header+0xd5>
      return 1;
    }
  }
  else {
    /* Unknown type */
    LWIP_ASSERT("bad pbuf type", 0);
  807c4c:	c7 44 24 08 70 38 81 	movl   $0x813870,0x8(%esp)
  807c53:	00 
  807c54:	c7 44 24 04 9a 01 00 	movl   $0x19a,0x4(%esp)
  807c5b:	00 
  807c5c:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  807c63:	e8 34 8d ff ff       	call   80099c <_panic>
    return 1;
  }
  /* modify pbuf length fields */
  p->len += header_size_increment;
  807c68:	66 01 4a 0a          	add    %cx,0xa(%edx)
  p->tot_len += header_size_increment;
  807c6c:	66 01 4a 08          	add    %cx,0x8(%edx)
  807c70:	b8 00 00 00 00       	mov    $0x0,%eax

  LWIP_DEBUGF(PBUF_DEBUG, ("pbuf_header: old %p new %p (%"S16_F")\n",
    (void *)payload, (void *)p->payload, header_size_increment));

  return 0;
  807c75:	eb 05                	jmp    807c7c <pbuf_header+0xe9>
  807c77:	b8 01 00 00 00       	mov    $0x1,%eax
}
  807c7c:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  807c7f:	8b 75 fc             	mov    -0x4(%ebp),%esi
  807c82:	89 ec                	mov    %ebp,%esp
  807c84:	5d                   	pop    %ebp
  807c85:	c3                   	ret    

00807c86 <pbuf_copy_partial>:
 * @param len length of data to copy (dataptr must be big enough)
 * @param offset offset into the packet buffer from where to begin copying len bytes
 */
u16_t
pbuf_copy_partial(struct pbuf *buf, void *dataptr, u16_t len, u16_t offset)
{
  807c86:	55                   	push   %ebp
  807c87:	89 e5                	mov    %esp,%ebp
  807c89:	57                   	push   %edi
  807c8a:	56                   	push   %esi
  807c8b:	53                   	push   %ebx
  807c8c:	83 ec 2c             	sub    $0x2c,%esp
  807c8f:	8b 5d 08             	mov    0x8(%ebp),%ebx
  807c92:	0f b7 75 10          	movzwl 0x10(%ebp),%esi
  807c96:	0f b7 45 14          	movzwl 0x14(%ebp),%eax
  struct pbuf *p;
  u16_t left;
  u16_t buf_copy_len;
  u16_t copied_total = 0;

  LWIP_ERROR("netbuf_copy_partial: invalid buf", (buf != NULL), return 0;);
  807c9a:	85 db                	test   %ebx,%ebx
  807c9c:	75 1c                	jne    807cba <pbuf_copy_partial+0x34>
  807c9e:	c7 44 24 08 00 37 81 	movl   $0x813700,0x8(%esp)
  807ca5:	00 
  807ca6:	c7 44 24 04 ef 02 00 	movl   $0x2ef,0x4(%esp)
  807cad:	00 
  807cae:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  807cb5:	e8 e2 8c ff ff       	call   80099c <_panic>
  LWIP_ERROR("netbuf_copy_partial: invalid dataptr", (dataptr != NULL), return 0;);
  807cba:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  807cbe:	75 1c                	jne    807cdc <pbuf_copy_partial+0x56>
  807cc0:	c7 44 24 08 24 37 81 	movl   $0x813724,0x8(%esp)
  807cc7:	00 
  807cc8:	c7 44 24 04 f0 02 00 	movl   $0x2f0,0x4(%esp)
  807ccf:	00 
  807cd0:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  807cd7:	e8 c0 8c ff ff       	call   80099c <_panic>
  if((buf == NULL) || (dataptr == NULL)) {
    return 0;
  }

  /* Note some systems use byte copy if dataptr or one of the pbuf payload pointers are unaligned. */
  for(p = buf; len != 0 && p != NULL; p = p->next) {
  807cdc:	66 c7 45 e4 00 00    	movw   $0x0,-0x1c(%ebp)
  807ce2:	66 85 f6             	test   %si,%si
  807ce5:	74 61                	je     807d48 <pbuf_copy_partial+0xc2>
  807ce7:	66 c7 45 e6 00 00    	movw   $0x0,-0x1a(%ebp)
    if ((offset != 0) && (offset >= p->len)) {
  807ced:	66 85 c0             	test   %ax,%ax
  807cf0:	74 0e                	je     807d00 <pbuf_copy_partial+0x7a>
  807cf2:	0f b7 53 0a          	movzwl 0xa(%ebx),%edx
  807cf6:	66 39 c2             	cmp    %ax,%dx
  807cf9:	77 05                	ja     807d00 <pbuf_copy_partial+0x7a>
      /* don't copy from this buffer -> on to the next */
      offset -= p->len;
  807cfb:	66 29 d0             	sub    %dx,%ax
    return 0;
  }

  /* Note some systems use byte copy if dataptr or one of the pbuf payload pointers are unaligned. */
  for(p = buf; len != 0 && p != NULL; p = p->next) {
    if ((offset != 0) && (offset >= p->len)) {
  807cfe:	eb 3d                	jmp    807d3d <pbuf_copy_partial+0xb7>
      /* don't copy from this buffer -> on to the next */
      offset -= p->len;
    } else {
      /* copy from this buffer. maybe only partially. */
      buf_copy_len = p->len - offset;
  807d00:	0f b7 7b 0a          	movzwl 0xa(%ebx),%edi
  807d04:	66 29 c7             	sub    %ax,%di
  807d07:	66 39 f7             	cmp    %si,%di
  807d0a:	0f 47 fe             	cmova  %esi,%edi
      if (buf_copy_len > len)
          buf_copy_len = len;
      /* copy the necessary parts of the buffer */
      MEMCPY(&((char*)dataptr)[left], &((char*)p->payload)[offset], buf_copy_len);
  807d0d:	0f b7 d7             	movzwl %di,%edx
  807d10:	89 54 24 08          	mov    %edx,0x8(%esp)
  807d14:	0f b7 c0             	movzwl %ax,%eax
  807d17:	03 43 04             	add    0x4(%ebx),%eax
  807d1a:	89 44 24 04          	mov    %eax,0x4(%esp)
  807d1e:	0f b7 45 e6          	movzwl -0x1a(%ebp),%eax
  807d22:	03 45 0c             	add    0xc(%ebp),%eax
  807d25:	89 04 24             	mov    %eax,(%esp)
  807d28:	e8 34 96 ff ff       	call   801361 <memcpy>
      copied_total += buf_copy_len;
  807d2d:	66 01 7d e4          	add    %di,-0x1c(%ebp)
      left += buf_copy_len;
  807d31:	66 01 7d e6          	add    %di,-0x1a(%ebp)
      len -= buf_copy_len;
  807d35:	66 29 fe             	sub    %di,%si
  807d38:	b8 00 00 00 00       	mov    $0x0,%eax
  if((buf == NULL) || (dataptr == NULL)) {
    return 0;
  }

  /* Note some systems use byte copy if dataptr or one of the pbuf payload pointers are unaligned. */
  for(p = buf; len != 0 && p != NULL; p = p->next) {
  807d3d:	8b 1b                	mov    (%ebx),%ebx
  807d3f:	66 85 f6             	test   %si,%si
  807d42:	74 04                	je     807d48 <pbuf_copy_partial+0xc2>
  807d44:	85 db                	test   %ebx,%ebx
  807d46:	75 a5                	jne    807ced <pbuf_copy_partial+0x67>
      len -= buf_copy_len;
      offset = 0;
    }
  }
  return copied_total;
}
  807d48:	0f b7 45 e4          	movzwl -0x1c(%ebp),%eax
  807d4c:	83 c4 2c             	add    $0x2c,%esp
  807d4f:	5b                   	pop    %ebx
  807d50:	5e                   	pop    %esi
  807d51:	5f                   	pop    %edi
  807d52:	5d                   	pop    %ebp
  807d53:	c3                   	ret    

00807d54 <pbuf_copy>:
 *         ERR_ARG if one of the pbufs is NULL or p_to is not big
 *                 enough to hold p_from
 */
err_t
pbuf_copy(struct pbuf *p_to, struct pbuf *p_from)
{
  807d54:	55                   	push   %ebp
  807d55:	89 e5                	mov    %esp,%ebp
  807d57:	57                   	push   %edi
  807d58:	56                   	push   %esi
  807d59:	53                   	push   %ebx
  807d5a:	83 ec 4c             	sub    $0x4c,%esp
  807d5d:	8b 75 08             	mov    0x8(%ebp),%esi
  807d60:	8b 5d 0c             	mov    0xc(%ebp),%ebx

  LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE | 3, ("pbuf_copy(%p, %p)\n",
    (void*)p_to, (void*)p_from));

  /* is the target big enough to hold the source? */
  LWIP_ERROR("pbuf_copy: target not big enough to hold source", ((p_to != NULL) &&
  807d63:	85 f6                	test   %esi,%esi
  807d65:	0f 94 c0             	sete   %al
  807d68:	74 0e                	je     807d78 <pbuf_copy+0x24>
  807d6a:	85 db                	test   %ebx,%ebx
  807d6c:	74 0a                	je     807d78 <pbuf_copy+0x24>
  807d6e:	0f b7 56 08          	movzwl 0x8(%esi),%edx
  807d72:	66 3b 53 08          	cmp    0x8(%ebx),%dx
  807d76:	73 1c                	jae    807d94 <pbuf_copy+0x40>
  807d78:	c7 44 24 08 4c 37 81 	movl   $0x81374c,0x8(%esp)
  807d7f:	00 
  807d80:	c7 44 24 04 b1 02 00 	movl   $0x2b1,0x4(%esp)
  807d87:	00 
  807d88:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  807d8f:	e8 08 8c ff ff       	call   80099c <_panic>
             (p_from != NULL) && (p_to->tot_len >= p_from->tot_len)), return ERR_ARG;);

  /* iterate through pbuf chain */
  do
  {
    LWIP_ASSERT("p_to != NULL", p_to != NULL);
  807d94:	84 c0                	test   %al,%al
  807d96:	74 26                	je     807dbe <pbuf_copy+0x6a>
  807d98:	eb 08                	jmp    807da2 <pbuf_copy+0x4e>
  807d9a:	85 f6                	test   %esi,%esi
  807d9c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  807da0:	75 27                	jne    807dc9 <pbuf_copy+0x75>
  807da2:	c7 44 24 08 7e 38 81 	movl   $0x81387e,0x8(%esp)
  807da9:	00 
  807daa:	c7 44 24 04 b6 02 00 	movl   $0x2b6,0x4(%esp)
  807db1:	00 
  807db2:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  807db9:	e8 de 8b ff ff       	call   80099c <_panic>
  807dbe:	bf 00 00 00 00       	mov    $0x0,%edi
  807dc3:	66 c7 45 e6 00 00    	movw   $0x0,-0x1a(%ebp)
    /* copy one part of the original chain */
    if ((p_to->len - offset_to) >= (p_from->len - offset_from)) {
  807dc9:	0f b7 4b 0a          	movzwl 0xa(%ebx),%ecx
  807dcd:	0f b7 56 0a          	movzwl 0xa(%esi),%edx
  807dd1:	0f b7 45 e6          	movzwl -0x1a(%ebp),%eax
  807dd5:	29 c2                	sub    %eax,%edx
  807dd7:	89 55 c4             	mov    %edx,-0x3c(%ebp)
  807dda:	0f b7 d1             	movzwl %cx,%edx
  807ddd:	0f b7 c7             	movzwl %di,%eax
  807de0:	29 c2                	sub    %eax,%edx
      /* complete current p_from fits into current p_to */
      len = p_from->len - offset_from;
  807de2:	66 29 f9             	sub    %di,%cx
  807de5:	0f b7 46 0a          	movzwl 0xa(%esi),%eax
  807de9:	66 2b 45 e6          	sub    -0x1a(%ebp),%ax
  807ded:	39 55 c4             	cmp    %edx,-0x3c(%ebp)
  807df0:	89 ca                	mov    %ecx,%edx
  807df2:	0f 4c d0             	cmovl  %eax,%edx
  807df5:	66 89 55 c8          	mov    %dx,-0x38(%ebp)
    } else {
      /* current p_from does not fit into current p_to */
      len = p_to->len - offset_to;
    }
    MEMCPY((u8_t*)p_to->payload + offset_to, (u8_t*)p_from->payload + offset_from, len);
  807df9:	0f b7 c2             	movzwl %dx,%eax
  807dfc:	89 44 24 08          	mov    %eax,0x8(%esp)
  807e00:	0f b7 c7             	movzwl %di,%eax
  807e03:	03 43 04             	add    0x4(%ebx),%eax
  807e06:	89 44 24 04          	mov    %eax,0x4(%esp)
  807e0a:	0f b7 45 e6          	movzwl -0x1a(%ebp),%eax
  807e0e:	03 46 04             	add    0x4(%esi),%eax
  807e11:	89 04 24             	mov    %eax,(%esp)
  807e14:	e8 48 95 ff ff       	call   801361 <memcpy>
    offset_to += len;
  807e19:	0f b7 45 c8          	movzwl -0x38(%ebp),%eax
  807e1d:	66 01 45 e6          	add    %ax,-0x1a(%ebp)
    offset_from += len;
    LWIP_ASSERT("offset_to <= p_to->len", offset_to <= p_to->len);
  807e21:	0f b7 46 0a          	movzwl 0xa(%esi),%eax
  807e25:	66 39 45 e6          	cmp    %ax,-0x1a(%ebp)
  807e29:	76 1c                	jbe    807e47 <pbuf_copy+0xf3>
  807e2b:	c7 44 24 08 8b 38 81 	movl   $0x81388b,0x8(%esp)
  807e32:	00 
  807e33:	c7 44 24 04 c2 02 00 	movl   $0x2c2,0x4(%esp)
  807e3a:	00 
  807e3b:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  807e42:	e8 55 8b ff ff       	call   80099c <_panic>
    if (offset_to == p_to->len) {
  807e47:	66 39 45 e6          	cmp    %ax,-0x1a(%ebp)
  807e4b:	75 08                	jne    807e55 <pbuf_copy+0x101>
      /* on to next p_to (if any) */
      offset_to = 0;
      p_to = p_to->next;
  807e4d:	8b 36                	mov    (%esi),%esi
  807e4f:	66 c7 45 e6 00 00    	movw   $0x0,-0x1a(%ebp)
      /* current p_from does not fit into current p_to */
      len = p_to->len - offset_to;
    }
    MEMCPY((u8_t*)p_to->payload + offset_to, (u8_t*)p_from->payload + offset_from, len);
    offset_to += len;
    offset_from += len;
  807e55:	66 03 7d c8          	add    -0x38(%ebp),%di
    if (offset_to == p_to->len) {
      /* on to next p_to (if any) */
      offset_to = 0;
      p_to = p_to->next;
    }
    LWIP_ASSERT("offset_from <= p_from->len", offset_from <= p_from->len);
  807e59:	0f b7 43 0a          	movzwl 0xa(%ebx),%eax
  807e5d:	66 39 c7             	cmp    %ax,%di
  807e60:	76 1c                	jbe    807e7e <pbuf_copy+0x12a>
  807e62:	c7 44 24 08 a2 38 81 	movl   $0x8138a2,0x8(%esp)
  807e69:	00 
  807e6a:	c7 44 24 04 c8 02 00 	movl   $0x2c8,0x4(%esp)
  807e71:	00 
  807e72:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  807e79:	e8 1e 8b ff ff       	call   80099c <_panic>
    if (offset_from >= p_from->len) {
  807e7e:	66 39 c7             	cmp    %ax,%di
  807e81:	72 07                	jb     807e8a <pbuf_copy+0x136>
      /* on to next p_from (if any) */
      offset_from = 0;
      p_from = p_from->next;
  807e83:	8b 1b                	mov    (%ebx),%ebx
  807e85:	bf 00 00 00 00       	mov    $0x0,%edi
    }

    if((p_from != NULL) && (p_from->len == p_from->tot_len)) {
  807e8a:	85 db                	test   %ebx,%ebx
  807e8c:	74 2b                	je     807eb9 <pbuf_copy+0x165>
  807e8e:	0f b7 43 0a          	movzwl 0xa(%ebx),%eax
  807e92:	66 3b 43 08          	cmp    0x8(%ebx),%ax
  807e96:	75 21                	jne    807eb9 <pbuf_copy+0x165>
      /* don't copy more than one packet! */
      LWIP_ERROR("pbuf_copy() does not allow packet queues!\n",
  807e98:	83 3b 00             	cmpl   $0x0,(%ebx)
  807e9b:	74 1c                	je     807eb9 <pbuf_copy+0x165>
  807e9d:	c7 44 24 08 7c 37 81 	movl   $0x81377c,0x8(%esp)
  807ea4:	00 
  807ea5:	c7 44 24 04 d2 02 00 	movl   $0x2d2,0x4(%esp)
  807eac:	00 
  807ead:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  807eb4:	e8 e3 8a ff ff       	call   80099c <_panic>
                 (p_from->next == NULL), return ERR_VAL;);
    }
    if((p_to != NULL) && (p_to->len == p_to->tot_len)) {
  807eb9:	85 f6                	test   %esi,%esi
  807ebb:	74 2b                	je     807ee8 <pbuf_copy+0x194>
  807ebd:	0f b7 46 0a          	movzwl 0xa(%esi),%eax
  807ec1:	66 3b 46 08          	cmp    0x8(%esi),%ax
  807ec5:	75 21                	jne    807ee8 <pbuf_copy+0x194>
      /* don't copy more than one packet! */
      LWIP_ERROR("pbuf_copy() does not allow packet queues!\n",
  807ec7:	83 3e 00             	cmpl   $0x0,(%esi)
  807eca:	74 1c                	je     807ee8 <pbuf_copy+0x194>
  807ecc:	c7 44 24 08 7c 37 81 	movl   $0x81377c,0x8(%esp)
  807ed3:	00 
  807ed4:	c7 44 24 04 d7 02 00 	movl   $0x2d7,0x4(%esp)
  807edb:	00 
  807edc:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  807ee3:	e8 b4 8a ff ff       	call   80099c <_panic>
                  (p_to->next == NULL), return ERR_VAL;);
    }
  } while (p_from);
  807ee8:	85 db                	test   %ebx,%ebx
  807eea:	0f 85 aa fe ff ff    	jne    807d9a <pbuf_copy+0x46>
  LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE | 1, ("pbuf_copy: end of chain reached.\n"));
  return ERR_OK;
}
  807ef0:	b8 00 00 00 00       	mov    $0x0,%eax
  807ef5:	83 c4 4c             	add    $0x4c,%esp
  807ef8:	5b                   	pop    %ebx
  807ef9:	5e                   	pop    %esi
  807efa:	5f                   	pop    %edi
  807efb:	5d                   	pop    %ebp
  807efc:	c3                   	ret    

00807efd <pbuf_free>:
 * 1->1->1 becomes .......
 *
 */
u8_t
pbuf_free(struct pbuf *p)
{
  807efd:	55                   	push   %ebp
  807efe:	89 e5                	mov    %esp,%ebp
  807f00:	56                   	push   %esi
  807f01:	53                   	push   %ebx
  807f02:	83 ec 10             	sub    $0x10,%esp
  807f05:	8b 45 08             	mov    0x8(%ebp),%eax
  u16_t type;
  struct pbuf *q;
  u8_t count;

  if (p == NULL) {
  807f08:	85 c0                	test   %eax,%eax
  807f0a:	75 1c                	jne    807f28 <pbuf_free+0x2b>
    LWIP_ASSERT("p != NULL", p != NULL);
  807f0c:	c7 44 24 08 0b 39 81 	movl   $0x81390b,0x8(%esp)
  807f13:	00 
  807f14:	c7 44 24 04 d0 01 00 	movl   $0x1d0,0x4(%esp)
  807f1b:	00 
  807f1c:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  807f23:	e8 74 8a ff ff       	call   80099c <_panic>
  }
  LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE | 3, ("pbuf_free(%p)\n", (void *)p));

  PERF_START;

  LWIP_ASSERT("pbuf_free: sane type",
  807f28:	80 78 0c 03          	cmpb   $0x3,0xc(%eax)
  807f2c:	77 0a                	ja     807f38 <pbuf_free+0x3b>
  807f2e:	be 00 00 00 00       	mov    $0x0,%esi
  807f33:	e9 82 00 00 00       	jmp    807fba <pbuf_free+0xbd>
  807f38:	c7 44 24 08 bd 38 81 	movl   $0x8138bd,0x8(%esp)
  807f3f:	00 
  807f40:	c7 44 24 04 db 01 00 	movl   $0x1db,0x4(%esp)
  807f47:	00 
  807f48:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  807f4f:	e8 48 8a ff ff       	call   80099c <_panic>
    /* Since decrementing ref cannot be guaranteed to be a single machine operation
     * we must protect it. We put the new ref into a local variable to prevent
     * further protection. */
    SYS_ARCH_PROTECT(old_level);
    /* all pbufs in a chain are referenced at least once */
    LWIP_ASSERT("pbuf_free: p->ref > 0", p->ref > 0);
  807f54:	c7 44 24 08 d2 38 81 	movl   $0x8138d2,0x8(%esp)
  807f5b:	00 
  807f5c:	c7 44 24 04 e8 01 00 	movl   $0x1e8,0x4(%esp)
  807f63:	00 
  807f64:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  807f6b:	e8 2c 8a ff ff       	call   80099c <_panic>
    ref = --(p->ref);
    SYS_ARCH_UNPROTECT(old_level);
    /* this pbuf is no longer referenced to? */
    if (ref == 0) {
      /* remember next pbuf in chain for next iteration */
      q = p->next;
  807f70:	8b 18                	mov    (%eax),%ebx
      LWIP_DEBUGF( PBUF_DEBUG | 2, ("pbuf_free: deallocating %p\n", (void *)p));
      type = p->type;
  807f72:	0f b6 50 0c          	movzbl 0xc(%eax),%edx
      /* is this a pbuf from the pool? */
      if (type == PBUF_POOL) {
  807f76:	66 83 fa 03          	cmp    $0x3,%dx
  807f7a:	75 12                	jne    807f8e <pbuf_free+0x91>
        memp_free(MEMP_PBUF_POOL, p);
  807f7c:	89 44 24 04          	mov    %eax,0x4(%esp)
  807f80:	c7 04 24 0d 00 00 00 	movl   $0xd,(%esp)
  807f87:	e8 e8 f7 ff ff       	call   807774 <memp_free>
  807f8c:	eb 23                	jmp    807fb1 <pbuf_free+0xb4>
      /* is this a ROM or RAM referencing pbuf? */
      } else if (type == PBUF_ROM || type == PBUF_REF) {
  807f8e:	83 ea 01             	sub    $0x1,%edx
  807f91:	66 83 fa 01          	cmp    $0x1,%dx
  807f95:	77 12                	ja     807fa9 <pbuf_free+0xac>
        memp_free(MEMP_PBUF, p);
  807f97:	89 44 24 04          	mov    %eax,0x4(%esp)
  807f9b:	c7 04 24 0c 00 00 00 	movl   $0xc,(%esp)
  807fa2:	e8 cd f7 ff ff       	call   807774 <memp_free>
  807fa7:	eb 08                	jmp    807fb1 <pbuf_free+0xb4>
      /* type == PBUF_RAM */
      } else {
        mem_free(p);
  807fa9:	89 04 24             	mov    %eax,(%esp)
  807fac:	e8 44 f5 ff ff       	call   8074f5 <mem_free>
      }
      count++;
  807fb1:	83 c6 01             	add    $0x1,%esi
    p->type == PBUF_REF || p->type == PBUF_POOL);

  count = 0;
  /* de-allocate all consecutive pbufs from the head of the chain that
   * obtain a zero reference count after decrementing*/
  while (p != NULL) {
  807fb4:	85 db                	test   %ebx,%ebx
  807fb6:	74 17                	je     807fcf <pbuf_free+0xd2>
  807fb8:	89 d8                	mov    %ebx,%eax
    /* Since decrementing ref cannot be guaranteed to be a single machine operation
     * we must protect it. We put the new ref into a local variable to prevent
     * further protection. */
    SYS_ARCH_PROTECT(old_level);
    /* all pbufs in a chain are referenced at least once */
    LWIP_ASSERT("pbuf_free: p->ref > 0", p->ref > 0);
  807fba:	0f b7 50 0e          	movzwl 0xe(%eax),%edx
  807fbe:	66 85 d2             	test   %dx,%dx
  807fc1:	74 91                	je     807f54 <pbuf_free+0x57>
    /* decrease reference count (number of pointers to pbuf) */
    ref = --(p->ref);
  807fc3:	83 ea 01             	sub    $0x1,%edx
  807fc6:	66 89 50 0e          	mov    %dx,0xe(%eax)
    SYS_ARCH_UNPROTECT(old_level);
    /* this pbuf is no longer referenced to? */
    if (ref == 0) {
  807fca:	66 85 d2             	test   %dx,%dx
  807fcd:	74 a1                	je     807f70 <pbuf_free+0x73>
    }
  }
  PERF_STOP("pbuf_free");
  /* return number of de-allocated pbufs */
  return count;
}
  807fcf:	89 f0                	mov    %esi,%eax
  807fd1:	83 c4 10             	add    $0x10,%esp
  807fd4:	5b                   	pop    %ebx
  807fd5:	5e                   	pop    %esi
  807fd6:	5d                   	pop    %ebp
  807fd7:	c3                   	ret    

00807fd8 <pbuf_dechain>:
 * @return remainder of the pbuf chain, or NULL if it was de-allocated.
 * @note May not be called on a packet queue.
 */
struct pbuf *
pbuf_dechain(struct pbuf *p)
{
  807fd8:	55                   	push   %ebp
  807fd9:	89 e5                	mov    %esp,%ebp
  807fdb:	83 ec 38             	sub    $0x38,%esp
  807fde:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  807fe1:	89 75 f8             	mov    %esi,-0x8(%ebp)
  807fe4:	89 7d fc             	mov    %edi,-0x4(%ebp)
  807fe7:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct pbuf *q;
  u8_t tail_gone = 1;
  /* tail */
  q = p->next;
  807fea:	8b 33                	mov    (%ebx),%esi
  /* pbuf has successor in chain? */
  if (q != NULL) {
  807fec:	b8 01 00 00 00       	mov    $0x1,%eax
  807ff1:	85 f6                	test   %esi,%esi
  807ff3:	74 55                	je     80804a <pbuf_dechain+0x72>
    /* assert tot_len invariant: (p->tot_len == p->len + (p->next? p->next->tot_len: 0) */
    LWIP_ASSERT("p->tot_len == p->len + q->tot_len", q->tot_len == p->tot_len - p->len);
  807ff5:	0f b7 53 08          	movzwl 0x8(%ebx),%edx
  807ff9:	0f b7 43 0a          	movzwl 0xa(%ebx),%eax
  807ffd:	0f b7 4e 08          	movzwl 0x8(%esi),%ecx
  808001:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
  808004:	0f b7 fa             	movzwl %dx,%edi
  808007:	0f b7 c8             	movzwl %ax,%ecx
  80800a:	29 cf                	sub    %ecx,%edi
  80800c:	39 7d e4             	cmp    %edi,-0x1c(%ebp)
  80800f:	74 1c                	je     80802d <pbuf_dechain+0x55>
  808011:	c7 44 24 08 a8 37 81 	movl   $0x8137a8,0x8(%esp)
  808018:	00 
  808019:	c7 44 24 04 80 02 00 	movl   $0x280,0x4(%esp)
  808020:	00 
  808021:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  808028:	e8 6f 89 ff ff       	call   80099c <_panic>
    /* enforce invariant if assertion is disabled */
    q->tot_len = p->tot_len - p->len;
  80802d:	66 29 c2             	sub    %ax,%dx
  808030:	66 89 56 08          	mov    %dx,0x8(%esi)
    /* decouple pbuf from remainder */
    p->next = NULL;
  808034:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
    /* total length of pbuf p is its own length only */
    p->tot_len = p->len;
  80803a:	0f b7 43 0a          	movzwl 0xa(%ebx),%eax
  80803e:	66 89 43 08          	mov    %ax,0x8(%ebx)
    /* q is no longer referenced by p, free it */
    LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_STATE, ("pbuf_dechain: unreferencing %p\n", (void *)q));
    tail_gone = pbuf_free(q);
  808042:	89 34 24             	mov    %esi,(%esp)
  808045:	e8 b3 fe ff ff       	call   807efd <pbuf_free>
                  ("pbuf_dechain: deallocated %p (as it is no longer referenced)\n", (void *)q));
    }
    /* return remaining tail or NULL if deallocated */
  }
  /* assert tot_len invariant: (p->tot_len == p->len + (p->next? p->next->tot_len: 0) */
  LWIP_ASSERT("p->tot_len == p->len", p->tot_len == p->len);
  80804a:	0f b7 53 08          	movzwl 0x8(%ebx),%edx
  80804e:	66 3b 53 0a          	cmp    0xa(%ebx),%dx
  808052:	74 1c                	je     808070 <pbuf_dechain+0x98>
  808054:	c7 44 24 08 e8 38 81 	movl   $0x8138e8,0x8(%esp)
  80805b:	00 
  80805c:	c7 44 24 04 91 02 00 	movl   $0x291,0x4(%esp)
  808063:	00 
  808064:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  80806b:	e8 2c 89 ff ff       	call   80099c <_panic>
  return ((tail_gone > 0) ? NULL : q);
  808070:	84 c0                	test   %al,%al
  808072:	b8 00 00 00 00       	mov    $0x0,%eax
  808077:	0f 45 f0             	cmovne %eax,%esi
}
  80807a:	89 f0                	mov    %esi,%eax
  80807c:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  80807f:	8b 75 f8             	mov    -0x8(%ebp),%esi
  808082:	8b 7d fc             	mov    -0x4(%ebp),%edi
  808085:	89 ec                	mov    %ebp,%esp
  808087:	5d                   	pop    %ebp
  808088:	c3                   	ret    

00808089 <pbuf_realloc>:
 *
 * @note Despite its name, pbuf_realloc cannot grow the size of a pbuf (chain).
 */
void
pbuf_realloc(struct pbuf *p, u16_t new_len)
{
  808089:	55                   	push   %ebp
  80808a:	89 e5                	mov    %esp,%ebp
  80808c:	56                   	push   %esi
  80808d:	53                   	push   %ebx
  80808e:	83 ec 10             	sub    $0x10,%esp
  808091:	8b 5d 08             	mov    0x8(%ebp),%ebx
  808094:	0f b7 75 0c          	movzwl 0xc(%ebp),%esi
  struct pbuf *q;
  u16_t rem_len; /* remaining length */
  s32_t grow;

  LWIP_ASSERT("pbuf_realloc: p != NULL", p != NULL);
  808098:	85 db                	test   %ebx,%ebx
  80809a:	75 1c                	jne    8080b8 <pbuf_realloc+0x2f>
  80809c:	c7 44 24 08 fd 38 81 	movl   $0x8138fd,0x8(%esp)
  8080a3:	00 
  8080a4:	c7 44 24 04 13 01 00 	movl   $0x113,0x4(%esp)
  8080ab:	00 
  8080ac:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  8080b3:	e8 e4 88 ff ff       	call   80099c <_panic>
  LWIP_ASSERT("pbuf_realloc: sane p->type", p->type == PBUF_POOL ||
  8080b8:	0f b6 43 0c          	movzbl 0xc(%ebx),%eax
  8080bc:	3c 03                	cmp    $0x3,%al
  8080be:	74 28                	je     8080e8 <pbuf_realloc+0x5f>
  8080c0:	3c 01                	cmp    $0x1,%al
  8080c2:	74 24                	je     8080e8 <pbuf_realloc+0x5f>
  8080c4:	84 c0                	test   %al,%al
  8080c6:	74 20                	je     8080e8 <pbuf_realloc+0x5f>
  8080c8:	3c 02                	cmp    $0x2,%al
  8080ca:	74 1c                	je     8080e8 <pbuf_realloc+0x5f>
  8080cc:	c7 44 24 08 15 39 81 	movl   $0x813915,0x8(%esp)
  8080d3:	00 
  8080d4:	c7 44 24 04 17 01 00 	movl   $0x117,0x4(%esp)
  8080db:	00 
  8080dc:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  8080e3:	e8 b4 88 ff ff       	call   80099c <_panic>
              p->type == PBUF_ROM ||
              p->type == PBUF_RAM ||
              p->type == PBUF_REF);

  /* desired length larger than current length? */
  if (new_len >= p->tot_len) {
  8080e8:	0f b7 43 08          	movzwl 0x8(%ebx),%eax
  8080ec:	66 39 f0             	cmp    %si,%ax
  8080ef:	0f 86 bd 00 00 00    	jbe    8081b2 <pbuf_realloc+0x129>
    return;
  }

  /* the pbuf chain grows by (new_len - p->tot_len) bytes
   * (which may be negative in case of shrinking) */
  grow = new_len - p->tot_len;
  8080f5:	0f b7 d6             	movzwl %si,%edx
  8080f8:	0f b7 c0             	movzwl %ax,%eax
  8080fb:	29 c2                	sub    %eax,%edx

  /* first, step over any pbufs that should remain in the chain */
  rem_len = new_len;
  q = p;
  /* should this pbuf be kept? */
  while (rem_len > q->len) {
  8080fd:	eb 4d                	jmp    80814c <pbuf_realloc+0xc3>
    /* decrease remaining length by pbuf length */
    rem_len -= q->len;
    /* decrease total length indicator */
    LWIP_ASSERT("grow < max_u16_t", grow < 0xffff);
  8080ff:	81 fa fe ff 00 00    	cmp    $0xfffe,%edx
  808105:	7e 1c                	jle    808123 <pbuf_realloc+0x9a>
  808107:	c7 44 24 08 30 39 81 	movl   $0x813930,0x8(%esp)
  80810e:	00 
  80810f:	c7 44 24 04 2b 01 00 	movl   $0x12b,0x4(%esp)
  808116:	00 
  808117:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  80811e:	e8 79 88 ff ff       	call   80099c <_panic>
    q->tot_len += (u16_t)grow;
  808123:	66 01 53 08          	add    %dx,0x8(%ebx)
    /* proceed to next pbuf in chain */
    q = q->next;
  808127:	8b 1b                	mov    (%ebx),%ebx
    LWIP_ASSERT("pbuf_realloc: q != NULL", q != NULL);
  808129:	85 db                	test   %ebx,%ebx
  80812b:	75 1c                	jne    808149 <pbuf_realloc+0xc0>
  80812d:	c7 44 24 08 41 39 81 	movl   $0x813941,0x8(%esp)
  808134:	00 
  808135:	c7 44 24 04 2f 01 00 	movl   $0x12f,0x4(%esp)
  80813c:	00 
  80813d:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  808144:	e8 53 88 ff ff       	call   80099c <_panic>
  rem_len = new_len;
  q = p;
  /* should this pbuf be kept? */
  while (rem_len > q->len) {
    /* decrease remaining length by pbuf length */
    rem_len -= q->len;
  808149:	66 29 c6             	sub    %ax,%si

  /* first, step over any pbufs that should remain in the chain */
  rem_len = new_len;
  q = p;
  /* should this pbuf be kept? */
  while (rem_len > q->len) {
  80814c:	0f b7 43 0a          	movzwl 0xa(%ebx),%eax
  808150:	66 39 c6             	cmp    %ax,%si
  808153:	77 aa                	ja     8080ff <pbuf_realloc+0x76>
  /* we have now reached the new last pbuf (in q) */
  /* rem_len == desired length for pbuf q */

  /* shrink allocated memory for PBUF_RAM */
  /* (other types merely adjust their length fields */
  if ((q->type == PBUF_RAM) && (rem_len != q->len)) {
  808155:	80 7b 0c 00          	cmpb   $0x0,0xc(%ebx)
  808159:	75 3b                	jne    808196 <pbuf_realloc+0x10d>
  80815b:	66 39 f0             	cmp    %si,%ax
  80815e:	74 36                	je     808196 <pbuf_realloc+0x10d>
    /* reallocate and adjust the length of the pbuf that will be split */
    q = mem_realloc(q, (u8_t *)q->payload - (u8_t *)q + rem_len);
  808160:	0f b7 c6             	movzwl %si,%eax
  808163:	03 43 04             	add    0x4(%ebx),%eax
  808166:	29 d8                	sub    %ebx,%eax
  808168:	89 44 24 04          	mov    %eax,0x4(%esp)
  80816c:	89 1c 24             	mov    %ebx,(%esp)
  80816f:	e8 17 f2 ff ff       	call   80738b <mem_realloc>
  808174:	89 c3                	mov    %eax,%ebx
    LWIP_ASSERT("mem_realloc give q == NULL", q != NULL);
  808176:	85 c0                	test   %eax,%eax
  808178:	75 1c                	jne    808196 <pbuf_realloc+0x10d>
  80817a:	c7 44 24 08 59 39 81 	movl   $0x813959,0x8(%esp)
  808181:	00 
  808182:	c7 44 24 04 39 01 00 	movl   $0x139,0x4(%esp)
  808189:	00 
  80818a:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  808191:	e8 06 88 ff ff       	call   80099c <_panic>
  }
  /* adjust length fields for new last pbuf */
  q->len = rem_len;
  808196:	66 89 73 0a          	mov    %si,0xa(%ebx)
  q->tot_len = q->len;
  80819a:	66 89 73 08          	mov    %si,0x8(%ebx)

  /* any remaining pbufs in chain? */
  if (q->next != NULL) {
  80819e:	8b 03                	mov    (%ebx),%eax
  8081a0:	85 c0                	test   %eax,%eax
  8081a2:	74 08                	je     8081ac <pbuf_realloc+0x123>
    /* free remaining pbufs in chain */
    pbuf_free(q->next);
  8081a4:	89 04 24             	mov    %eax,(%esp)
  8081a7:	e8 51 fd ff ff       	call   807efd <pbuf_free>
  }
  /* q is last packet in chain */
  q->next = NULL;
  8081ac:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)

}
  8081b2:	83 c4 10             	add    $0x10,%esp
  8081b5:	5b                   	pop    %ebx
  8081b6:	5e                   	pop    %esi
  8081b7:	5d                   	pop    %ebp
  8081b8:	c3                   	ret    

008081b9 <pbuf_alloc>:
 * @return the allocated pbuf. If multiple pbufs where allocated, this
 * is the first pbuf of a pbuf chain.
 */
struct pbuf *
pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
{
  8081b9:	55                   	push   %ebp
  8081ba:	89 e5                	mov    %esp,%ebp
  8081bc:	57                   	push   %edi
  8081bd:	56                   	push   %esi
  8081be:	53                   	push   %ebx
  8081bf:	83 ec 2c             	sub    $0x2c,%esp
  8081c2:	8b 45 08             	mov    0x8(%ebp),%eax
  8081c5:	8b 7d 10             	mov    0x10(%ebp),%edi
  8081c8:	0f b7 5d 0c          	movzwl 0xc(%ebp),%ebx
  s32_t rem_len; /* remaining length */
  LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE | 3, ("pbuf_alloc(length=%"U16_F")\n", length));

  /* determine header offset */
  offset = 0;
  switch (layer) {
  8081cc:	83 f8 01             	cmp    $0x1,%eax
  8081cf:	74 21                	je     8081f2 <pbuf_alloc+0x39>
  8081d1:	ba 14 00 00 00       	mov    $0x14,%edx
  8081d6:	83 f8 01             	cmp    $0x1,%eax
  8081d9:	72 1c                	jb     8081f7 <pbuf_alloc+0x3e>
  8081db:	83 f8 02             	cmp    $0x2,%eax
  8081de:	74 0a                	je     8081ea <pbuf_alloc+0x31>
  8081e0:	83 f8 03             	cmp    $0x3,%eax
  8081e3:	75 1e                	jne    808203 <pbuf_alloc+0x4a>
  8081e5:	8d 76 00             	lea    0x0(%esi),%esi
  8081e8:	eb 35                	jmp    80821f <pbuf_alloc+0x66>
  8081ea:	ba 00 00 00 00       	mov    $0x0,%edx
  8081ef:	90                   	nop
  8081f0:	eb 08                	jmp    8081fa <pbuf_alloc+0x41>
  8081f2:	ba 00 00 00 00       	mov    $0x0,%edx
    /* add room for transport (often TCP) layer header */
    offset += PBUF_TRANSPORT_HLEN;
    /* FALLTHROUGH */
  case PBUF_IP:
    /* add room for IP layer header */
    offset += PBUF_IP_HLEN;
  8081f7:	83 c2 14             	add    $0x14,%edx
    /* FALLTHROUGH */
  case PBUF_LINK:
    /* add room for link layer header */
    offset += PBUF_LINK_HLEN;
  8081fa:	83 c2 0e             	add    $0xe,%edx
  8081fd:	66 89 55 e4          	mov    %dx,-0x1c(%ebp)
    break;
  808201:	eb 22                	jmp    808225 <pbuf_alloc+0x6c>
  case PBUF_RAW:
    break;
  default:
    LWIP_ASSERT("pbuf_alloc: bad pbuf layer", 0);
  808203:	c7 44 24 08 74 39 81 	movl   $0x813974,0x8(%esp)
  80820a:	00 
  80820b:	c7 44 24 04 8a 00 00 	movl   $0x8a,0x4(%esp)
  808212:	00 
  808213:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  80821a:	e8 7d 87 ff ff       	call   80099c <_panic>
  80821f:	66 c7 45 e4 00 00    	movw   $0x0,-0x1c(%ebp)
    return NULL;
  }

  switch (type) {
  808225:	83 ff 02             	cmp    $0x2,%edi
  808228:	77 0e                	ja     808238 <pbuf_alloc+0x7f>
  80822a:	83 ff 01             	cmp    $0x1,%edi
  80822d:	0f 83 bf 01 00 00    	jae    8083f2 <pbuf_alloc+0x239>
  808233:	e9 78 01 00 00       	jmp    8083b0 <pbuf_alloc+0x1f7>
  808238:	83 ff 03             	cmp    $0x3,%edi
  80823b:	90                   	nop
  80823c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  808240:	0f 85 da 01 00 00    	jne    808420 <pbuf_alloc+0x267>
  case PBUF_POOL:
    /* allocate head of pbuf chain into p */
      p = memp_malloc(MEMP_PBUF_POOL);
  808246:	c7 04 24 0d 00 00 00 	movl   $0xd,(%esp)
  80824d:	8d 76 00             	lea    0x0(%esi),%esi
  808250:	e8 63 f5 ff ff       	call   8077b8 <memp_malloc>
  808255:	89 c6                	mov    %eax,%esi
    LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE | 3, ("pbuf_alloc: allocated pbuf %p\n", (void *)p));
    if (p == NULL) {
  808257:	85 c0                	test   %eax,%eax
  808259:	0f 84 e7 01 00 00    	je     808446 <pbuf_alloc+0x28d>
      return NULL;
    }
    p->type = type;
  80825f:	c6 40 0c 03          	movb   $0x3,0xc(%eax)
    p->next = NULL;
  808263:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    /* make the payload pointer point 'offset' bytes into pbuf data memory */
    p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + (SIZEOF_STRUCT_PBUF + offset)));
  808269:	0f b7 45 e4          	movzwl -0x1c(%ebp),%eax
  80826d:	8d 54 06 13          	lea    0x13(%esi,%eax,1),%edx
  808271:	83 e2 fc             	and    $0xfffffffc,%edx
  808274:	89 56 04             	mov    %edx,0x4(%esi)
    LWIP_ASSERT("pbuf_alloc: pbuf p->payload properly aligned",
            ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0);
    /* the total length of the pbuf chain is the requested size */
    p->tot_len = length;
  808277:	66 89 5e 08          	mov    %bx,0x8(%esi)
    /* set the length of the first pbuf in the chain */
    p->len = LWIP_MIN(length, PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset));
  80827b:	0f b7 db             	movzwl %bx,%ebx
  80827e:	83 c0 03             	add    $0x3,%eax
  808281:	89 c1                	mov    %eax,%ecx
  808283:	83 e1 fc             	and    $0xfffffffc,%ecx
  808286:	b8 d0 07 00 00       	mov    $0x7d0,%eax
  80828b:	29 c8                	sub    %ecx,%eax
  80828d:	39 d8                	cmp    %ebx,%eax
  80828f:	0f 4f c3             	cmovg  %ebx,%eax
  808292:	89 c1                	mov    %eax,%ecx
  808294:	66 89 46 0a          	mov    %ax,0xa(%esi)
    LWIP_ASSERT("check p->payload + p->len does not overflow pbuf",
  808298:	8d 86 e0 07 00 00    	lea    0x7e0(%esi),%eax
  80829e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8082a1:	0f b7 c1             	movzwl %cx,%eax
  8082a4:	01 c2                	add    %eax,%edx
  8082a6:	3b 55 e4             	cmp    -0x1c(%ebp),%edx
  8082a9:	76 1c                	jbe    8082c7 <pbuf_alloc+0x10e>
  8082ab:	c7 44 24 08 cc 37 81 	movl   $0x8137cc,0x8(%esp)
  8082b2:	00 
  8082b3:	c7 44 24 04 a3 00 00 	movl   $0xa3,0x4(%esp)
  8082ba:	00 
  8082bb:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  8082c2:	e8 d5 86 ff ff       	call   80099c <_panic>
                ((u8_t*)p->payload + p->len <=
                 (u8_t*)p + SIZEOF_STRUCT_PBUF + PBUF_POOL_BUFSIZE_ALIGNED));
    /* set reference count (needed here in case we fail) */
    p->ref = 1;
  8082c7:	66 c7 46 0e 01 00    	movw   $0x1,0xe(%esi)
    /* now allocate the tail of the pbuf chain */

    /* remember first pbuf for linkage in next iteration */
    r = p;
    /* remaining length to be allocated */
    rem_len = length - p->len;
  8082cd:	0f b7 c9             	movzwl %cx,%ecx
  8082d0:	29 cb                	sub    %ecx,%ebx
    /* any remaining pbufs to be allocated? */
    while (rem_len > 0) {
  8082d2:	85 db                	test   %ebx,%ebx
  8082d4:	0f 8e 62 01 00 00    	jle    80843c <pbuf_alloc+0x283>
  8082da:	89 f7                	mov    %esi,%edi
      q = memp_malloc(MEMP_PBUF_POOL);
  8082dc:	c7 04 24 0d 00 00 00 	movl   $0xd,(%esp)
  8082e3:	e8 d0 f4 ff ff       	call   8077b8 <memp_malloc>
      if (q == NULL) {
  8082e8:	85 c0                	test   %eax,%eax
  8082ea:	75 12                	jne    8082fe <pbuf_alloc+0x145>
        /* free chain so far allocated */
        pbuf_free(p);
  8082ec:	89 34 24             	mov    %esi,(%esp)
  8082ef:	e8 09 fc ff ff       	call   807efd <pbuf_free>
  8082f4:	be 00 00 00 00       	mov    $0x0,%esi
        /* bail out unsuccesfully */
        return NULL;
  8082f9:	e9 48 01 00 00       	jmp    808446 <pbuf_alloc+0x28d>
      }
      q->type = type;
  8082fe:	c6 40 0c 03          	movb   $0x3,0xc(%eax)
      q->flags = 0;
  808302:	c6 40 0d 00          	movb   $0x0,0xd(%eax)
      q->next = NULL;
  808306:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
      /* make previous pbuf point to this pbuf */
      r->next = q;
  80830c:	89 07                	mov    %eax,(%edi)
      /* set total length of this pbuf and next in chain */
      LWIP_ASSERT("rem_len < max_u16_t", rem_len < 0xffff);
  80830e:	81 fb fe ff 00 00    	cmp    $0xfffe,%ebx
  808314:	7e 1c                	jle    808332 <pbuf_alloc+0x179>
  808316:	c7 44 24 08 8f 39 81 	movl   $0x81398f,0x8(%esp)
  80831d:	00 
  80831e:	c7 44 24 04 bc 00 00 	movl   $0xbc,0x4(%esp)
  808325:	00 
  808326:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  80832d:	e8 6a 86 ff ff       	call   80099c <_panic>
      q->tot_len = (u16_t)rem_len;
  808332:	66 89 58 08          	mov    %bx,0x8(%eax)
      /* this pbuf length is pool size, unless smaller sized tail */
      q->len = LWIP_MIN((u16_t)rem_len, PBUF_POOL_BUFSIZE_ALIGNED);
  808336:	66 81 fb cf 07       	cmp    $0x7cf,%bx
  80833b:	b9 d0 07 00 00       	mov    $0x7d0,%ecx
  808340:	0f 46 cb             	cmovbe %ebx,%ecx
  808343:	66 89 48 0a          	mov    %cx,0xa(%eax)
      q->payload = (void *)((u8_t *)q + SIZEOF_STRUCT_PBUF);
  808347:	8d 50 10             	lea    0x10(%eax),%edx
  80834a:	89 50 04             	mov    %edx,0x4(%eax)
      LWIP_ASSERT("pbuf_alloc: pbuf q->payload properly aligned",
  80834d:	f6 c2 03             	test   $0x3,%dl
  808350:	74 1c                	je     80836e <pbuf_alloc+0x1b5>
  808352:	c7 44 24 08 00 38 81 	movl   $0x813800,0x8(%esp)
  808359:	00 
  80835a:	c7 44 24 04 c2 00 00 	movl   $0xc2,0x4(%esp)
  808361:	00 
  808362:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  808369:	e8 2e 86 ff ff       	call   80099c <_panic>
              ((mem_ptr_t)q->payload % MEM_ALIGNMENT) == 0);
      LWIP_ASSERT("check p->payload + p->len does not overflow pbuf",
  80836e:	0f b7 56 0a          	movzwl 0xa(%esi),%edx
  808372:	03 56 04             	add    0x4(%esi),%edx
  808375:	39 55 e4             	cmp    %edx,-0x1c(%ebp)
  808378:	73 1c                	jae    808396 <pbuf_alloc+0x1dd>
  80837a:	c7 44 24 08 cc 37 81 	movl   $0x8137cc,0x8(%esp)
  808381:	00 
  808382:	c7 44 24 04 c5 00 00 	movl   $0xc5,0x4(%esp)
  808389:	00 
  80838a:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  808391:	e8 06 86 ff ff       	call   80099c <_panic>
                  ((u8_t*)p->payload + p->len <=
                   (u8_t*)p + SIZEOF_STRUCT_PBUF + PBUF_POOL_BUFSIZE_ALIGNED));
      q->ref = 1;
  808396:	66 c7 40 0e 01 00    	movw   $0x1,0xe(%eax)
      /* calculate remaining length to be allocated */
      rem_len -= q->len;
  80839c:	0f b7 c9             	movzwl %cx,%ecx
  80839f:	29 cb                	sub    %ecx,%ebx
    /* remember first pbuf for linkage in next iteration */
    r = p;
    /* remaining length to be allocated */
    rem_len = length - p->len;
    /* any remaining pbufs to be allocated? */
    while (rem_len > 0) {
  8083a1:	85 db                	test   %ebx,%ebx
  8083a3:	0f 8e 93 00 00 00    	jle    80843c <pbuf_alloc+0x283>
  8083a9:	89 c7                	mov    %eax,%edi
  8083ab:	e9 2c ff ff ff       	jmp    8082dc <pbuf_alloc+0x123>
    /*r->next = NULL;*/

    break;
  case PBUF_RAM:
    /* If pbuf is to be allocated in RAM, allocate memory for it. */
    p = (struct pbuf*)mem_malloc(LWIP_MEM_ALIGN_SIZE(SIZEOF_STRUCT_PBUF + offset) + LWIP_MEM_ALIGN_SIZE(length));
  8083b0:	0f b7 7d e4          	movzwl -0x1c(%ebp),%edi
  8083b4:	8d 57 13             	lea    0x13(%edi),%edx
  8083b7:	83 e2 fc             	and    $0xfffffffc,%edx
  8083ba:	0f b7 c3             	movzwl %bx,%eax
  8083bd:	83 c0 03             	add    $0x3,%eax
  8083c0:	83 e0 fc             	and    $0xfffffffc,%eax
  8083c3:	8d 04 02             	lea    (%edx,%eax,1),%eax
  8083c6:	89 04 24             	mov    %eax,(%esp)
  8083c9:	e8 92 ed ff ff       	call   807160 <mem_malloc>
  8083ce:	89 c6                	mov    %eax,%esi
    if (p == NULL) {
  8083d0:	85 c0                	test   %eax,%eax
  8083d2:	74 72                	je     808446 <pbuf_alloc+0x28d>
      return NULL;
    }
    /* Set up internal structure of the pbuf. */
    p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + SIZEOF_STRUCT_PBUF + offset));
  8083d4:	8d 44 38 13          	lea    0x13(%eax,%edi,1),%eax
  8083d8:	83 e0 fc             	and    $0xfffffffc,%eax
  8083db:	89 46 04             	mov    %eax,0x4(%esi)
    p->len = p->tot_len = length;
  8083de:	66 89 5e 08          	mov    %bx,0x8(%esi)
  8083e2:	66 89 5e 0a          	mov    %bx,0xa(%esi)
    p->next = NULL;
  8083e6:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
    p->type = type;
  8083ec:	c6 46 0c 00          	movb   $0x0,0xc(%esi)
  8083f0:	eb 4a                	jmp    80843c <pbuf_alloc+0x283>
  /* pbuf references existing (non-volatile static constant) ROM payload? */
  case PBUF_ROM:
  /* pbuf references existing (externally allocated) RAM payload? */
  case PBUF_REF:
    /* only allocate memory for the pbuf structure */
    p = memp_malloc(MEMP_PBUF);
  8083f2:	c7 04 24 0c 00 00 00 	movl   $0xc,(%esp)
  8083f9:	e8 ba f3 ff ff       	call   8077b8 <memp_malloc>
  8083fe:	89 c6                	mov    %eax,%esi
    if (p == NULL) {
  808400:	85 c0                	test   %eax,%eax
  808402:	74 42                	je     808446 <pbuf_alloc+0x28d>
      LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE | 2, ("pbuf_alloc: Could not allocate MEMP_PBUF for PBUF_%s.\n",
                  (type == PBUF_ROM) ? "ROM" : "REF"));
      return NULL;
    }
    /* caller must set this field properly, afterwards */
    p->payload = NULL;
  808404:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
    p->len = p->tot_len = length;
  80840b:	66 89 58 08          	mov    %bx,0x8(%eax)
  80840f:	66 89 58 0a          	mov    %bx,0xa(%eax)
    p->next = NULL;
  808413:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
    p->type = type;
  808419:	89 f8                	mov    %edi,%eax
  80841b:	88 46 0c             	mov    %al,0xc(%esi)
    break;
  80841e:	eb 1c                	jmp    80843c <pbuf_alloc+0x283>
  default:
    LWIP_ASSERT("pbuf_alloc: erroneous type", 0);
  808420:	c7 44 24 08 a3 39 81 	movl   $0x8139a3,0x8(%esp)
  808427:	00 
  808428:	c7 44 24 04 f1 00 00 	movl   $0xf1,0x4(%esp)
  80842f:	00 
  808430:	c7 04 24 2d 38 81 00 	movl   $0x81382d,(%esp)
  808437:	e8 60 85 ff ff       	call   80099c <_panic>
    return NULL;
  }
  /* set reference count */
  p->ref = 1;
  80843c:	66 c7 46 0e 01 00    	movw   $0x1,0xe(%esi)
  /* set flags */
  p->flags = 0;
  808442:	c6 46 0d 00          	movb   $0x0,0xd(%esi)
  LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE | 3, ("pbuf_alloc(length=%"U16_F") == %p\n", length, (void *)p));
  return p;
}
  808446:	89 f0                	mov    %esi,%eax
  808448:	83 c4 2c             	add    $0x2c,%esp
  80844b:	5b                   	pop    %ebx
  80844c:	5e                   	pop    %esi
  80844d:	5f                   	pop    %edi
  80844e:	5d                   	pop    %ebp
  80844f:	c3                   	ret    

00808450 <sswt_handler>:
 *
 * @param arg struct sswt_cb* used to signal a semaphore and end waiting.
 */
static void
sswt_handler(void *arg)
{
  808450:	55                   	push   %ebp
  808451:	89 e5                	mov    %esp,%ebp
  808453:	83 ec 18             	sub    $0x18,%esp
  808456:	8b 45 08             	mov    0x8(%ebp),%eax
  struct sswt_cb *sswt_cb = (struct sswt_cb *) arg;

  /* Timeout. Set flag to TRUE and signal semaphore */
  sswt_cb->timeflag = 1;
  808459:	66 c7 00 01 00       	movw   $0x1,(%eax)
  sys_sem_signal(*(sswt_cb->psem));
  80845e:	8b 40 04             	mov    0x4(%eax),%eax
  808461:	8b 00                	mov    (%eax),%eax
  808463:	89 04 24             	mov    %eax,(%esp)
  808466:	e8 7c 57 00 00       	call   80dbe7 <sys_sem_signal>
}
  80846b:	c9                   	leave  
  80846c:	c3                   	ret    

0080846d <sys_untimeout>:
 * @param h callback function that would be called by the timeout
 * @param arg callback argument that would be passed to h
*/
void
sys_untimeout(sys_timeout_handler h, void *arg)
{
  80846d:	55                   	push   %ebp
  80846e:	89 e5                	mov    %esp,%ebp
  808470:	57                   	push   %edi
  808471:	56                   	push   %esi
  808472:	53                   	push   %ebx
  808473:	83 ec 1c             	sub    $0x1c,%esp
  808476:	8b 5d 08             	mov    0x8(%ebp),%ebx
  808479:	8b 75 0c             	mov    0xc(%ebp),%esi
  struct sys_timeouts *timeouts;
  struct sys_timeo *prev_t, *t;

  timeouts = sys_arch_timeouts();
  80847c:	e8 3a 52 00 00       	call   80d6bb <sys_arch_timeouts>

  if (timeouts == NULL) {
  808481:	85 c0                	test   %eax,%eax
  808483:	75 1c                	jne    8084a1 <sys_untimeout+0x34>
    LWIP_ASSERT("sys_untimeout: timeouts != NULL", timeouts != NULL);
  808485:	c7 44 24 08 c0 39 81 	movl   $0x8139c0,0x8(%esp)
  80848c:	00 
  80848d:	c7 44 24 04 00 01 00 	movl   $0x100,0x4(%esp)
  808494:	00 
  808495:	c7 04 24 e0 39 81 00 	movl   $0x8139e0,(%esp)
  80849c:	e8 fb 84 ff ff       	call   80099c <_panic>
    return;
  }
  if (timeouts->next == NULL) {
  8084a1:	8b 10                	mov    (%eax),%edx
  8084a3:	85 d2                	test   %edx,%edx
  8084a5:	74 4b                	je     8084f2 <sys_untimeout+0x85>
  8084a7:	bf 00 00 00 00       	mov    $0x0,%edi
    return;
  }

  for (t = timeouts->next, prev_t = NULL; t != NULL; prev_t = t, t = t->next) {
    if ((t->h == h) && (t->arg == arg)) {
  8084ac:	39 5a 08             	cmp    %ebx,0x8(%edx)
  8084af:	75 33                	jne    8084e4 <sys_untimeout+0x77>
  8084b1:	39 72 0c             	cmp    %esi,0xc(%edx)
  8084b4:	75 2e                	jne    8084e4 <sys_untimeout+0x77>
      /* We have a match */
      /* Unlink from previous in list */
      if (prev_t == NULL)
  8084b6:	85 ff                	test   %edi,%edi
  8084b8:	75 08                	jne    8084c2 <sys_untimeout+0x55>
        timeouts->next = t->next;
  8084ba:	8b 0a                	mov    (%edx),%ecx
  8084bc:	89 08                	mov    %ecx,(%eax)
  8084be:	66 90                	xchg   %ax,%ax
  8084c0:	eb 04                	jmp    8084c6 <sys_untimeout+0x59>
      else
        prev_t->next = t->next;
  8084c2:	8b 02                	mov    (%edx),%eax
  8084c4:	89 07                	mov    %eax,(%edi)
      /* If not the last one, add time of this one back to next */
      if (t->next != NULL)
  8084c6:	8b 02                	mov    (%edx),%eax
  8084c8:	85 c0                	test   %eax,%eax
  8084ca:	74 06                	je     8084d2 <sys_untimeout+0x65>
        t->next->time += t->time;
  8084cc:	8b 4a 04             	mov    0x4(%edx),%ecx
  8084cf:	01 48 04             	add    %ecx,0x4(%eax)
      memp_free(MEMP_SYS_TIMEOUT, t);
  8084d2:	89 54 24 04          	mov    %edx,0x4(%esp)
  8084d6:	c7 04 24 0b 00 00 00 	movl   $0xb,(%esp)
  8084dd:	e8 92 f2 ff ff       	call   807774 <memp_free>
      return;
  8084e2:	eb 0e                	jmp    8084f2 <sys_untimeout+0x85>
  }
  if (timeouts->next == NULL) {
    return;
  }

  for (t = timeouts->next, prev_t = NULL; t != NULL; prev_t = t, t = t->next) {
  8084e4:	8b 0a                	mov    (%edx),%ecx
  8084e6:	85 c9                	test   %ecx,%ecx
  8084e8:	74 08                	je     8084f2 <sys_untimeout+0x85>
  8084ea:	89 d7                	mov    %edx,%edi
  8084ec:	89 ca                	mov    %ecx,%edx
  8084ee:	66 90                	xchg   %ax,%ax
  8084f0:	eb ba                	jmp    8084ac <sys_untimeout+0x3f>
      memp_free(MEMP_SYS_TIMEOUT, t);
      return;
    }
  }
  return;
}
  8084f2:	83 c4 1c             	add    $0x1c,%esp
  8084f5:	5b                   	pop    %ebx
  8084f6:	5e                   	pop    %esi
  8084f7:	5f                   	pop    %edi
  8084f8:	5d                   	pop    %ebp
  8084f9:	c3                   	ret    

008084fa <sys_timeout>:
 * @param h callback function to call when msecs have elapsed
 * @param arg argument to pass to the callback function
 */
void
sys_timeout(u32_t msecs, sys_timeout_handler h, void *arg)
{
  8084fa:	55                   	push   %ebp
  8084fb:	89 e5                	mov    %esp,%ebp
  8084fd:	56                   	push   %esi
  8084fe:	53                   	push   %ebx
  8084ff:	83 ec 10             	sub    $0x10,%esp
  808502:	8b 75 08             	mov    0x8(%ebp),%esi
  struct sys_timeouts *timeouts;
  struct sys_timeo *timeout, *t;

  timeout = memp_malloc(MEMP_SYS_TIMEOUT);
  808505:	c7 04 24 0b 00 00 00 	movl   $0xb,(%esp)
  80850c:	e8 a7 f2 ff ff       	call   8077b8 <memp_malloc>
  808511:	89 c3                	mov    %eax,%ebx
  if (timeout == NULL) {
  808513:	85 c0                	test   %eax,%eax
  808515:	75 1c                	jne    808533 <sys_timeout+0x39>
    LWIP_ASSERT("sys_timeout: timeout != NULL", timeout != NULL);
  808517:	c7 44 24 08 f4 39 81 	movl   $0x8139f4,0x8(%esp)
  80851e:	00 
  80851f:	c7 44 24 04 c3 00 00 	movl   $0xc3,0x4(%esp)
  808526:	00 
  808527:	c7 04 24 e0 39 81 00 	movl   $0x8139e0,(%esp)
  80852e:	e8 69 84 ff ff       	call   80099c <_panic>
    return;
  }
  timeout->next = NULL;
  808533:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
  timeout->h = h;
  808539:	8b 45 0c             	mov    0xc(%ebp),%eax
  80853c:	89 43 08             	mov    %eax,0x8(%ebx)
  timeout->arg = arg;
  80853f:	8b 45 10             	mov    0x10(%ebp),%eax
  808542:	89 43 0c             	mov    %eax,0xc(%ebx)
  timeout->time = msecs;
  808545:	89 73 04             	mov    %esi,0x4(%ebx)

  timeouts = sys_arch_timeouts();
  808548:	e8 6e 51 00 00       	call   80d6bb <sys_arch_timeouts>

  LWIP_DEBUGF(SYS_DEBUG, ("sys_timeout: %p msecs=%"U32_F" h=%p arg=%p\n",
    (void *)timeout, msecs, (void*)&h, (void *)arg));

  if (timeouts == NULL) {
  80854d:	85 c0                	test   %eax,%eax
  80854f:	75 1c                	jne    80856d <sys_timeout+0x73>
    LWIP_ASSERT("sys_timeout: timeouts != NULL", timeouts != NULL);
  808551:	c7 44 24 08 11 3a 81 	movl   $0x813a11,0x8(%esp)
  808558:	00 
  808559:	c7 44 24 04 d1 00 00 	movl   $0xd1,0x4(%esp)
  808560:	00 
  808561:	c7 04 24 e0 39 81 00 	movl   $0x8139e0,(%esp)
  808568:	e8 2f 84 ff ff       	call   80099c <_panic>
    return;
  }

  if (timeouts->next == NULL) {
  80856d:	8b 10                	mov    (%eax),%edx
  80856f:	85 d2                	test   %edx,%edx
  808571:	75 04                	jne    808577 <sys_timeout+0x7d>
    timeouts->next = timeout;
  808573:	89 18                	mov    %ebx,(%eax)
    return;
  808575:	eb 4c                	jmp    8085c3 <sys_timeout+0xc9>
  }

  if (timeouts->next->time > msecs) {
  808577:	8b 4a 04             	mov    0x4(%edx),%ecx
  80857a:	39 ce                	cmp    %ecx,%esi
  80857c:	73 2d                	jae    8085ab <sys_timeout+0xb1>
    timeouts->next->time -= msecs;
  80857e:	29 f1                	sub    %esi,%ecx
  808580:	89 4a 04             	mov    %ecx,0x4(%edx)
    timeout->next = timeouts->next;
  808583:	8b 10                	mov    (%eax),%edx
  808585:	89 13                	mov    %edx,(%ebx)
    timeouts->next = timeout;
  808587:	89 18                	mov    %ebx,(%eax)
  808589:	eb 38                	jmp    8085c3 <sys_timeout+0xc9>
  80858b:	89 c2                	mov    %eax,%edx
  } else {
    for(t = timeouts->next; t != NULL; t = t->next) {
      timeout->time -= t->time;
  80858d:	8b 73 04             	mov    0x4(%ebx),%esi
  808590:	2b 70 04             	sub    0x4(%eax),%esi
  808593:	89 73 04             	mov    %esi,0x4(%ebx)
      if (t->next == NULL || t->next->time > timeout->time) {
  808596:	8b 00                	mov    (%eax),%eax
  808598:	85 c0                	test   %eax,%eax
  80859a:	74 07                	je     8085a3 <sys_timeout+0xa9>
  80859c:	3b 70 04             	cmp    0x4(%eax),%esi
  80859f:	73 ea                	jae    80858b <sys_timeout+0x91>
  8085a1:	eb 1b                	jmp    8085be <sys_timeout+0xc4>
        if (t->next != NULL) {
          t->next->time -= timeout->time;
        }
        timeout->next = t->next;
  8085a3:	8b 02                	mov    (%edx),%eax
  8085a5:	89 03                	mov    %eax,(%ebx)
        t->next = timeout;
  8085a7:	89 1a                	mov    %ebx,(%edx)
  8085a9:	eb 18                	jmp    8085c3 <sys_timeout+0xc9>
    timeouts->next->time -= msecs;
    timeout->next = timeouts->next;
    timeouts->next = timeout;
  } else {
    for(t = timeouts->next; t != NULL; t = t->next) {
      timeout->time -= t->time;
  8085ab:	8b 73 04             	mov    0x4(%ebx),%esi
  8085ae:	29 ce                	sub    %ecx,%esi
  8085b0:	89 73 04             	mov    %esi,0x4(%ebx)
      if (t->next == NULL || t->next->time > timeout->time) {
  8085b3:	8b 02                	mov    (%edx),%eax
  8085b5:	85 c0                	test   %eax,%eax
  8085b7:	74 ea                	je     8085a3 <sys_timeout+0xa9>
  8085b9:	3b 70 04             	cmp    0x4(%eax),%esi
  8085bc:	73 cd                	jae    80858b <sys_timeout+0x91>
        if (t->next != NULL) {
          t->next->time -= timeout->time;
  8085be:	29 70 04             	sub    %esi,0x4(%eax)
  8085c1:	eb e0                	jmp    8085a3 <sys_timeout+0xa9>
        t->next = timeout;
        break;
      }
    }
  }
}
  8085c3:	83 c4 10             	add    $0x10,%esp
  8085c6:	5b                   	pop    %ebx
  8085c7:	5e                   	pop    %esi
  8085c8:	5d                   	pop    %ebp
  8085c9:	c3                   	ret    

008085ca <sys_sem_wait>:
 *
 * @param sem semaphore to wait for
 */
void
sys_sem_wait(sys_sem_t sem)
{
  8085ca:	55                   	push   %ebp
  8085cb:	89 e5                	mov    %esp,%ebp
  8085cd:	57                   	push   %edi
  8085ce:	56                   	push   %esi
  8085cf:	53                   	push   %ebx
  8085d0:	83 ec 1c             	sub    $0x1c,%esp
  8085d3:	8b 7d 08             	mov    0x8(%ebp),%edi
  sys_timeout_handler h;
  void *arg;

 again:

  timeouts = sys_arch_timeouts();
  8085d6:	e8 e0 50 00 00       	call   80d6bb <sys_arch_timeouts>
  8085db:	89 c3                	mov    %eax,%ebx

  if (!timeouts || !timeouts->next) {
  8085dd:	85 c0                	test   %eax,%eax
  8085df:	74 06                	je     8085e7 <sys_sem_wait+0x1d>
  8085e1:	8b 00                	mov    (%eax),%eax
  8085e3:	85 c0                	test   %eax,%eax
  8085e5:	75 12                	jne    8085f9 <sys_sem_wait+0x2f>
    sys_arch_sem_wait(sem, 0);
  8085e7:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  8085ee:	00 
  8085ef:	89 3c 24             	mov    %edi,(%esp)
  8085f2:	e8 ff 52 00 00       	call   80d8f6 <sys_arch_sem_wait>

 again:

  timeouts = sys_arch_timeouts();

  if (!timeouts || !timeouts->next) {
  8085f7:	eb 58                	jmp    808651 <sys_sem_wait+0x87>
    sys_arch_sem_wait(sem, 0);
  } else {
    if (timeouts->next->time > 0) {
  8085f9:	8b 40 04             	mov    0x4(%eax),%eax
  8085fc:	85 c0                	test   %eax,%eax
  8085fe:	74 11                	je     808611 <sys_sem_wait+0x47>
      time_needed = sys_arch_sem_wait(sem, timeouts->next->time);
  808600:	89 44 24 04          	mov    %eax,0x4(%esp)
  808604:	89 3c 24             	mov    %edi,(%esp)
  808607:	e8 ea 52 00 00       	call   80d8f6 <sys_arch_sem_wait>
    } else {
      time_needed = SYS_ARCH_TIMEOUT;
    }

    if (time_needed == SYS_ARCH_TIMEOUT) {
  80860c:	83 f8 ff             	cmp    $0xffffffff,%eax
  80860f:	75 29                	jne    80863a <sys_sem_wait+0x70>
      /* If time == SYS_ARCH_TIMEOUT, a timeout occured before a message
        could be fetched. We should now call the timeout handler and
        deallocate the memory allocated for the timeout. */
      tmptimeout = timeouts->next;
  808611:	8b 03                	mov    (%ebx),%eax
      timeouts->next = tmptimeout->next;
  808613:	8b 10                	mov    (%eax),%edx
  808615:	89 13                	mov    %edx,(%ebx)
      h = tmptimeout->h;
  808617:	8b 58 08             	mov    0x8(%eax),%ebx
      arg = tmptimeout->arg;
  80861a:	8b 70 0c             	mov    0xc(%eax),%esi
      memp_free(MEMP_SYS_TIMEOUT, tmptimeout);
  80861d:	89 44 24 04          	mov    %eax,0x4(%esp)
  808621:	c7 04 24 0b 00 00 00 	movl   $0xb,(%esp)
  808628:	e8 47 f1 ff ff       	call   807774 <memp_free>
      if (h != NULL) {
  80862d:	85 db                	test   %ebx,%ebx
  80862f:	74 a5                	je     8085d6 <sys_sem_wait+0xc>
        LWIP_DEBUGF(SYS_DEBUG, ("ssw h=%p(%p)\n", (void*)&h, (void *)arg));
        h(arg);
  808631:	89 34 24             	mov    %esi,(%esp)
  808634:	ff d3                	call   *%ebx
  808636:	66 90                	xchg   %ax,%ax
  808638:	eb 9c                	jmp    8085d6 <sys_sem_wait+0xc>
      goto again;
    } else {
      /* If time != SYS_ARCH_TIMEOUT, a message was received before the timeout
         occured. The time variable is set to the number of
         milliseconds we waited for the message. */
      if (time_needed < timeouts->next->time) {
  80863a:	8b 13                	mov    (%ebx),%edx
  80863c:	8b 4a 04             	mov    0x4(%edx),%ecx
  80863f:	39 c8                	cmp    %ecx,%eax
  808641:	73 07                	jae    80864a <sys_sem_wait+0x80>
        timeouts->next->time -= time_needed;
  808643:	29 c1                	sub    %eax,%ecx
  808645:	89 4a 04             	mov    %ecx,0x4(%edx)
  808648:	eb 07                	jmp    808651 <sys_sem_wait+0x87>
      } else {
        timeouts->next->time = 0;
  80864a:	c7 42 04 00 00 00 00 	movl   $0x0,0x4(%edx)
      }
    }
  }
}
  808651:	83 c4 1c             	add    $0x1c,%esp
  808654:	5b                   	pop    %ebx
  808655:	5e                   	pop    %esi
  808656:	5f                   	pop    %edi
  808657:	5d                   	pop    %ebp
  808658:	c3                   	ret    

00808659 <sys_sem_wait_timeout>:
 * @param timeout timeout in ms (0: wait forever)
 * @return 0 on timeout, 1 otherwise
 */
int
sys_sem_wait_timeout(sys_sem_t sem, u32_t timeout)
{
  808659:	55                   	push   %ebp
  80865a:	89 e5                	mov    %esp,%ebp
  80865c:	83 ec 28             	sub    $0x28,%esp
  80865f:	8b 45 0c             	mov    0xc(%ebp),%eax
  struct sswt_cb sswt_cb;

  sswt_cb.psem = &sem;
  808662:	8d 55 08             	lea    0x8(%ebp),%edx
  808665:	89 55 f4             	mov    %edx,-0xc(%ebp)
  sswt_cb.timeflag = 0;
  808668:	66 c7 45 f0 00 00    	movw   $0x0,-0x10(%ebp)

  /* If timeout is zero, then just wait forever */
  if (timeout > 0) {
  80866e:	85 c0                	test   %eax,%eax
  808670:	74 17                	je     808689 <sys_sem_wait_timeout+0x30>
    /* Create a timer and pass it the address of our flag */
    sys_timeout(timeout, sswt_handler, &sswt_cb);
  808672:	8d 55 f0             	lea    -0x10(%ebp),%edx
  808675:	89 54 24 08          	mov    %edx,0x8(%esp)
  808679:	c7 44 24 04 50 84 80 	movl   $0x808450,0x4(%esp)
  808680:	00 
  808681:	89 04 24             	mov    %eax,(%esp)
  808684:	e8 71 fe ff ff       	call   8084fa <sys_timeout>
  }
  sys_sem_wait(sem);
  808689:	8b 45 08             	mov    0x8(%ebp),%eax
  80868c:	89 04 24             	mov    %eax,(%esp)
  80868f:	e8 36 ff ff ff       	call   8085ca <sys_sem_wait>
  /* Was it a timeout? */
  if (sswt_cb.timeflag) {
  808694:	b8 00 00 00 00       	mov    $0x0,%eax
  808699:	66 83 7d f0 00       	cmpw   $0x0,-0x10(%ebp)
  80869e:	75 18                	jne    8086b8 <sys_sem_wait_timeout+0x5f>
    /* timeout */
    return 0;
  } else {
    /* Not a timeout. Remove timeout entry */
    sys_untimeout(sswt_handler, &sswt_cb);
  8086a0:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8086a3:	89 44 24 04          	mov    %eax,0x4(%esp)
  8086a7:	c7 04 24 50 84 80 00 	movl   $0x808450,(%esp)
  8086ae:	e8 ba fd ff ff       	call   80846d <sys_untimeout>
  8086b3:	b8 01 00 00 00       	mov    $0x1,%eax
    return 1;
  }
}
  8086b8:	c9                   	leave  
  8086b9:	c3                   	ret    

008086ba <sys_msleep>:
 *
 * @param ms number of milliseconds to sleep
 */
void
sys_msleep(u32_t ms)
{
  8086ba:	55                   	push   %ebp
  8086bb:	89 e5                	mov    %esp,%ebp
  8086bd:	53                   	push   %ebx
  8086be:	83 ec 14             	sub    $0x14,%esp
  sys_sem_t delaysem = sys_sem_new(0);
  8086c1:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  8086c8:	e8 78 53 00 00       	call   80da45 <sys_sem_new>
  8086cd:	89 c3                	mov    %eax,%ebx

  sys_sem_wait_timeout(delaysem, ms);
  8086cf:	8b 45 08             	mov    0x8(%ebp),%eax
  8086d2:	89 44 24 04          	mov    %eax,0x4(%esp)
  8086d6:	89 1c 24             	mov    %ebx,(%esp)
  8086d9:	e8 7b ff ff ff       	call   808659 <sys_sem_wait_timeout>

  sys_sem_free(delaysem);
  8086de:	89 1c 24             	mov    %ebx,(%esp)
  8086e1:	e8 9d 4e 00 00       	call   80d583 <sys_sem_free>
}
  8086e6:	83 c4 14             	add    $0x14,%esp
  8086e9:	5b                   	pop    %ebx
  8086ea:	5d                   	pop    %ebp
  8086eb:	c3                   	ret    

008086ec <sys_mbox_fetch>:
 * @param mbox the mbox to fetch the message from
 * @param msg the place to store the message
 */
void
sys_mbox_fetch(sys_mbox_t mbox, void **msg)
{
  8086ec:	55                   	push   %ebp
  8086ed:	89 e5                	mov    %esp,%ebp
  8086ef:	57                   	push   %edi
  8086f0:	56                   	push   %esi
  8086f1:	53                   	push   %ebx
  8086f2:	83 ec 1c             	sub    $0x1c,%esp
  8086f5:	8b 7d 0c             	mov    0xc(%ebp),%edi
  struct sys_timeo *tmptimeout;
  sys_timeout_handler h;
  void *arg;

 again:
  timeouts = sys_arch_timeouts();
  8086f8:	e8 be 4f 00 00       	call   80d6bb <sys_arch_timeouts>
  8086fd:	89 c3                	mov    %eax,%ebx

  if (!timeouts || !timeouts->next) {
  8086ff:	85 c0                	test   %eax,%eax
  808701:	74 06                	je     808709 <sys_mbox_fetch+0x1d>
  808703:	8b 00                	mov    (%eax),%eax
  808705:	85 c0                	test   %eax,%eax
  808707:	75 19                	jne    808722 <sys_mbox_fetch+0x36>
    UNLOCK_TCPIP_CORE();
    time_needed = sys_arch_mbox_fetch(mbox, msg, 0);
  808709:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  808710:	00 
  808711:	89 7c 24 04          	mov    %edi,0x4(%esp)
  808715:	8b 45 08             	mov    0x8(%ebp),%eax
  808718:	89 04 24             	mov    %eax,(%esp)
  80871b:	e8 53 55 00 00       	call   80dc73 <sys_arch_mbox_fetch>
  void *arg;

 again:
  timeouts = sys_arch_timeouts();

  if (!timeouts || !timeouts->next) {
  808720:	eb 5f                	jmp    808781 <sys_mbox_fetch+0x95>
    UNLOCK_TCPIP_CORE();
    time_needed = sys_arch_mbox_fetch(mbox, msg, 0);
    LOCK_TCPIP_CORE();
  } else {
    if (timeouts->next->time > 0) {
  808722:	8b 40 04             	mov    0x4(%eax),%eax
  808725:	85 c0                	test   %eax,%eax
  808727:	74 18                	je     808741 <sys_mbox_fetch+0x55>
      UNLOCK_TCPIP_CORE();
      time_needed = sys_arch_mbox_fetch(mbox, msg, timeouts->next->time);
  808729:	89 44 24 08          	mov    %eax,0x8(%esp)
  80872d:	89 7c 24 04          	mov    %edi,0x4(%esp)
  808731:	8b 45 08             	mov    0x8(%ebp),%eax
  808734:	89 04 24             	mov    %eax,(%esp)
  808737:	e8 37 55 00 00       	call   80dc73 <sys_arch_mbox_fetch>
      LOCK_TCPIP_CORE();
    } else {
      time_needed = SYS_ARCH_TIMEOUT;
    }

    if (time_needed == SYS_ARCH_TIMEOUT) {
  80873c:	83 f8 ff             	cmp    $0xffffffff,%eax
  80873f:	75 29                	jne    80876a <sys_mbox_fetch+0x7e>
      /* If time == SYS_ARCH_TIMEOUT, a timeout occured before a message
         could be fetched. We should now call the timeout handler and
         deallocate the memory allocated for the timeout. */
      tmptimeout = timeouts->next;
  808741:	8b 03                	mov    (%ebx),%eax
      timeouts->next = tmptimeout->next;
  808743:	8b 10                	mov    (%eax),%edx
  808745:	89 13                	mov    %edx,(%ebx)
      h   = tmptimeout->h;
  808747:	8b 58 08             	mov    0x8(%eax),%ebx
      arg = tmptimeout->arg;
  80874a:	8b 70 0c             	mov    0xc(%eax),%esi
      memp_free(MEMP_SYS_TIMEOUT, tmptimeout);
  80874d:	89 44 24 04          	mov    %eax,0x4(%esp)
  808751:	c7 04 24 0b 00 00 00 	movl   $0xb,(%esp)
  808758:	e8 17 f0 ff ff       	call   807774 <memp_free>
      if (h != NULL) {
  80875d:	85 db                	test   %ebx,%ebx
  80875f:	74 97                	je     8086f8 <sys_mbox_fetch+0xc>
        LWIP_DEBUGF(SYS_DEBUG, ("smf calling h=%p(%p)\n", (void*)&h, arg));
        h(arg);
  808761:	89 34 24             	mov    %esi,(%esp)
  808764:	ff d3                	call   *%ebx
  808766:	66 90                	xchg   %ax,%ax
  808768:	eb 8e                	jmp    8086f8 <sys_mbox_fetch+0xc>
      goto again;
    } else {
      /* If time != SYS_ARCH_TIMEOUT, a message was received before the timeout
         occured. The time variable is set to the number of
         milliseconds we waited for the message. */
      if (time_needed < timeouts->next->time) {
  80876a:	8b 13                	mov    (%ebx),%edx
  80876c:	8b 4a 04             	mov    0x4(%edx),%ecx
  80876f:	39 c8                	cmp    %ecx,%eax
  808771:	73 07                	jae    80877a <sys_mbox_fetch+0x8e>
        timeouts->next->time -= time_needed;
  808773:	29 c1                	sub    %eax,%ecx
  808775:	89 4a 04             	mov    %ecx,0x4(%edx)
  808778:	eb 07                	jmp    808781 <sys_mbox_fetch+0x95>
      } else {
        timeouts->next->time = 0;
  80877a:	c7 42 04 00 00 00 00 	movl   $0x0,0x4(%edx)
      }
    }
  }
}
  808781:	83 c4 1c             	add    $0x1c,%esp
  808784:	5b                   	pop    %ebx
  808785:	5e                   	pop    %esi
  808786:	5f                   	pop    %edi
  808787:	5d                   	pop    %ebp
  808788:	c3                   	ret    
  808789:	00 00                	add    %al,(%eax)
  80878b:	00 00                	add    %al,(%eax)
  80878d:	00 00                	add    %al,(%eax)
	...

00808790 <tcp_accept_null>:
/**
 * Default accept callback if no accept callback is specified by the user.
 */
static err_t
tcp_accept_null(void *arg, struct tcp_pcb *pcb, err_t err)
{
  808790:	55                   	push   %ebp
  808791:	89 e5                	mov    %esp,%ebp
  LWIP_UNUSED_ARG(arg);
  LWIP_UNUSED_ARG(pcb);
  LWIP_UNUSED_ARG(err);

  return ERR_ABRT;
}
  808793:	b8 fb ff ff ff       	mov    $0xfffffffb,%eax
  808798:	5d                   	pop    %ebp
  808799:	c3                   	ret    

0080879a <tcp_new_port>:
 *
 * @return a new (free) local TCP port number
 */
static u16_t
tcp_new_port(void)
{
  80879a:	55                   	push   %ebp
  80879b:	89 e5                	mov    %esp,%ebp
  80879d:	57                   	push   %edi
  80879e:	56                   	push   %esi
  80879f:	53                   	push   %ebx
  8087a0:	83 ec 08             	sub    $0x8,%esp
 again:
  if (++port > TCP_LOCAL_PORT_RANGE_END) {
    port = TCP_LOCAL_PORT_RANGE_START;
  }
  
  for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  8087a3:	8b 0d 08 f6 b3 00    	mov    0xb3f608,%ecx
    if (pcb->local_port == port) {
      goto again;
    }
  }
  for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
  8087a9:	8b 1d 1c f6 b3 00    	mov    0xb3f61c,%ebx
    if (pcb->local_port == port) {
      goto again;
    }
  }
  for(pcb = (struct tcp_pcb *)tcp_listen_pcbs.pcbs; pcb != NULL; pcb = pcb->next) {
  8087af:	a1 10 f6 b3 00       	mov    0xb3f610,%eax
  8087b4:	89 45 f0             	mov    %eax,-0x10(%ebp)
  8087b7:	0f b7 15 80 90 81 00 	movzwl 0x819080,%edx
#define TCP_LOCAL_PORT_RANGE_END   0x7fff
#endif
  static u16_t port = TCP_LOCAL_PORT_RANGE_START;
  
 again:
  if (++port > TCP_LOCAL_PORT_RANGE_END) {
  8087be:	be 00 10 00 00       	mov    $0x1000,%esi
    port = TCP_LOCAL_PORT_RANGE_START;
  }
  
  for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
    if (pcb->local_port == port) {
  8087c3:	89 cf                	mov    %ecx,%edi
#define TCP_LOCAL_PORT_RANGE_END   0x7fff
#endif
  static u16_t port = TCP_LOCAL_PORT_RANGE_START;
  
 again:
  if (++port > TCP_LOCAL_PORT_RANGE_END) {
  8087c5:	66 83 c2 01          	add    $0x1,%dx
  8087c9:	0f 48 d6             	cmovs  %esi,%edx
    port = TCP_LOCAL_PORT_RANGE_START;
  }
  
  for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  8087cc:	85 c9                	test   %ecx,%ecx
  8087ce:	74 19                	je     8087e9 <tcp_new_port+0x4f>
    if (pcb->local_port == port) {
  8087d0:	89 f8                	mov    %edi,%eax
  8087d2:	66 3b 51 1c          	cmp    0x1c(%ecx),%dx
  8087d6:	75 0a                	jne    8087e2 <tcp_new_port+0x48>
  8087d8:	eb eb                	jmp    8087c5 <tcp_new_port+0x2b>
  8087da:	66 3b 50 1c          	cmp    0x1c(%eax),%dx
  8087de:	66 90                	xchg   %ax,%ax
  8087e0:	74 e3                	je     8087c5 <tcp_new_port+0x2b>
 again:
  if (++port > TCP_LOCAL_PORT_RANGE_END) {
    port = TCP_LOCAL_PORT_RANGE_START;
  }
  
  for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  8087e2:	8b 40 0c             	mov    0xc(%eax),%eax
  8087e5:	85 c0                	test   %eax,%eax
  8087e7:	75 f1                	jne    8087da <tcp_new_port+0x40>
    if (pcb->local_port == port) {
      goto again;
    }
  }
  for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
  8087e9:	85 db                	test   %ebx,%ebx
  8087eb:	74 1c                	je     808809 <tcp_new_port+0x6f>
    if (pcb->local_port == port) {
  8087ed:	89 d8                	mov    %ebx,%eax
  8087ef:	66 3b 53 1c          	cmp    0x1c(%ebx),%dx
  8087f3:	75 0d                	jne    808802 <tcp_new_port+0x68>
  8087f5:	eb ce                	jmp    8087c5 <tcp_new_port+0x2b>
  8087f7:	66 3b 50 1c          	cmp    0x1c(%eax),%dx
  8087fb:	90                   	nop
  8087fc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  808800:	74 c3                	je     8087c5 <tcp_new_port+0x2b>
  for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
    if (pcb->local_port == port) {
      goto again;
    }
  }
  for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
  808802:	8b 40 0c             	mov    0xc(%eax),%eax
  808805:	85 c0                	test   %eax,%eax
  808807:	75 ee                	jne    8087f7 <tcp_new_port+0x5d>
    if (pcb->local_port == port) {
      goto again;
    }
  }
  for(pcb = (struct tcp_pcb *)tcp_listen_pcbs.pcbs; pcb != NULL; pcb = pcb->next) {
  808809:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  80880d:	8d 76 00             	lea    0x0(%esi),%esi
  808810:	75 09                	jne    80881b <tcp_new_port+0x81>
  808812:	66 89 15 80 90 81 00 	mov    %dx,0x819080
  808819:	eb 30                	jmp    80884b <tcp_new_port+0xb1>
    if (pcb->local_port == port) {
  80881b:	8b 45 f0             	mov    -0x10(%ebp),%eax
  80881e:	89 45 ec             	mov    %eax,-0x14(%ebp)
  808821:	66 3b 50 1c          	cmp    0x1c(%eax),%dx
  808825:	75 13                	jne    80883a <tcp_new_port+0xa0>
  808827:	eb 9c                	jmp    8087c5 <tcp_new_port+0x2b>
  808829:	66 3b 50 1c          	cmp    0x1c(%eax),%dx
  80882d:	8d 76 00             	lea    0x0(%esi),%esi
  808830:	75 0b                	jne    80883d <tcp_new_port+0xa3>
  808832:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  808838:	eb 8b                	jmp    8087c5 <tcp_new_port+0x2b>
  80883a:	8b 45 ec             	mov    -0x14(%ebp),%eax
  for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
    if (pcb->local_port == port) {
      goto again;
    }
  }
  for(pcb = (struct tcp_pcb *)tcp_listen_pcbs.pcbs; pcb != NULL; pcb = pcb->next) {
  80883d:	8b 40 0c             	mov    0xc(%eax),%eax
  808840:	85 c0                	test   %eax,%eax
  808842:	75 e5                	jne    808829 <tcp_new_port+0x8f>
  808844:	66 89 15 80 90 81 00 	mov    %dx,0x819080
    if (pcb->local_port == port) {
      goto again;
    }
  }
  return port;
}
  80884b:	0f b7 05 80 90 81 00 	movzwl 0x819080,%eax
  808852:	83 c4 08             	add    $0x8,%esp
  808855:	5b                   	pop    %ebx
  808856:	5e                   	pop    %esi
  808857:	5f                   	pop    %edi
  808858:	5d                   	pop    %ebp
  808859:	c3                   	ret    

0080885a <tcp_setprio>:
 * @param pcb the tcp_pcb to manipulate
 * @param prio new priority
 */
void
tcp_setprio(struct tcp_pcb *pcb, u8_t prio)
{
  80885a:	55                   	push   %ebp
  80885b:	89 e5                	mov    %esp,%ebp
  pcb->prio = prio;
  80885d:	8b 55 0c             	mov    0xc(%ebp),%edx
  808860:	8b 45 08             	mov    0x8(%ebp),%eax
  808863:	88 50 14             	mov    %dl,0x14(%eax)
}
  808866:	5d                   	pop    %ebp
  808867:	c3                   	ret    

00808868 <tcp_arg>:
 * @param pcb tcp_pcb to set the callback argument
 * @param arg void pointer argument to pass to callback functions
 */ 
void
tcp_arg(struct tcp_pcb *pcb, void *arg)
{  
  808868:	55                   	push   %ebp
  808869:	89 e5                	mov    %esp,%ebp
  pcb->callback_arg = arg;
  80886b:	8b 55 0c             	mov    0xc(%ebp),%edx
  80886e:	8b 45 08             	mov    0x8(%ebp),%eax
  808871:	89 50 18             	mov    %edx,0x18(%eax)
}
  808874:	5d                   	pop    %ebp
  808875:	c3                   	ret    

00808876 <tcp_recv>:
 * @param recv callback function to call for this pcb when data is received
 */ 
void
tcp_recv(struct tcp_pcb *pcb,
   err_t (* recv)(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err))
{
  808876:	55                   	push   %ebp
  808877:	89 e5                	mov    %esp,%ebp
  pcb->recv = recv;
  808879:	8b 55 0c             	mov    0xc(%ebp),%edx
  80887c:	8b 45 08             	mov    0x8(%ebp),%eax
  80887f:	89 90 88 00 00 00    	mov    %edx,0x88(%eax)
}
  808885:	5d                   	pop    %ebp
  808886:	c3                   	ret    

00808887 <tcp_sent>:
 * @param sent callback function to call for this pcb when data is successfully sent
 */ 
void
tcp_sent(struct tcp_pcb *pcb,
   err_t (* sent)(void *arg, struct tcp_pcb *tpcb, u16_t len))
{
  808887:	55                   	push   %ebp
  808888:	89 e5                	mov    %esp,%ebp
  pcb->sent = sent;
  80888a:	8b 55 0c             	mov    0xc(%ebp),%edx
  80888d:	8b 45 08             	mov    0x8(%ebp),%eax
  808890:	89 90 84 00 00 00    	mov    %edx,0x84(%eax)
}
  808896:	5d                   	pop    %ebp
  808897:	c3                   	ret    

00808898 <tcp_err>:
 *        has occured on the connection
 */ 
void
tcp_err(struct tcp_pcb *pcb,
   void (* errf)(void *arg, err_t err))
{
  808898:	55                   	push   %ebp
  808899:	89 e5                	mov    %esp,%ebp
  pcb->errf = errf;
  80889b:	8b 55 0c             	mov    0xc(%ebp),%edx
  80889e:	8b 45 08             	mov    0x8(%ebp),%eax
  8088a1:	89 90 98 00 00 00    	mov    %edx,0x98(%eax)
}
  8088a7:	5d                   	pop    %ebp
  8088a8:	c3                   	ret    

008088a9 <tcp_accept>:
 *        connection has been connected to another host
 */ 
void
tcp_accept(struct tcp_pcb *pcb,
     err_t (* accept)(void *arg, struct tcp_pcb *newpcb, err_t err))
{
  8088a9:	55                   	push   %ebp
  8088aa:	89 e5                	mov    %esp,%ebp
  ((struct tcp_pcb_listen *)pcb)->accept = accept;
  8088ac:	8b 55 0c             	mov    0xc(%ebp),%edx
  8088af:	8b 45 08             	mov    0x8(%ebp),%eax
  8088b2:	89 50 20             	mov    %edx,0x20(%eax)
}
  8088b5:	5d                   	pop    %ebp
  8088b6:	c3                   	ret    

008088b7 <tcp_poll>:
 *
 */ 
void
tcp_poll(struct tcp_pcb *pcb,
   err_t (* poll)(void *arg, struct tcp_pcb *tpcb), u8_t interval)
{
  8088b7:	55                   	push   %ebp
  8088b8:	89 e5                	mov    %esp,%ebp
  8088ba:	8b 45 08             	mov    0x8(%ebp),%eax
#if LWIP_CALLBACK_API
  pcb->poll = poll;
  8088bd:	8b 55 0c             	mov    0xc(%ebp),%edx
  8088c0:	89 90 94 00 00 00    	mov    %edx,0x94(%eax)
#endif /* LWIP_CALLBACK_API */  
  pcb->pollinterval = interval;
  8088c6:	8b 55 10             	mov    0x10(%ebp),%edx
  8088c9:	88 50 31             	mov    %dl,0x31(%eax)
}
  8088cc:	5d                   	pop    %ebp
  8088cd:	c3                   	ret    

008088ce <tcp_next_iss>:
 *
 * @return u32_t pseudo random sequence number
 */
u32_t
tcp_next_iss(void)
{
  8088ce:	55                   	push   %ebp
  8088cf:	89 e5                	mov    %esp,%ebp
  static u32_t iss = 6510;
  
  iss += tcp_ticks;       /* XXX */
  8088d1:	a1 0c f6 b3 00       	mov    0xb3f60c,%eax
  8088d6:	03 05 7c 90 81 00    	add    0x81907c,%eax
  8088dc:	a3 7c 90 81 00       	mov    %eax,0x81907c
  return iss;
}
  8088e1:	5d                   	pop    %ebp
  8088e2:	c3                   	ret    

008088e3 <tcp_eff_send_mss>:
 * by using ip_route to determin the netif used to send to the address and
 * calculating the minimum of TCP_MSS and that netif's mtu (if set).
 */
u16_t
tcp_eff_send_mss(u16_t sendmss, struct ip_addr *addr)
{
  8088e3:	55                   	push   %ebp
  8088e4:	89 e5                	mov    %esp,%ebp
  8088e6:	53                   	push   %ebx
  8088e7:	83 ec 14             	sub    $0x14,%esp
  8088ea:	0f b7 5d 08          	movzwl 0x8(%ebp),%ebx
  u16_t mss_s;
  struct netif *outif;

  outif = ip_route(addr);
  8088ee:	8b 45 0c             	mov    0xc(%ebp),%eax
  8088f1:	89 04 24             	mov    %eax,(%esp)
  8088f4:	e8 e8 11 00 00       	call   809ae1 <ip_route>
  if ((outif != NULL) && (outif->mtu != 0)) {
  8088f9:	85 c0                	test   %eax,%eax
  8088fb:	74 12                	je     80890f <tcp_eff_send_mss+0x2c>
  8088fd:	0f b7 40 2c          	movzwl 0x2c(%eax),%eax
  808901:	66 85 c0             	test   %ax,%ax
  808904:	74 09                	je     80890f <tcp_eff_send_mss+0x2c>
    mss_s = outif->mtu - IP_HLEN - TCP_HLEN;
    /* RFC 1122, chap 4.2.2.6:
     * Eff.snd.MSS = min(SendMSS+20, MMS_S) - TCPhdrsize - IPoptionsize
     * but we only send options with SYN and that is never filled with data! */
    sendmss = LWIP_MIN(sendmss, mss_s);
  808906:	83 e8 28             	sub    $0x28,%eax
  808909:	66 39 c3             	cmp    %ax,%bx
  80890c:	0f 47 d8             	cmova  %eax,%ebx
  }
  return sendmss;
}
  80890f:	89 d8                	mov    %ebx,%eax
  808911:	83 c4 14             	add    $0x14,%esp
  808914:	5b                   	pop    %ebx
  808915:	5d                   	pop    %ebp
  808916:	c3                   	ret    

00808917 <tcp_recved>:
 * @param pcb the tcp_pcb for which data is read
 * @param len the amount of bytes that have been read by the application
 */
void
tcp_recved(struct tcp_pcb *pcb, u16_t len)
{
  808917:	55                   	push   %ebp
  808918:	89 e5                	mov    %esp,%ebp
  80891a:	83 ec 18             	sub    $0x18,%esp
  80891d:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  808920:	89 75 fc             	mov    %esi,-0x4(%ebp)
  808923:	8b 45 08             	mov    0x8(%ebp),%eax
  808926:	0f b7 4d 0c          	movzwl 0xc(%ebp),%ecx
  if ((u32_t)pcb->rcv_wnd + len > TCP_WND) {
  80892a:	0f b7 50 28          	movzwl 0x28(%eax),%edx
  80892e:	0f b7 f1             	movzwl %cx,%esi
  808931:	0f b7 da             	movzwl %dx,%ebx
  808934:	8d 1c 1e             	lea    (%esi,%ebx,1),%ebx
  808937:	81 fb c0 5d 00 00    	cmp    $0x5dc0,%ebx
  80893d:	76 0e                	jbe    80894d <tcp_recved+0x36>
    pcb->rcv_wnd = TCP_WND;
  80893f:	66 c7 40 28 c0 5d    	movw   $0x5dc0,0x28(%eax)
    pcb->rcv_ann_wnd = TCP_WND;
  808945:	66 c7 40 2a c0 5d    	movw   $0x5dc0,0x2a(%eax)
  80894b:	eb 11                	jmp    80895e <tcp_recved+0x47>
  } else {
    pcb->rcv_wnd += len;
  80894d:	8d 14 11             	lea    (%ecx,%edx,1),%edx
  808950:	66 89 50 28          	mov    %dx,0x28(%eax)
    if (pcb->rcv_wnd >= pcb->mss) {
  808954:	66 3b 50 34          	cmp    0x34(%eax),%dx
  808958:	72 04                	jb     80895e <tcp_recved+0x47>
      pcb->rcv_ann_wnd = pcb->rcv_wnd;
  80895a:	66 89 50 2a          	mov    %dx,0x2a(%eax)
    }
  }

  if (!(pcb->flags & TF_ACK_DELAY) &&
  80895e:	0f b6 50 20          	movzbl 0x20(%eax),%edx
  808962:	f6 c2 03             	test   $0x3,%dl
  808965:	75 20                	jne    808987 <tcp_recved+0x70>
     * two ACKs being sent for each received packet in some limited cases
     * (where the application is only receiving data, and is slow to
     * process it) but it is necessary to guarantee that the sender can
     * continue to transmit.
     */
    tcp_ack(pcb);
  808967:	f6 c2 01             	test   $0x1,%dl
  80896a:	74 13                	je     80897f <tcp_recved+0x68>
  80896c:	83 e2 fe             	and    $0xfffffffe,%edx
  80896f:	83 ca 02             	or     $0x2,%edx
  808972:	88 50 20             	mov    %dl,0x20(%eax)
  808975:	89 04 24             	mov    %eax,(%esp)
  808978:	e8 fe 29 00 00       	call   80b37b <tcp_output>
  80897d:	eb 23                	jmp    8089a2 <tcp_recved+0x8b>
  80897f:	83 ca 01             	or     $0x1,%edx
  808982:	88 50 20             	mov    %dl,0x20(%eax)
  808985:	eb 1b                	jmp    8089a2 <tcp_recved+0x8b>
  } 
  else if (pcb->flags & TF_ACK_DELAY && pcb->rcv_wnd >= TCP_WND/2) {
  808987:	f6 c2 01             	test   $0x1,%dl
  80898a:	74 16                	je     8089a2 <tcp_recved+0x8b>
  80898c:	66 81 78 28 df 2e    	cmpw   $0x2edf,0x28(%eax)
  808992:	76 0e                	jbe    8089a2 <tcp_recved+0x8b>
     * nagle-like in its goals, and tries to hit a compromise between
     * sending acks each time the window is updated, and only sending
     * window updates when a timer expires.  The "threshold" used
     * above (currently TCP_WND/2) can be tuned to be more or less
     * aggressive  */
    tcp_ack_now(pcb);
  808994:	83 ca 02             	or     $0x2,%edx
  808997:	88 50 20             	mov    %dl,0x20(%eax)
  80899a:	89 04 24             	mov    %eax,(%esp)
  80899d:	e8 d9 29 00 00       	call   80b37b <tcp_output>
  }

  LWIP_DEBUGF(TCP_DEBUG, ("tcp_recved: recveived %"U16_F" bytes, wnd %"U16_F" (%"U16_F").\n",
         len, pcb->rcv_wnd, TCP_WND - pcb->rcv_wnd));
}
  8089a2:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  8089a5:	8b 75 fc             	mov    -0x4(%ebp),%esi
  8089a8:	89 ec                	mov    %ebp,%esp
  8089aa:	5d                   	pop    %ebp
  8089ab:	c3                   	ret    

008089ac <tcp_fasttmr>:
 *
 * Automatically called from tcp_tmr().
 */
void
tcp_fasttmr(void)
{
  8089ac:	55                   	push   %ebp
  8089ad:	89 e5                	mov    %esp,%ebp
  8089af:	53                   	push   %ebx
  8089b0:	83 ec 14             	sub    $0x14,%esp
  struct tcp_pcb *pcb;

  for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  8089b3:	8b 1d 08 f6 b3 00    	mov    0xb3f608,%ebx
  8089b9:	85 db                	test   %ebx,%ebx
  8089bb:	74 6b                	je     808a28 <tcp_fasttmr+0x7c>
    /* If there is data which was previously "refused" by upper layer */
    if (pcb->refused_data != NULL) {
  8089bd:	8b 83 80 00 00 00    	mov    0x80(%ebx),%eax
  8089c3:	85 c0                	test   %eax,%eax
  8089c5:	74 40                	je     808a07 <tcp_fasttmr+0x5b>
      /* Notify again application with data previously received. */
      err_t err;
      LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_fasttmr: notify kept packet\n"));
      TCP_EVENT_RECV(pcb, pcb->refused_data, ERR_OK, err);
  8089c7:	8b 93 88 00 00 00    	mov    0x88(%ebx),%edx
  8089cd:	85 d2                	test   %edx,%edx
  8089cf:	74 1e                	je     8089ef <tcp_fasttmr+0x43>
  8089d1:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  8089d8:	00 
  8089d9:	89 44 24 08          	mov    %eax,0x8(%esp)
  8089dd:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  8089e1:	8b 43 18             	mov    0x18(%ebx),%eax
  8089e4:	89 04 24             	mov    %eax,(%esp)
  8089e7:	ff d2                	call   *%edx
      if (err == ERR_OK) {
  8089e9:	84 c0                	test   %al,%al
  8089eb:	75 1a                	jne    808a07 <tcp_fasttmr+0x5b>
  8089ed:	eb 0e                	jmp    8089fd <tcp_fasttmr+0x51>
    /* If there is data which was previously "refused" by upper layer */
    if (pcb->refused_data != NULL) {
      /* Notify again application with data previously received. */
      err_t err;
      LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_fasttmr: notify kept packet\n"));
      TCP_EVENT_RECV(pcb, pcb->refused_data, ERR_OK, err);
  8089ef:	89 04 24             	mov    %eax,(%esp)
  8089f2:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  8089f8:	e8 00 f5 ff ff       	call   807efd <pbuf_free>
      if (err == ERR_OK) {
        pcb->refused_data = NULL;
  8089fd:	c7 83 80 00 00 00 00 	movl   $0x0,0x80(%ebx)
  808a04:	00 00 00 
      }
    }

    /* send delayed ACKs */  
    if (pcb->flags & TF_ACK_DELAY) {
  808a07:	0f b6 43 20          	movzbl 0x20(%ebx),%eax
  808a0b:	a8 01                	test   $0x1,%al
  808a0d:	74 12                	je     808a21 <tcp_fasttmr+0x75>
      LWIP_DEBUGF(TCP_DEBUG, ("tcp_fasttmr: delayed ACK\n"));
      tcp_ack_now(pcb);
  808a0f:	83 c8 02             	or     $0x2,%eax
  808a12:	88 43 20             	mov    %al,0x20(%ebx)
  808a15:	89 1c 24             	mov    %ebx,(%esp)
  808a18:	e8 5e 29 00 00       	call   80b37b <tcp_output>
      pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
  808a1d:	80 63 20 fc          	andb   $0xfc,0x20(%ebx)
void
tcp_fasttmr(void)
{
  struct tcp_pcb *pcb;

  for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  808a21:	8b 5b 0c             	mov    0xc(%ebx),%ebx
  808a24:	85 db                	test   %ebx,%ebx
  808a26:	75 95                	jne    8089bd <tcp_fasttmr+0x11>
      LWIP_DEBUGF(TCP_DEBUG, ("tcp_fasttmr: delayed ACK\n"));
      tcp_ack_now(pcb);
      pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
    }
  }
}
  808a28:	83 c4 14             	add    $0x14,%esp
  808a2b:	5b                   	pop    %ebx
  808a2c:	5d                   	pop    %ebp
  808a2d:	c3                   	ret    

00808a2e <tcp_seg_copy>:
 * @param seg the old tcp_seg
 * @return a copy of seg
 */ 
struct tcp_seg *
tcp_seg_copy(struct tcp_seg *seg)
{
  808a2e:	55                   	push   %ebp
  808a2f:	89 e5                	mov    %esp,%ebp
  808a31:	53                   	push   %ebx
  808a32:	83 ec 14             	sub    $0x14,%esp
  struct tcp_seg *cseg;

  cseg = memp_malloc(MEMP_TCP_SEG);
  808a35:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
  808a3c:	e8 77 ed ff ff       	call   8077b8 <memp_malloc>
  808a41:	89 c3                	mov    %eax,%ebx
  if (cseg == NULL) {
  808a43:	85 c0                	test   %eax,%eax
  808a45:	74 22                	je     808a69 <tcp_seg_copy+0x3b>
    return NULL;
  }
  SMEMCPY((u8_t *)cseg, (const u8_t *)seg, sizeof(struct tcp_seg)); 
  808a47:	c7 44 24 08 14 00 00 	movl   $0x14,0x8(%esp)
  808a4e:	00 
  808a4f:	8b 45 08             	mov    0x8(%ebp),%eax
  808a52:	89 44 24 04          	mov    %eax,0x4(%esp)
  808a56:	89 1c 24             	mov    %ebx,(%esp)
  808a59:	e8 03 89 ff ff       	call   801361 <memcpy>
  pbuf_ref(cseg->p);
  808a5e:	8b 43 04             	mov    0x4(%ebx),%eax
  808a61:	89 04 24             	mov    %eax,(%esp)
  808a64:	e8 51 f0 ff ff       	call   807aba <pbuf_ref>
  return cseg;
}
  808a69:	89 d8                	mov    %ebx,%eax
  808a6b:	83 c4 14             	add    $0x14,%esp
  808a6e:	5b                   	pop    %ebx
  808a6f:	5d                   	pop    %ebp
  808a70:	c3                   	ret    

00808a71 <tcp_seg_free>:
 * @param seg single tcp_seg to free
 * @return the number of pbufs that were deallocated
 */
u8_t
tcp_seg_free(struct tcp_seg *seg)
{
  808a71:	55                   	push   %ebp
  808a72:	89 e5                	mov    %esp,%ebp
  808a74:	83 ec 18             	sub    $0x18,%esp
  808a77:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  808a7a:	89 75 fc             	mov    %esi,-0x4(%ebp)
  808a7d:	8b 75 08             	mov    0x8(%ebp),%esi
  u8_t count = 0;
  
  if (seg != NULL) {
  808a80:	bb 00 00 00 00       	mov    $0x0,%ebx
  808a85:	85 f6                	test   %esi,%esi
  808a87:	74 21                	je     808aaa <tcp_seg_free+0x39>
    if (seg->p != NULL) {
  808a89:	8b 46 04             	mov    0x4(%esi),%eax
  808a8c:	85 c0                	test   %eax,%eax
  808a8e:	74 0a                	je     808a9a <tcp_seg_free+0x29>
      count = pbuf_free(seg->p);
  808a90:	89 04 24             	mov    %eax,(%esp)
  808a93:	e8 65 f4 ff ff       	call   807efd <pbuf_free>
  808a98:	89 c3                	mov    %eax,%ebx
#if TCP_DEBUG
      seg->p = NULL;
#endif /* TCP_DEBUG */
    }
    memp_free(MEMP_TCP_SEG, seg);
  808a9a:	89 74 24 04          	mov    %esi,0x4(%esp)
  808a9e:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
  808aa5:	e8 ca ec ff ff       	call   807774 <memp_free>
  }
  return count;
}
  808aaa:	89 d8                	mov    %ebx,%eax
  808aac:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  808aaf:	8b 75 fc             	mov    -0x4(%ebp),%esi
  808ab2:	89 ec                	mov    %ebp,%esp
  808ab4:	5d                   	pop    %ebp
  808ab5:	c3                   	ret    

00808ab6 <tcp_segs_free>:
 * @param seg tcp_seg list of TCP segments to free
 * @return the number of pbufs that were deallocated
 */
u8_t
tcp_segs_free(struct tcp_seg *seg)
{
  808ab6:	55                   	push   %ebp
  808ab7:	89 e5                	mov    %esp,%ebp
  808ab9:	56                   	push   %esi
  808aba:	53                   	push   %ebx
  808abb:	83 ec 10             	sub    $0x10,%esp
  808abe:	8b 45 08             	mov    0x8(%ebp),%eax
  u8_t count = 0;
  struct tcp_seg *next;
  while (seg != NULL) {
  808ac1:	be 00 00 00 00       	mov    $0x0,%esi
  808ac6:	85 c0                	test   %eax,%eax
  808ac8:	74 14                	je     808ade <tcp_segs_free+0x28>
    next = seg->next;
  808aca:	8b 18                	mov    (%eax),%ebx
    count += tcp_seg_free(seg);
  808acc:	89 04 24             	mov    %eax,(%esp)
  808acf:	e8 9d ff ff ff       	call   808a71 <tcp_seg_free>
  808ad4:	01 c6                	add    %eax,%esi
u8_t
tcp_segs_free(struct tcp_seg *seg)
{
  u8_t count = 0;
  struct tcp_seg *next;
  while (seg != NULL) {
  808ad6:	85 db                	test   %ebx,%ebx
  808ad8:	74 04                	je     808ade <tcp_segs_free+0x28>
  808ada:	89 d8                	mov    %ebx,%eax
  808adc:	eb ec                	jmp    808aca <tcp_segs_free+0x14>
    next = seg->next;
    count += tcp_seg_free(seg);
    seg = next;
  }
  return count;
}
  808ade:	89 f0                	mov    %esi,%eax
  808ae0:	83 c4 10             	add    $0x10,%esp
  808ae3:	5b                   	pop    %ebx
  808ae4:	5e                   	pop    %esi
  808ae5:	5d                   	pop    %ebp
  808ae6:	c3                   	ret    

00808ae7 <tcp_pcb_purge>:
 *
 * @param pcb tcp_pcb to purge. The pcb itself is not deallocated!
 */
void
tcp_pcb_purge(struct tcp_pcb *pcb)
{
  808ae7:	55                   	push   %ebp
  808ae8:	89 e5                	mov    %esp,%ebp
  808aea:	53                   	push   %ebx
  808aeb:	83 ec 14             	sub    $0x14,%esp
  808aee:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if (pcb->state != CLOSED &&
     pcb->state != TIME_WAIT &&
  808af1:	8b 43 10             	mov    0x10(%ebx),%eax
 * @param pcb tcp_pcb to purge. The pcb itself is not deallocated!
 */
void
tcp_pcb_purge(struct tcp_pcb *pcb)
{
  if (pcb->state != CLOSED &&
  808af4:	85 c0                	test   %eax,%eax
  808af6:	74 62                	je     808b5a <tcp_pcb_purge+0x73>
  808af8:	83 f8 0a             	cmp    $0xa,%eax
  808afb:	74 5d                	je     808b5a <tcp_pcb_purge+0x73>
  808afd:	83 f8 01             	cmp    $0x1,%eax
  808b00:	74 58                	je     808b5a <tcp_pcb_purge+0x73>
     pcb->state != TIME_WAIT &&
     pcb->state != LISTEN) {

    LWIP_DEBUGF(TCP_DEBUG, ("tcp_pcb_purge\n"));

    if (pcb->refused_data != NULL) {
  808b02:	8b 83 80 00 00 00    	mov    0x80(%ebx),%eax
  808b08:	85 c0                	test   %eax,%eax
  808b0a:	74 12                	je     808b1e <tcp_pcb_purge+0x37>
      LWIP_DEBUGF(TCP_DEBUG, ("tcp_pcb_purge: data left on ->refused_data\n"));
      pbuf_free(pcb->refused_data);
  808b0c:	89 04 24             	mov    %eax,(%esp)
  808b0f:	e8 e9 f3 ff ff       	call   807efd <pbuf_free>
      pcb->refused_data = NULL;
  808b14:	c7 83 80 00 00 00 00 	movl   $0x0,0x80(%ebx)
  808b1b:	00 00 00 
      LWIP_DEBUGF(TCP_DEBUG, ("tcp_pcb_purge: data left on ->ooseq\n"));
    }

    /* Stop the retransmission timer as it will expect data on unacked
       queue if it fires */
    pcb->rtime = -1;
  808b1e:	66 c7 43 32 ff ff    	movw   $0xffff,0x32(%ebx)

    tcp_segs_free(pcb->ooseq);
  808b24:	8b 43 7c             	mov    0x7c(%ebx),%eax
  808b27:	89 04 24             	mov    %eax,(%esp)
  808b2a:	e8 87 ff ff ff       	call   808ab6 <tcp_segs_free>
    pcb->ooseq = NULL;
  808b2f:	c7 43 7c 00 00 00 00 	movl   $0x0,0x7c(%ebx)
#endif /* TCP_QUEUE_OOSEQ */
    tcp_segs_free(pcb->unsent);
  808b36:	8b 43 74             	mov    0x74(%ebx),%eax
  808b39:	89 04 24             	mov    %eax,(%esp)
  808b3c:	e8 75 ff ff ff       	call   808ab6 <tcp_segs_free>
    tcp_segs_free(pcb->unacked);
  808b41:	8b 43 78             	mov    0x78(%ebx),%eax
  808b44:	89 04 24             	mov    %eax,(%esp)
  808b47:	e8 6a ff ff ff       	call   808ab6 <tcp_segs_free>
    pcb->unacked = pcb->unsent = NULL;
  808b4c:	c7 43 74 00 00 00 00 	movl   $0x0,0x74(%ebx)
  808b53:	c7 43 78 00 00 00 00 	movl   $0x0,0x78(%ebx)
  }
}
  808b5a:	83 c4 14             	add    $0x14,%esp
  808b5d:	5b                   	pop    %ebx
  808b5e:	5d                   	pop    %ebp
  808b5f:	c3                   	ret    

00808b60 <tcp_pcb_remove>:
 * @param pcblist PCB list to purge.
 * @param pcb tcp_pcb to purge. The pcb itself is also deallocated!
 */
void
tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb)
{
  808b60:	55                   	push   %ebp
  808b61:	89 e5                	mov    %esp,%ebp
  808b63:	53                   	push   %ebx
  808b64:	83 ec 14             	sub    $0x14,%esp
  808b67:	8b 45 08             	mov    0x8(%ebp),%eax
  808b6a:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  TCP_RMV(pcblist, pcb);
  808b6d:	8b 10                	mov    (%eax),%edx
  808b6f:	39 da                	cmp    %ebx,%edx
  808b71:	75 07                	jne    808b7a <tcp_pcb_remove+0x1a>
  808b73:	8b 52 0c             	mov    0xc(%edx),%edx
  808b76:	89 10                	mov    %edx,(%eax)
  808b78:	eb 2a                	jmp    808ba4 <tcp_pcb_remove+0x44>
  808b7a:	89 15 14 f6 b3 00    	mov    %edx,0xb3f614
  808b80:	85 d2                	test   %edx,%edx
  808b82:	74 20                	je     808ba4 <tcp_pcb_remove+0x44>
  808b84:	8b 42 0c             	mov    0xc(%edx),%eax
  808b87:	85 c0                	test   %eax,%eax
  808b89:	0f 84 c0 00 00 00    	je     808c4f <tcp_pcb_remove+0xef>
  808b8f:	39 c3                	cmp    %eax,%ebx
  808b91:	75 08                	jne    808b9b <tcp_pcb_remove+0x3b>
  808b93:	8b 43 0c             	mov    0xc(%ebx),%eax
  808b96:	89 42 0c             	mov    %eax,0xc(%edx)
  808b99:	eb 09                	jmp    808ba4 <tcp_pcb_remove+0x44>
  808b9b:	a3 14 f6 b3 00       	mov    %eax,0xb3f614
  808ba0:	89 c2                	mov    %eax,%edx
  808ba2:	eb e0                	jmp    808b84 <tcp_pcb_remove+0x24>
  808ba4:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)

  tcp_pcb_purge(pcb);
  808bab:	89 1c 24             	mov    %ebx,(%esp)
  808bae:	e8 34 ff ff ff       	call   808ae7 <tcp_pcb_purge>
  
  /* if there is an outstanding delayed ACKs, send it */
  if (pcb->state != TIME_WAIT &&
     pcb->state != LISTEN &&
  808bb3:	8b 43 10             	mov    0x10(%ebx),%eax
  TCP_RMV(pcblist, pcb);

  tcp_pcb_purge(pcb);
  
  /* if there is an outstanding delayed ACKs, send it */
  if (pcb->state != TIME_WAIT &&
  808bb6:	83 f8 0a             	cmp    $0xa,%eax
  808bb9:	74 1b                	je     808bd6 <tcp_pcb_remove+0x76>
  808bbb:	83 f8 01             	cmp    $0x1,%eax
  808bbe:	74 16                	je     808bd6 <tcp_pcb_remove+0x76>
     pcb->state != LISTEN &&
     pcb->flags & TF_ACK_DELAY) {
  808bc0:	0f b6 43 20          	movzbl 0x20(%ebx),%eax
  TCP_RMV(pcblist, pcb);

  tcp_pcb_purge(pcb);
  
  /* if there is an outstanding delayed ACKs, send it */
  if (pcb->state != TIME_WAIT &&
  808bc4:	a8 01                	test   $0x1,%al
  808bc6:	74 0e                	je     808bd6 <tcp_pcb_remove+0x76>
     pcb->state != LISTEN &&
     pcb->flags & TF_ACK_DELAY) {
    pcb->flags |= TF_ACK_NOW;
  808bc8:	83 c8 02             	or     $0x2,%eax
  808bcb:	88 43 20             	mov    %al,0x20(%ebx)
    tcp_output(pcb);
  808bce:	89 1c 24             	mov    %ebx,(%esp)
  808bd1:	e8 a5 27 00 00       	call   80b37b <tcp_output>
  }

  if (pcb->state != LISTEN) {
  808bd6:	83 7b 10 01          	cmpl   $0x1,0x10(%ebx)
  808bda:	74 66                	je     808c42 <tcp_pcb_remove+0xe2>
    LWIP_ASSERT("unsent segments leaking", pcb->unsent == NULL);
  808bdc:	83 7b 74 00          	cmpl   $0x0,0x74(%ebx)
  808be0:	74 1c                	je     808bfe <tcp_pcb_remove+0x9e>
  808be2:	c7 44 24 08 2f 3a 81 	movl   $0x813a2f,0x8(%esp)
  808be9:	00 
  808bea:	c7 44 24 04 b4 04 00 	movl   $0x4b4,0x4(%esp)
  808bf1:	00 
  808bf2:	c7 04 24 47 3a 81 00 	movl   $0x813a47,(%esp)
  808bf9:	e8 9e 7d ff ff       	call   80099c <_panic>
    LWIP_ASSERT("unacked segments leaking", pcb->unacked == NULL);
  808bfe:	83 7b 78 00          	cmpl   $0x0,0x78(%ebx)
  808c02:	74 1c                	je     808c20 <tcp_pcb_remove+0xc0>
  808c04:	c7 44 24 08 5b 3a 81 	movl   $0x813a5b,0x8(%esp)
  808c0b:	00 
  808c0c:	c7 44 24 04 b5 04 00 	movl   $0x4b5,0x4(%esp)
  808c13:	00 
  808c14:	c7 04 24 47 3a 81 00 	movl   $0x813a47,(%esp)
  808c1b:	e8 7c 7d ff ff       	call   80099c <_panic>
#if TCP_QUEUE_OOSEQ
    LWIP_ASSERT("ooseq segments leaking", pcb->ooseq == NULL);
  808c20:	83 7b 7c 00          	cmpl   $0x0,0x7c(%ebx)
  808c24:	74 1c                	je     808c42 <tcp_pcb_remove+0xe2>
  808c26:	c7 44 24 08 74 3a 81 	movl   $0x813a74,0x8(%esp)
  808c2d:	00 
  808c2e:	c7 44 24 04 b7 04 00 	movl   $0x4b7,0x4(%esp)
  808c35:	00 
  808c36:	c7 04 24 47 3a 81 00 	movl   $0x813a47,(%esp)
  808c3d:	e8 5a 7d ff ff       	call   80099c <_panic>
#endif /* TCP_QUEUE_OOSEQ */
  }

  pcb->state = CLOSED;
  808c42:	c7 43 10 00 00 00 00 	movl   $0x0,0x10(%ebx)

  LWIP_ASSERT("tcp_pcb_remove: tcp_pcbs_sane()", tcp_pcbs_sane());
}
  808c49:	83 c4 14             	add    $0x14,%esp
  808c4c:	5b                   	pop    %ebx
  808c4d:	5d                   	pop    %ebp
  808c4e:	c3                   	ret    
 * @param pcb tcp_pcb to purge. The pcb itself is also deallocated!
 */
void
tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb)
{
  TCP_RMV(pcblist, pcb);
  808c4f:	a3 14 f6 b3 00       	mov    %eax,0xb3f614
  808c54:	e9 4b ff ff ff       	jmp    808ba4 <tcp_pcb_remove+0x44>

00808c59 <tcp_listen_with_backlog>:
 *       called like this:
 *             tpcb = tcp_listen(tpcb);
 */
struct tcp_pcb *
tcp_listen_with_backlog(struct tcp_pcb *pcb, u8_t backlog)
{
  808c59:	55                   	push   %ebp
  808c5a:	89 e5                	mov    %esp,%ebp
  808c5c:	83 ec 18             	sub    $0x18,%esp
  808c5f:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  808c62:	89 75 fc             	mov    %esi,-0x4(%ebp)
  808c65:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct tcp_pcb_listen *lpcb;

  LWIP_UNUSED_ARG(backlog);
  LWIP_ERROR("tcp_listen: pcb already connected", pcb->state == CLOSED, return NULL);
  808c68:	83 7b 10 00          	cmpl   $0x0,0x10(%ebx)
  808c6c:	74 1c                	je     808c8a <tcp_listen_with_backlog+0x31>
  808c6e:	c7 44 24 08 8c 3a 81 	movl   $0x813a8c,0x8(%esp)
  808c75:	00 
  808c76:	c7 44 24 04 60 01 00 	movl   $0x160,0x4(%esp)
  808c7d:	00 
  808c7e:	c7 04 24 47 3a 81 00 	movl   $0x813a47,(%esp)
  808c85:	e8 12 7d ff ff       	call   80099c <_panic>

  /* already listening? */
  if (pcb->state == LISTEN) {
    return pcb;
  }
  lpcb = memp_malloc(MEMP_TCP_PCB_LISTEN);
  808c8a:	c7 04 24 03 00 00 00 	movl   $0x3,(%esp)
  808c91:	e8 22 eb ff ff       	call   8077b8 <memp_malloc>
  808c96:	89 c6                	mov    %eax,%esi
  if (lpcb == NULL) {
  808c98:	b8 00 00 00 00       	mov    $0x0,%eax
  808c9d:	85 f6                	test   %esi,%esi
  808c9f:	0f 84 a8 00 00 00    	je     808d4d <tcp_listen_with_backlog+0xf4>
    return NULL;
  }
  lpcb->callback_arg = pcb->callback_arg;
  808ca5:	8b 43 18             	mov    0x18(%ebx),%eax
  808ca8:	89 46 18             	mov    %eax,0x18(%esi)
  lpcb->local_port = pcb->local_port;
  808cab:	0f b7 43 1c          	movzwl 0x1c(%ebx),%eax
  808caf:	66 89 46 1c          	mov    %ax,0x1c(%esi)
  lpcb->state = LISTEN;
  808cb3:	c7 46 10 01 00 00 00 	movl   $0x1,0x10(%esi)
  lpcb->so_options = pcb->so_options;
  lpcb->so_options |= SOF_ACCEPTCONN;
  808cba:	0f b7 43 08          	movzwl 0x8(%ebx),%eax
  808cbe:	83 c8 02             	or     $0x2,%eax
  808cc1:	66 89 46 08          	mov    %ax,0x8(%esi)
  lpcb->ttl = pcb->ttl;
  808cc5:	0f b6 43 0b          	movzbl 0xb(%ebx),%eax
  808cc9:	88 46 0b             	mov    %al,0xb(%esi)
  lpcb->tos = pcb->tos;
  808ccc:	0f b6 43 0a          	movzbl 0xa(%ebx),%eax
  808cd0:	88 46 0a             	mov    %al,0xa(%esi)
  ip_addr_set(&lpcb->local_ip, &pcb->local_ip);
  808cd3:	b8 00 00 00 00       	mov    $0x0,%eax
  808cd8:	85 db                	test   %ebx,%ebx
  808cda:	74 02                	je     808cde <tcp_listen_with_backlog+0x85>
  808cdc:	8b 03                	mov    (%ebx),%eax
  808cde:	89 06                	mov    %eax,(%esi)
  TCP_RMV(&tcp_bound_pcbs, pcb);
  808ce0:	8b 15 18 f6 b3 00    	mov    0xb3f618,%edx
  808ce6:	39 da                	cmp    %ebx,%edx
  808ce8:	75 0a                	jne    808cf4 <tcp_listen_with_backlog+0x9b>
  808cea:	8b 42 0c             	mov    0xc(%edx),%eax
  808ced:	a3 18 f6 b3 00       	mov    %eax,0xb3f618
  808cf2:	eb 26                	jmp    808d1a <tcp_listen_with_backlog+0xc1>
  808cf4:	89 15 14 f6 b3 00    	mov    %edx,0xb3f614
  808cfa:	85 d2                	test   %edx,%edx
  808cfc:	74 1c                	je     808d1a <tcp_listen_with_backlog+0xc1>
  808cfe:	8b 42 0c             	mov    0xc(%edx),%eax
  808d01:	85 c0                	test   %eax,%eax
  808d03:	74 52                	je     808d57 <tcp_listen_with_backlog+0xfe>
  808d05:	39 c3                	cmp    %eax,%ebx
  808d07:	75 08                	jne    808d11 <tcp_listen_with_backlog+0xb8>
  808d09:	8b 43 0c             	mov    0xc(%ebx),%eax
  808d0c:	89 42 0c             	mov    %eax,0xc(%edx)
  808d0f:	eb 09                	jmp    808d1a <tcp_listen_with_backlog+0xc1>
  808d11:	a3 14 f6 b3 00       	mov    %eax,0xb3f614
  808d16:	89 c2                	mov    %eax,%edx
  808d18:	eb e4                	jmp    808cfe <tcp_listen_with_backlog+0xa5>
  808d1a:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
  memp_free(MEMP_TCP_PCB, pcb);
  808d21:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  808d25:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  808d2c:	e8 43 ea ff ff       	call   807774 <memp_free>
#if LWIP_CALLBACK_API
  lpcb->accept = tcp_accept_null;
  808d31:	c7 46 20 90 87 80 00 	movl   $0x808790,0x20(%esi)
#endif /* LWIP_CALLBACK_API */
#if TCP_LISTEN_BACKLOG
  lpcb->accepts_pending = 0;
  lpcb->backlog = (backlog ? backlog : 1);
#endif /* TCP_LISTEN_BACKLOG */
  TCP_REG(&tcp_listen_pcbs.listen_pcbs, lpcb);
  808d38:	a1 10 f6 b3 00       	mov    0xb3f610,%eax
  808d3d:	89 46 0c             	mov    %eax,0xc(%esi)
  808d40:	89 35 10 f6 b3 00    	mov    %esi,0xb3f610
  808d46:	e8 52 c2 ff ff       	call   804f9d <tcp_timer_needed>
  return (struct tcp_pcb *)lpcb;
  808d4b:	89 f0                	mov    %esi,%eax
}
  808d4d:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  808d50:	8b 75 fc             	mov    -0x4(%ebp),%esi
  808d53:	89 ec                	mov    %ebp,%esp
  808d55:	5d                   	pop    %ebp
  808d56:	c3                   	ret    
  lpcb->so_options = pcb->so_options;
  lpcb->so_options |= SOF_ACCEPTCONN;
  lpcb->ttl = pcb->ttl;
  lpcb->tos = pcb->tos;
  ip_addr_set(&lpcb->local_ip, &pcb->local_ip);
  TCP_RMV(&tcp_bound_pcbs, pcb);
  808d57:	a3 14 f6 b3 00       	mov    %eax,0xb3f614
  808d5c:	eb bc                	jmp    808d1a <tcp_listen_with_backlog+0xc1>

00808d5e <tcp_bind>:
 * @return ERR_USE if the port is already in use
 *         ERR_OK if bound
 */
err_t
tcp_bind(struct tcp_pcb *pcb, struct ip_addr *ipaddr, u16_t port)
{
  808d5e:	55                   	push   %ebp
  808d5f:	89 e5                	mov    %esp,%ebp
  808d61:	57                   	push   %edi
  808d62:	56                   	push   %esi
  808d63:	53                   	push   %ebx
  808d64:	83 ec 1c             	sub    $0x1c,%esp
  808d67:	8b 75 08             	mov    0x8(%ebp),%esi
  808d6a:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  808d6d:	0f b7 45 10          	movzwl 0x10(%ebp),%eax
  struct tcp_pcb *cpcb;

  LWIP_ERROR("tcp_connect: can only bind in state CLOSED", pcb->state == CLOSED, return ERR_ISCONN);
  808d71:	83 7e 10 00          	cmpl   $0x0,0x10(%esi)
  808d75:	74 1c                	je     808d93 <tcp_bind+0x35>
  808d77:	c7 44 24 08 b0 3a 81 	movl   $0x813ab0,0x8(%esp)
  808d7e:	00 
  808d7f:	c7 44 24 04 05 01 00 	movl   $0x105,0x4(%esp)
  808d86:	00 
  808d87:	c7 04 24 47 3a 81 00 	movl   $0x813a47,(%esp)
  808d8e:	e8 09 7c ff ff       	call   80099c <_panic>

  if (port == 0) {
  808d93:	66 85 c0             	test   %ax,%ax
  808d96:	75 05                	jne    808d9d <tcp_bind+0x3f>
    port = tcp_new_port();
  808d98:	e8 fd f9 ff ff       	call   80879a <tcp_new_port>
  }
  /* Check if the address already is in use. */
  /* Check the listen pcbs. */
  for(cpcb = (struct tcp_pcb *)tcp_listen_pcbs.pcbs;
  808d9d:	8b 15 10 f6 b3 00    	mov    0xb3f610,%edx
  808da3:	85 d2                	test   %edx,%edx
  808da5:	74 39                	je     808de0 <tcp_bind+0x82>
      cpcb != NULL; cpcb = cpcb->next) {
    if (cpcb->local_port == port) {
  808da7:	66 39 42 1c          	cmp    %ax,0x1c(%edx)
  808dab:	75 2c                	jne    808dd9 <tcp_bind+0x7b>
      if (ip_addr_isany(&(cpcb->local_ip)) ||
  808dad:	85 d2                	test   %edx,%edx
  808daf:	0f 84 e1 00 00 00    	je     808e96 <tcp_bind+0x138>
  808db5:	8b 0a                	mov    (%edx),%ecx
  808db7:	85 c9                	test   %ecx,%ecx
  808db9:	0f 84 d7 00 00 00    	je     808e96 <tcp_bind+0x138>
  808dbf:	85 db                	test   %ebx,%ebx
  808dc1:	0f 84 cf 00 00 00    	je     808e96 <tcp_bind+0x138>
          ip_addr_isany(ipaddr) ||
  808dc7:	8b 3b                	mov    (%ebx),%edi
  /* Check if the address already is in use. */
  /* Check the listen pcbs. */
  for(cpcb = (struct tcp_pcb *)tcp_listen_pcbs.pcbs;
      cpcb != NULL; cpcb = cpcb->next) {
    if (cpcb->local_port == port) {
      if (ip_addr_isany(&(cpcb->local_ip)) ||
  808dc9:	85 ff                	test   %edi,%edi
  808dcb:	0f 84 c5 00 00 00    	je     808e96 <tcp_bind+0x138>
  808dd1:	39 f9                	cmp    %edi,%ecx
  808dd3:	0f 84 bd 00 00 00    	je     808e96 <tcp_bind+0x138>
    port = tcp_new_port();
  }
  /* Check if the address already is in use. */
  /* Check the listen pcbs. */
  for(cpcb = (struct tcp_pcb *)tcp_listen_pcbs.pcbs;
      cpcb != NULL; cpcb = cpcb->next) {
  808dd9:	8b 52 0c             	mov    0xc(%edx),%edx
  if (port == 0) {
    port = tcp_new_port();
  }
  /* Check if the address already is in use. */
  /* Check the listen pcbs. */
  for(cpcb = (struct tcp_pcb *)tcp_listen_pcbs.pcbs;
  808ddc:	85 d2                	test   %edx,%edx
  808dde:	75 c7                	jne    808da7 <tcp_bind+0x49>
        return ERR_USE;
      }
    }
  }
  /* Check the connected pcbs. */
  for(cpcb = tcp_active_pcbs;
  808de0:	8b 15 08 f6 b3 00    	mov    0xb3f608,%edx
  808de6:	85 d2                	test   %edx,%edx
  808de8:	74 35                	je     808e1f <tcp_bind+0xc1>
      cpcb != NULL; cpcb = cpcb->next) {
    if (cpcb->local_port == port) {
  808dea:	66 39 42 1c          	cmp    %ax,0x1c(%edx)
  808dee:	75 28                	jne    808e18 <tcp_bind+0xba>
      if (ip_addr_isany(&(cpcb->local_ip)) ||
  808df0:	85 d2                	test   %edx,%edx
  808df2:	0f 84 9e 00 00 00    	je     808e96 <tcp_bind+0x138>
  808df8:	8b 0a                	mov    (%edx),%ecx
  808dfa:	85 c9                	test   %ecx,%ecx
  808dfc:	0f 84 94 00 00 00    	je     808e96 <tcp_bind+0x138>
  808e02:	85 db                	test   %ebx,%ebx
  808e04:	0f 84 8c 00 00 00    	je     808e96 <tcp_bind+0x138>
          ip_addr_isany(ipaddr) ||
  808e0a:	8b 3b                	mov    (%ebx),%edi
  }
  /* Check the connected pcbs. */
  for(cpcb = tcp_active_pcbs;
      cpcb != NULL; cpcb = cpcb->next) {
    if (cpcb->local_port == port) {
      if (ip_addr_isany(&(cpcb->local_ip)) ||
  808e0c:	85 ff                	test   %edi,%edi
  808e0e:	0f 84 82 00 00 00    	je     808e96 <tcp_bind+0x138>
  808e14:	39 f9                	cmp    %edi,%ecx
  808e16:	74 7e                	je     808e96 <tcp_bind+0x138>
      }
    }
  }
  /* Check the connected pcbs. */
  for(cpcb = tcp_active_pcbs;
      cpcb != NULL; cpcb = cpcb->next) {
  808e18:	8b 52 0c             	mov    0xc(%edx),%edx
        return ERR_USE;
      }
    }
  }
  /* Check the connected pcbs. */
  for(cpcb = tcp_active_pcbs;
  808e1b:	85 d2                	test   %edx,%edx
  808e1d:	75 cb                	jne    808dea <tcp_bind+0x8c>
        return ERR_USE;
      }
    }
  }
  /* Check the bound, not yet connected pcbs. */
  for(cpcb = tcp_bound_pcbs; cpcb != NULL; cpcb = cpcb->next) {
  808e1f:	8b 15 18 f6 b3 00    	mov    0xb3f618,%edx
  808e25:	85 d2                	test   %edx,%edx
  808e27:	74 25                	je     808e4e <tcp_bind+0xf0>
    if (cpcb->local_port == port) {
  808e29:	66 39 42 1c          	cmp    %ax,0x1c(%edx)
  808e2d:	75 18                	jne    808e47 <tcp_bind+0xe9>
      if (ip_addr_isany(&(cpcb->local_ip)) ||
  808e2f:	85 d2                	test   %edx,%edx
  808e31:	74 63                	je     808e96 <tcp_bind+0x138>
  808e33:	8b 0a                	mov    (%edx),%ecx
  808e35:	85 c9                	test   %ecx,%ecx
  808e37:	74 5d                	je     808e96 <tcp_bind+0x138>
  808e39:	85 db                	test   %ebx,%ebx
  808e3b:	74 59                	je     808e96 <tcp_bind+0x138>
          ip_addr_isany(ipaddr) ||
  808e3d:	8b 3b                	mov    (%ebx),%edi
    }
  }
  /* Check the bound, not yet connected pcbs. */
  for(cpcb = tcp_bound_pcbs; cpcb != NULL; cpcb = cpcb->next) {
    if (cpcb->local_port == port) {
      if (ip_addr_isany(&(cpcb->local_ip)) ||
  808e3f:	85 ff                	test   %edi,%edi
  808e41:	74 53                	je     808e96 <tcp_bind+0x138>
  808e43:	39 f9                	cmp    %edi,%ecx
  808e45:	74 4f                	je     808e96 <tcp_bind+0x138>
        return ERR_USE;
      }
    }
  }
  /* Check the bound, not yet connected pcbs. */
  for(cpcb = tcp_bound_pcbs; cpcb != NULL; cpcb = cpcb->next) {
  808e47:	8b 52 0c             	mov    0xc(%edx),%edx
  808e4a:	85 d2                	test   %edx,%edx
  808e4c:	75 db                	jne    808e29 <tcp_bind+0xcb>
      }
    }
  }
  /* @todo: until SO_REUSEADDR is implemented (see task #6995 on savannah),
   * we have to check the pcbs in TIME-WAIT state, also: */
  for(cpcb = tcp_tw_pcbs; cpcb != NULL; cpcb = cpcb->next) {
  808e4e:	8b 15 1c f6 b3 00    	mov    0xb3f61c,%edx
  808e54:	85 d2                	test   %edx,%edx
  808e56:	74 13                	je     808e6b <tcp_bind+0x10d>
    if (cpcb->local_port == port) {
  808e58:	66 39 42 1c          	cmp    %ax,0x1c(%edx)
  808e5c:	75 06                	jne    808e64 <tcp_bind+0x106>
      if (ip_addr_cmp(&(cpcb->local_ip), ipaddr)) {
  808e5e:	8b 0a                	mov    (%edx),%ecx
  808e60:	3b 0b                	cmp    (%ebx),%ecx
  808e62:	74 32                	je     808e96 <tcp_bind+0x138>
      }
    }
  }
  /* @todo: until SO_REUSEADDR is implemented (see task #6995 on savannah),
   * we have to check the pcbs in TIME-WAIT state, also: */
  for(cpcb = tcp_tw_pcbs; cpcb != NULL; cpcb = cpcb->next) {
  808e64:	8b 52 0c             	mov    0xc(%edx),%edx
  808e67:	85 d2                	test   %edx,%edx
  808e69:	75 ed                	jne    808e58 <tcp_bind+0xfa>
        return ERR_USE;
      }
    }
  }

  if (!ip_addr_isany(ipaddr)) {
  808e6b:	85 db                	test   %ebx,%ebx
  808e6d:	74 09                	je     808e78 <tcp_bind+0x11a>
  808e6f:	83 3b 00             	cmpl   $0x0,(%ebx)
  808e72:	74 04                	je     808e78 <tcp_bind+0x11a>
    pcb->local_ip = *ipaddr;
  808e74:	8b 13                	mov    (%ebx),%edx
  808e76:	89 16                	mov    %edx,(%esi)
  }
  pcb->local_port = port;
  808e78:	66 89 46 1c          	mov    %ax,0x1c(%esi)
  TCP_REG(&tcp_bound_pcbs, pcb);
  808e7c:	a1 18 f6 b3 00       	mov    0xb3f618,%eax
  808e81:	89 46 0c             	mov    %eax,0xc(%esi)
  808e84:	89 35 18 f6 b3 00    	mov    %esi,0xb3f618
  808e8a:	e8 0e c1 ff ff       	call   804f9d <tcp_timer_needed>
  808e8f:	b8 00 00 00 00       	mov    $0x0,%eax
  LWIP_DEBUGF(TCP_DEBUG, ("tcp_bind: bind to port %"U16_F"\n", port));
  return ERR_OK;
  808e94:	eb 05                	jmp    808e9b <tcp_bind+0x13d>
  808e96:	b8 f5 ff ff ff       	mov    $0xfffffff5,%eax
}
  808e9b:	83 c4 1c             	add    $0x1c,%esp
  808e9e:	5b                   	pop    %ebx
  808e9f:	5e                   	pop    %esi
  808ea0:	5f                   	pop    %edi
  808ea1:	5d                   	pop    %ebp
  808ea2:	c3                   	ret    

00808ea3 <tcp_connect>:
 *         other err_t values if connect request couldn't be sent
 */
err_t
tcp_connect(struct tcp_pcb *pcb, struct ip_addr *ipaddr, u16_t port,
      err_t (* connected)(void *arg, struct tcp_pcb *tpcb, err_t err))
{
  808ea3:	55                   	push   %ebp
  808ea4:	89 e5                	mov    %esp,%ebp
  808ea6:	57                   	push   %edi
  808ea7:	56                   	push   %esi
  808ea8:	53                   	push   %ebx
  808ea9:	83 ec 3c             	sub    $0x3c,%esp
  808eac:	8b 5d 08             	mov    0x8(%ebp),%ebx
  808eaf:	8b 7d 0c             	mov    0xc(%ebp),%edi
  808eb2:	0f b7 45 10          	movzwl 0x10(%ebp),%eax
  u32_t optdata;
  err_t ret;
  u32_t iss;

  LWIP_ERROR("tcp_connect: can only connected from state CLOSED", pcb->state == CLOSED, return ERR_ISCONN);
  808eb6:	83 7b 10 00          	cmpl   $0x0,0x10(%ebx)
  808eba:	74 1c                	je     808ed8 <tcp_connect+0x35>
  808ebc:	c7 44 24 08 dc 3a 81 	movl   $0x813adc,0x8(%esp)
  808ec3:	00 
  808ec4:	c7 44 24 04 ec 01 00 	movl   $0x1ec,0x4(%esp)
  808ecb:	00 
  808ecc:	c7 04 24 47 3a 81 00 	movl   $0x813a47,(%esp)
  808ed3:	e8 c4 7a ff ff       	call   80099c <_panic>

  LWIP_DEBUGF(TCP_DEBUG, ("tcp_connect to port %"U16_F"\n", port));
  if (ipaddr != NULL) {
  808ed8:	be f7 ff ff ff       	mov    $0xfffffff7,%esi
  808edd:	85 ff                	test   %edi,%edi
  808edf:	0f 84 28 01 00 00    	je     80900d <tcp_connect+0x16a>
    pcb->remote_ip = *ipaddr;
  808ee5:	8b 17                	mov    (%edi),%edx
  808ee7:	89 53 04             	mov    %edx,0x4(%ebx)
  } else {
    return ERR_VAL;
  }
  pcb->remote_port = port;
  808eea:	66 89 43 1e          	mov    %ax,0x1e(%ebx)
  if (pcb->local_port == 0) {
  808eee:	66 83 7b 1c 00       	cmpw   $0x0,0x1c(%ebx)
  808ef3:	75 09                	jne    808efe <tcp_connect+0x5b>
    pcb->local_port = tcp_new_port();
  808ef5:	e8 a0 f8 ff ff       	call   80879a <tcp_new_port>
  808efa:	66 89 43 1c          	mov    %ax,0x1c(%ebx)
  }
  iss = tcp_next_iss();
  808efe:	e8 cb f9 ff ff       	call   8088ce <tcp_next_iss>
  pcb->rcv_nxt = 0;
  808f03:	c7 43 24 00 00 00 00 	movl   $0x0,0x24(%ebx)
  pcb->snd_nxt = iss;
  808f0a:	89 43 54             	mov    %eax,0x54(%ebx)
  pcb->lastack = iss - 1;
  808f0d:	83 e8 01             	sub    $0x1,%eax
  808f10:	89 43 48             	mov    %eax,0x48(%ebx)
  pcb->snd_lbb = iss - 1;
  808f13:	89 43 68             	mov    %eax,0x68(%ebx)
  pcb->rcv_wnd = TCP_WND;
  808f16:	66 c7 43 28 c0 5d    	movw   $0x5dc0,0x28(%ebx)
  pcb->rcv_ann_wnd = TCP_WND;
  808f1c:	66 c7 43 2a c0 5d    	movw   $0x5dc0,0x2a(%ebx)
  pcb->snd_wnd = TCP_WND;
  808f22:	66 c7 43 5c c0 5d    	movw   $0x5dc0,0x5c(%ebx)
  /* As initial send MSS, we use TCP_MSS but limit it to 536.
     The send MSS is updated when an MSS option is received. */
  pcb->mss = (TCP_MSS > 536) ? 536 : TCP_MSS;
  808f28:	66 c7 43 34 18 02    	movw   $0x218,0x34(%ebx)
#if TCP_CALCULATE_EFF_SEND_MSS
  pcb->mss = tcp_eff_send_mss(pcb->mss, ipaddr);
  808f2e:	89 7c 24 04          	mov    %edi,0x4(%esp)
  808f32:	c7 04 24 18 02 00 00 	movl   $0x218,(%esp)
  808f39:	e8 a5 f9 ff ff       	call   8088e3 <tcp_eff_send_mss>
  808f3e:	66 89 43 34          	mov    %ax,0x34(%ebx)
#endif /* TCP_CALCULATE_EFF_SEND_MSS */
  pcb->cwnd = 1;
  808f42:	66 c7 43 4e 01 00    	movw   $0x1,0x4e(%ebx)
  pcb->ssthresh = pcb->mss * 10;
  808f48:	8d 04 80             	lea    (%eax,%eax,4),%eax
  808f4b:	01 c0                	add    %eax,%eax
  808f4d:	66 89 43 50          	mov    %ax,0x50(%ebx)
  pcb->state = SYN_SENT;
  808f51:	c7 43 10 02 00 00 00 	movl   $0x2,0x10(%ebx)
#if LWIP_CALLBACK_API  
  pcb->connected = connected;
  808f58:	8b 45 14             	mov    0x14(%ebp),%eax
  808f5b:	89 83 8c 00 00 00    	mov    %eax,0x8c(%ebx)
#endif /* LWIP_CALLBACK_API */
  TCP_RMV(&tcp_bound_pcbs, pcb);
  808f61:	8b 15 18 f6 b3 00    	mov    0xb3f618,%edx
  808f67:	39 da                	cmp    %ebx,%edx
  808f69:	75 0a                	jne    808f75 <tcp_connect+0xd2>
  808f6b:	8b 42 0c             	mov    0xc(%edx),%eax
  808f6e:	a3 18 f6 b3 00       	mov    %eax,0xb3f618
  808f73:	eb 2a                	jmp    808f9f <tcp_connect+0xfc>
  808f75:	89 15 14 f6 b3 00    	mov    %edx,0xb3f614
  808f7b:	85 d2                	test   %edx,%edx
  808f7d:	74 20                	je     808f9f <tcp_connect+0xfc>
  808f7f:	8b 42 0c             	mov    0xc(%edx),%eax
  808f82:	85 c0                	test   %eax,%eax
  808f84:	0f 84 8d 00 00 00    	je     809017 <tcp_connect+0x174>
  808f8a:	39 c3                	cmp    %eax,%ebx
  808f8c:	75 08                	jne    808f96 <tcp_connect+0xf3>
  808f8e:	8b 43 0c             	mov    0xc(%ebx),%eax
  808f91:	89 42 0c             	mov    %eax,0xc(%edx)
  808f94:	eb 09                	jmp    808f9f <tcp_connect+0xfc>
  808f96:	a3 14 f6 b3 00       	mov    %eax,0xb3f614
  808f9b:	89 c2                	mov    %eax,%edx
  808f9d:	eb e0                	jmp    808f7f <tcp_connect+0xdc>
  808f9f:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
  TCP_REG(&tcp_active_pcbs, pcb);
  808fa6:	a1 08 f6 b3 00       	mov    0xb3f608,%eax
  808fab:	89 43 0c             	mov    %eax,0xc(%ebx)
  808fae:	89 1d 08 f6 b3 00    	mov    %ebx,0xb3f608
  808fb4:	e8 e4 bf ff ff       	call   804f9d <tcp_timer_needed>

  snmp_inc_tcpactiveopens();
  
  /* Build an MSS option */
  optdata = TCP_BUILD_MSS_OPTION();
  808fb9:	c7 04 24 b4 05 04 02 	movl   $0x20405b4,(%esp)
  808fc0:	e8 4f 1d 00 00       	call   80ad14 <htonl>
  808fc5:	89 45 e4             	mov    %eax,-0x1c(%ebp)

  ret = tcp_enqueue(pcb, NULL, 0, TCP_SYN, 0, (u8_t *)&optdata, 4);
  808fc8:	c7 44 24 18 04 00 00 	movl   $0x4,0x18(%esp)
  808fcf:	00 
  808fd0:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  808fd3:	89 44 24 14          	mov    %eax,0x14(%esp)
  808fd7:	c7 44 24 10 00 00 00 	movl   $0x0,0x10(%esp)
  808fde:	00 
  808fdf:	c7 44 24 0c 02 00 00 	movl   $0x2,0xc(%esp)
  808fe6:	00 
  808fe7:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  808fee:	00 
  808fef:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  808ff6:	00 
  808ff7:	89 1c 24             	mov    %ebx,(%esp)
  808ffa:	e8 c9 28 00 00       	call   80b8c8 <tcp_enqueue>
  808fff:	89 c6                	mov    %eax,%esi
  if (ret == ERR_OK) { 
  809001:	84 c0                	test   %al,%al
  809003:	75 08                	jne    80900d <tcp_connect+0x16a>
    tcp_output(pcb);
  809005:	89 1c 24             	mov    %ebx,(%esp)
  809008:	e8 6e 23 00 00       	call   80b37b <tcp_output>
  }
  return ret;
} 
  80900d:	89 f0                	mov    %esi,%eax
  80900f:	83 c4 3c             	add    $0x3c,%esp
  809012:	5b                   	pop    %ebx
  809013:	5e                   	pop    %esi
  809014:	5f                   	pop    %edi
  809015:	5d                   	pop    %ebp
  809016:	c3                   	ret    
  pcb->ssthresh = pcb->mss * 10;
  pcb->state = SYN_SENT;
#if LWIP_CALLBACK_API  
  pcb->connected = connected;
#endif /* LWIP_CALLBACK_API */
  TCP_RMV(&tcp_bound_pcbs, pcb);
  809017:	a3 14 f6 b3 00       	mov    %eax,0xb3f614
  80901c:	eb 81                	jmp    808f9f <tcp_connect+0xfc>

0080901e <tcp_abort>:
 *
 * @param pcb the tcp_pcb to abort
 */
void
tcp_abort(struct tcp_pcb *pcb)
{
  80901e:	55                   	push   %ebp
  80901f:	89 e5                	mov    %esp,%ebp
  809021:	57                   	push   %edi
  809022:	56                   	push   %esi
  809023:	53                   	push   %ebx
  809024:	83 ec 4c             	sub    $0x4c,%esp
  809027:	8b 5d 08             	mov    0x8(%ebp),%ebx

  
  /* Figure out on which TCP PCB list we are, and remove us. If we
     are in an active state, call the receive function associated with
     the PCB with a NULL argument, and send an RST to the remote end. */
  if (pcb->state == TIME_WAIT) {
  80902a:	83 7b 10 0a          	cmpl   $0xa,0x10(%ebx)
  80902e:	75 25                	jne    809055 <tcp_abort+0x37>
    tcp_pcb_remove(&tcp_tw_pcbs, pcb);
  809030:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  809034:	c7 04 24 1c f6 b3 00 	movl   $0xb3f61c,(%esp)
  80903b:	e8 20 fb ff ff       	call   808b60 <tcp_pcb_remove>
    memp_free(MEMP_TCP_PCB, pcb);
  809040:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  809044:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  80904b:	e8 24 e7 ff ff       	call   807774 <memp_free>
  809050:	e9 d1 00 00 00       	jmp    809126 <tcp_abort+0x108>
  } else {
    seqno = pcb->snd_nxt;
  809055:	8b 43 54             	mov    0x54(%ebx),%eax
  809058:	89 45 d0             	mov    %eax,-0x30(%ebp)
    ackno = pcb->rcv_nxt;
  80905b:	8b 7b 24             	mov    0x24(%ebx),%edi
    ip_addr_set(&local_ip, &(pcb->local_ip));
  80905e:	b8 00 00 00 00       	mov    $0x0,%eax
  809063:	85 db                	test   %ebx,%ebx
  809065:	74 02                	je     809069 <tcp_abort+0x4b>
  809067:	8b 03                	mov    (%ebx),%eax
  809069:	89 45 e0             	mov    %eax,-0x20(%ebp)
    ip_addr_set(&remote_ip, &(pcb->remote_ip));
  80906c:	b8 00 00 00 00       	mov    $0x0,%eax
  809071:	83 fb fc             	cmp    $0xfffffffc,%ebx
  809074:	74 03                	je     809079 <tcp_abort+0x5b>
  809076:	8b 43 04             	mov    0x4(%ebx),%eax
  809079:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    local_port = pcb->local_port;
  80907c:	0f b7 43 1c          	movzwl 0x1c(%ebx),%eax
  809080:	66 89 45 d6          	mov    %ax,-0x2a(%ebp)
    remote_port = pcb->remote_port;
  809084:	0f b7 43 1e          	movzwl 0x1e(%ebx),%eax
  809088:	66 89 45 d4          	mov    %ax,-0x2c(%ebp)
#if LWIP_CALLBACK_API
    errf = pcb->errf;
  80908c:	8b b3 98 00 00 00    	mov    0x98(%ebx),%esi
#endif /* LWIP_CALLBACK_API */
    errf_arg = pcb->callback_arg;
  809092:	8b 43 18             	mov    0x18(%ebx),%eax
  809095:	89 45 cc             	mov    %eax,-0x34(%ebp)
    tcp_pcb_remove(&tcp_active_pcbs, pcb);
  809098:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  80909c:	c7 04 24 08 f6 b3 00 	movl   $0xb3f608,(%esp)
  8090a3:	e8 b8 fa ff ff       	call   808b60 <tcp_pcb_remove>
    if (pcb->unacked != NULL) {
  8090a8:	8b 43 78             	mov    0x78(%ebx),%eax
  8090ab:	85 c0                	test   %eax,%eax
  8090ad:	74 08                	je     8090b7 <tcp_abort+0x99>
      tcp_segs_free(pcb->unacked);
  8090af:	89 04 24             	mov    %eax,(%esp)
  8090b2:	e8 ff f9 ff ff       	call   808ab6 <tcp_segs_free>
    }
    if (pcb->unsent != NULL) {
  8090b7:	8b 43 74             	mov    0x74(%ebx),%eax
  8090ba:	85 c0                	test   %eax,%eax
  8090bc:	74 08                	je     8090c6 <tcp_abort+0xa8>
      tcp_segs_free(pcb->unsent);
  8090be:	89 04 24             	mov    %eax,(%esp)
  8090c1:	e8 f0 f9 ff ff       	call   808ab6 <tcp_segs_free>
    }
#if TCP_QUEUE_OOSEQ    
    if (pcb->ooseq != NULL) {
  8090c6:	8b 43 7c             	mov    0x7c(%ebx),%eax
  8090c9:	85 c0                	test   %eax,%eax
  8090cb:	74 08                	je     8090d5 <tcp_abort+0xb7>
      tcp_segs_free(pcb->ooseq);
  8090cd:	89 04 24             	mov    %eax,(%esp)
  8090d0:	e8 e1 f9 ff ff       	call   808ab6 <tcp_segs_free>
    }
#endif /* TCP_QUEUE_OOSEQ */
    memp_free(MEMP_TCP_PCB, pcb);
  8090d5:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  8090d9:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  8090e0:	e8 8f e6 ff ff       	call   807774 <memp_free>
    TCP_EVENT_ERR(errf, errf_arg, ERR_ABRT);
  8090e5:	85 f6                	test   %esi,%esi
  8090e7:	74 10                	je     8090f9 <tcp_abort+0xdb>
  8090e9:	c7 44 24 04 fb ff ff 	movl   $0xfffffffb,0x4(%esp)
  8090f0:	ff 
  8090f1:	8b 45 cc             	mov    -0x34(%ebp),%eax
  8090f4:	89 04 24             	mov    %eax,(%esp)
  8090f7:	ff d6                	call   *%esi
    LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_abort: sending RST\n"));
    tcp_rst(seqno, ackno, &local_ip, &remote_ip, local_port, remote_port);
  8090f9:	0f b7 45 d4          	movzwl -0x2c(%ebp),%eax
  8090fd:	89 44 24 14          	mov    %eax,0x14(%esp)
  809101:	0f b7 45 d6          	movzwl -0x2a(%ebp),%eax
  809105:	89 44 24 10          	mov    %eax,0x10(%esp)
  809109:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80910c:	89 44 24 0c          	mov    %eax,0xc(%esp)
  809110:	8d 45 e0             	lea    -0x20(%ebp),%eax
  809113:	89 44 24 08          	mov    %eax,0x8(%esp)
  809117:	89 7c 24 04          	mov    %edi,0x4(%esp)
  80911b:	8b 45 d0             	mov    -0x30(%ebp),%eax
  80911e:	89 04 24             	mov    %eax,(%esp)
  809121:	e8 f6 20 00 00       	call   80b21c <tcp_rst>
  }
}
  809126:	83 c4 4c             	add    $0x4c,%esp
  809129:	5b                   	pop    %ebx
  80912a:	5e                   	pop    %esi
  80912b:	5f                   	pop    %edi
  80912c:	5d                   	pop    %ebp
  80912d:	c3                   	ret    

0080912e <tcp_alloc>:
 * @param prio priority for the new pcb
 * @return a new tcp_pcb that initially is in state CLOSED
 */
struct tcp_pcb *
tcp_alloc(u8_t prio)
{
  80912e:	55                   	push   %ebp
  80912f:	89 e5                	mov    %esp,%ebp
  809131:	83 ec 38             	sub    $0x38,%esp
  809134:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  809137:	89 75 f8             	mov    %esi,-0x8(%ebp)
  80913a:	89 7d fc             	mov    %edi,-0x4(%ebp)
  80913d:	0f b6 75 08          	movzbl 0x8(%ebp),%esi
  struct tcp_pcb *pcb;
  u32_t iss;
  
  pcb = memp_malloc(MEMP_TCP_PCB);
  809141:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  809148:	e8 6b e6 ff ff       	call   8077b8 <memp_malloc>
  80914d:	89 c3                	mov    %eax,%ebx
  if (pcb == NULL) {
  80914f:	85 c0                	test   %eax,%eax
  809151:	0f 85 c9 00 00 00    	jne    809220 <tcp_alloc+0xf2>
  u32_t inactivity;

  inactivity = 0;
  inactive = NULL;
  /* Go through the list of TIME_WAIT pcbs and get the oldest pcb. */
  for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
  809157:	a1 1c f6 b3 00       	mov    0xb3f61c,%eax
  80915c:	85 c0                	test   %eax,%eax
  80915e:	74 36                	je     809196 <tcp_alloc+0x68>
    if ((u32_t)(tcp_ticks - pcb->tmr) >= inactivity) {
  809160:	8b 1d 0c f6 b3 00    	mov    0xb3f60c,%ebx
  809166:	bf 00 00 00 00       	mov    $0x0,%edi
  80916b:	b9 00 00 00 00       	mov    $0x0,%ecx
  809170:	89 da                	mov    %ebx,%edx
  809172:	2b 50 2c             	sub    0x2c(%eax),%edx
  809175:	39 ca                	cmp    %ecx,%edx
  809177:	72 04                	jb     80917d <tcp_alloc+0x4f>
  809179:	89 c7                	mov    %eax,%edi
  80917b:	eb 02                	jmp    80917f <tcp_alloc+0x51>
  80917d:	89 ca                	mov    %ecx,%edx
  u32_t inactivity;

  inactivity = 0;
  inactive = NULL;
  /* Go through the list of TIME_WAIT pcbs and get the oldest pcb. */
  for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
  80917f:	8b 40 0c             	mov    0xc(%eax),%eax
  809182:	85 c0                	test   %eax,%eax
  809184:	74 04                	je     80918a <tcp_alloc+0x5c>
  809186:	89 d1                	mov    %edx,%ecx
  809188:	eb e6                	jmp    809170 <tcp_alloc+0x42>
    if ((u32_t)(tcp_ticks - pcb->tmr) >= inactivity) {
      inactivity = tcp_ticks - pcb->tmr;
      inactive = pcb;
    }
  }
  if (inactive != NULL) {
  80918a:	85 ff                	test   %edi,%edi
  80918c:	74 08                	je     809196 <tcp_alloc+0x68>
    LWIP_DEBUGF(TCP_DEBUG, ("tcp_kill_timewait: killing oldest TIME-WAIT PCB %p (%"S32_F")\n",
           (void *)inactive, inactivity));
    tcp_abort(inactive);
  80918e:	89 3c 24             	mov    %edi,(%esp)
  809191:	e8 88 fe ff ff       	call   80901e <tcp_abort>
  if (pcb == NULL) {
    /* Try killing oldest connection in TIME-WAIT. */
    LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing off oldest TIME-WAIT connection\n"));
    tcp_kill_timewait();
    /* Try to allocate a tcp_pcb again. */
    pcb = memp_malloc(MEMP_TCP_PCB);
  809196:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  80919d:	e8 16 e6 ff ff       	call   8077b8 <memp_malloc>
  8091a2:	89 c3                	mov    %eax,%ebx
    if (pcb == NULL) {
  8091a4:	85 c0                	test   %eax,%eax
  8091a6:	75 78                	jne    809220 <tcp_alloc+0xf2>
  mprio = TCP_PRIO_MAX;
  
  /* We kill the oldest active connection that has lower priority than prio. */
  inactivity = 0;
  inactive = NULL;
  for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  8091a8:	a1 08 f6 b3 00       	mov    0xb3f608,%eax
  8091ad:	85 c0                	test   %eax,%eax
  8091af:	74 59                	je     80920a <tcp_alloc+0xdc>
    if (pcb->prio <= prio &&
       pcb->prio <= mprio &&
       (u32_t)(tcp_ticks - pcb->tmr) >= inactivity) {
  8091b1:	8b 15 0c f6 b3 00    	mov    0xb3f60c,%edx
  8091b7:	89 55 e0             	mov    %edx,-0x20(%ebp)
  8091ba:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  8091c1:	bf 00 00 00 00       	mov    $0x0,%edi
  8091c6:	b9 7f 00 00 00       	mov    $0x7f,%ecx
  
  /* We kill the oldest active connection that has lower priority than prio. */
  inactivity = 0;
  inactive = NULL;
  for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
    if (pcb->prio <= prio &&
  8091cb:	0f b6 50 14          	movzbl 0x14(%eax),%edx
  8091cf:	89 f3                	mov    %esi,%ebx
  8091d1:	38 d3                	cmp    %dl,%bl
  8091d3:	72 13                	jb     8091e8 <tcp_alloc+0xba>
  8091d5:	38 ca                	cmp    %cl,%dl
  8091d7:	77 0f                	ja     8091e8 <tcp_alloc+0xba>
       pcb->prio <= mprio &&
       (u32_t)(tcp_ticks - pcb->tmr) >= inactivity) {
  8091d9:	8b 5d e0             	mov    -0x20(%ebp),%ebx
  8091dc:	2b 58 2c             	sub    0x2c(%eax),%ebx
  
  /* We kill the oldest active connection that has lower priority than prio. */
  inactivity = 0;
  inactive = NULL;
  for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
    if (pcb->prio <= prio &&
  8091df:	39 df                	cmp    %ebx,%edi
  8091e1:	77 05                	ja     8091e8 <tcp_alloc+0xba>
  8091e3:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8091e6:	eb 04                	jmp    8091ec <tcp_alloc+0xbe>
  8091e8:	89 ca                	mov    %ecx,%edx
  8091ea:	89 fb                	mov    %edi,%ebx
  mprio = TCP_PRIO_MAX;
  
  /* We kill the oldest active connection that has lower priority than prio. */
  inactivity = 0;
  inactive = NULL;
  for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  8091ec:	8b 40 0c             	mov    0xc(%eax),%eax
  8091ef:	85 c0                	test   %eax,%eax
  8091f1:	74 06                	je     8091f9 <tcp_alloc+0xcb>
  8091f3:	89 df                	mov    %ebx,%edi
  8091f5:	89 d1                	mov    %edx,%ecx
  8091f7:	eb d2                	jmp    8091cb <tcp_alloc+0x9d>
      inactivity = tcp_ticks - pcb->tmr;
      inactive = pcb;
      mprio = pcb->prio;
    }
  }
  if (inactive != NULL) {
  8091f9:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  8091fd:	74 0b                	je     80920a <tcp_alloc+0xdc>
    LWIP_DEBUGF(TCP_DEBUG, ("tcp_kill_prio: killing oldest PCB %p (%"S32_F")\n",
           (void *)inactive, inactivity));
    tcp_abort(inactive);
  8091ff:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  809202:	89 04 24             	mov    %eax,(%esp)
  809205:	e8 14 fe ff ff       	call   80901e <tcp_abort>
    pcb = memp_malloc(MEMP_TCP_PCB);
    if (pcb == NULL) {
      /* Try killing active connections with lower priority than the new one. */
      tcp_kill_prio(prio);
      /* Try to allocate a tcp_pcb again. */
      pcb = memp_malloc(MEMP_TCP_PCB);
  80920a:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  809211:	e8 a2 e5 ff ff       	call   8077b8 <memp_malloc>
  809216:	89 c3                	mov    %eax,%ebx
    }
  }
  if (pcb != NULL) {
  809218:	85 c0                	test   %eax,%eax
  80921a:	0f 84 9b 00 00 00    	je     8092bb <tcp_alloc+0x18d>
    memset(pcb, 0, sizeof(struct tcp_pcb));
  809220:	c7 44 24 08 a8 00 00 	movl   $0xa8,0x8(%esp)
  809227:	00 
  809228:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80922f:	00 
  809230:	89 1c 24             	mov    %ebx,(%esp)
  809233:	e8 4e 80 ff ff       	call   801286 <memset>
    pcb->prio = TCP_PRIO_NORMAL;
  809238:	c6 43 14 40          	movb   $0x40,0x14(%ebx)
    pcb->snd_buf = TCP_SND_BUF;
  80923c:	66 c7 43 6e 40 5b    	movw   $0x5b40,0x6e(%ebx)
    pcb->snd_queuelen = 0;
  809242:	66 c7 43 70 00 00    	movw   $0x0,0x70(%ebx)
    pcb->rcv_wnd = TCP_WND;
  809248:	66 c7 43 28 c0 5d    	movw   $0x5dc0,0x28(%ebx)
    pcb->rcv_ann_wnd = TCP_WND;
  80924e:	66 c7 43 2a c0 5d    	movw   $0x5dc0,0x2a(%ebx)
    pcb->tos = 0;
  809254:	c6 43 0a 00          	movb   $0x0,0xa(%ebx)
    pcb->ttl = TCP_TTL;
  809258:	c6 43 0b ff          	movb   $0xff,0xb(%ebx)
    /* As initial send MSS, we use TCP_MSS but limit it to 536.
       The send MSS is updated when an MSS option is received. */
    pcb->mss = (TCP_MSS > 536) ? 536 : TCP_MSS;
  80925c:	66 c7 43 34 18 02    	movw   $0x218,0x34(%ebx)
    pcb->rto = 3000 / TCP_SLOW_INTERVAL;
  809262:	66 c7 43 44 06 00    	movw   $0x6,0x44(%ebx)
    pcb->sa = 0;
  809268:	66 c7 43 40 00 00    	movw   $0x0,0x40(%ebx)
    pcb->sv = 3000 / TCP_SLOW_INTERVAL;
  80926e:	66 c7 43 42 06 00    	movw   $0x6,0x42(%ebx)
    pcb->rtime = -1;
  809274:	66 c7 43 32 ff ff    	movw   $0xffff,0x32(%ebx)
    pcb->cwnd = 1;
  80927a:	66 c7 43 4e 01 00    	movw   $0x1,0x4e(%ebx)
    iss = tcp_next_iss();
  809280:	e8 49 f6 ff ff       	call   8088ce <tcp_next_iss>
    pcb->snd_wl2 = iss;
  809285:	89 43 64             	mov    %eax,0x64(%ebx)
    pcb->snd_nxt = iss;
  809288:	89 43 54             	mov    %eax,0x54(%ebx)
    pcb->snd_max = iss;
  80928b:	89 43 58             	mov    %eax,0x58(%ebx)
    pcb->lastack = iss;
  80928e:	89 43 48             	mov    %eax,0x48(%ebx)
    pcb->snd_lbb = iss;   
  809291:	89 43 68             	mov    %eax,0x68(%ebx)
    pcb->tmr = tcp_ticks;
  809294:	a1 0c f6 b3 00       	mov    0xb3f60c,%eax
  809299:	89 43 2c             	mov    %eax,0x2c(%ebx)

    pcb->polltmr = 0;
  80929c:	c6 43 30 00          	movb   $0x0,0x30(%ebx)

#if LWIP_CALLBACK_API
    pcb->recv = tcp_recv_null;
  8092a0:	c7 83 88 00 00 00 af 	movl   $0x8098af,0x88(%ebx)
  8092a7:	98 80 00 
#endif /* LWIP_CALLBACK_API */  
    
    /* Init KEEPALIVE timer */
    pcb->keep_idle  = TCP_KEEPIDLE_DEFAULT;
  8092aa:	c7 83 9c 00 00 00 00 	movl   $0x6ddd00,0x9c(%ebx)
  8092b1:	dd 6d 00 
#if LWIP_TCP_KEEPALIVE
    pcb->keep_intvl = TCP_KEEPINTVL_DEFAULT;
    pcb->keep_cnt   = TCP_KEEPCNT_DEFAULT;
#endif /* LWIP_TCP_KEEPALIVE */

    pcb->keep_cnt_sent = 0;
  8092b4:	c6 83 a5 00 00 00 00 	movb   $0x0,0xa5(%ebx)
  }
  return pcb;
}
  8092bb:	89 d8                	mov    %ebx,%eax
  8092bd:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  8092c0:	8b 75 f8             	mov    -0x8(%ebp),%esi
  8092c3:	8b 7d fc             	mov    -0x4(%ebp),%edi
  8092c6:	89 ec                	mov    %ebp,%esp
  8092c8:	5d                   	pop    %ebp
  8092c9:	c3                   	ret    

008092ca <tcp_new>:
 *
 * @return a new tcp_pcb that initially is in state CLOSED
 */
struct tcp_pcb *
tcp_new(void)
{
  8092ca:	55                   	push   %ebp
  8092cb:	89 e5                	mov    %esp,%ebp
  8092cd:	83 ec 18             	sub    $0x18,%esp
  return tcp_alloc(TCP_PRIO_NORMAL);
  8092d0:	c7 04 24 40 00 00 00 	movl   $0x40,(%esp)
  8092d7:	e8 52 fe ff ff       	call   80912e <tcp_alloc>
}
  8092dc:	c9                   	leave  
  8092dd:	c3                   	ret    

008092de <tcp_slowtmr>:
 *
 * Automatically called from tcp_tmr().
 */
void
tcp_slowtmr(void)
{
  8092de:	55                   	push   %ebp
  8092df:	89 e5                	mov    %esp,%ebp
  8092e1:	57                   	push   %edi
  8092e2:	56                   	push   %esi
  8092e3:	53                   	push   %ebx
  8092e4:	83 ec 2c             	sub    $0x2c,%esp
  u8_t pcb_remove;      /* flag if a PCB should be removed */
  err_t err;

  err = ERR_OK;

  ++tcp_ticks;
  8092e7:	83 05 0c f6 b3 00 01 	addl   $0x1,0xb3f60c

  /* Steps through all of the active PCBs. */
  prev = NULL;
  pcb = tcp_active_pcbs;
  8092ee:	8b 1d 08 f6 b3 00    	mov    0xb3f608,%ebx
  if (pcb == NULL) {
    LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: no active pcbs\n"));
  }
  while (pcb != NULL) {
  8092f4:	85 db                	test   %ebx,%ebx
  8092f6:	0f 84 5d 03 00 00    	je     809659 <tcp_slowtmr+0x37b>
    LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: processing active pcb\n"));
    LWIP_ASSERT("tcp_slowtmr: active pcb->state != CLOSED\n", pcb->state != CLOSED);
  8092fc:	8b 43 10             	mov    0x10(%ebx),%eax
  8092ff:	85 c0                	test   %eax,%eax
  809301:	74 1c                	je     80931f <tcp_slowtmr+0x41>
    LWIP_ASSERT("tcp_slowtmr: active pcb->state != LISTEN\n", pcb->state != LISTEN);
  809303:	83 f8 01             	cmp    $0x1,%eax
  809306:	74 38                	je     809340 <tcp_slowtmr+0x62>
    LWIP_ASSERT("tcp_slowtmr: active pcb->state != TIME-WAIT\n", pcb->state != TIME_WAIT);
  809308:	83 f8 0a             	cmp    $0xa,%eax
  80930b:	74 54                	je     809361 <tcp_slowtmr+0x83>
  80930d:	c6 45 e3 00          	movb   $0x0,-0x1d(%ebp)
  809311:	bf 00 00 00 00       	mov    $0x0,%edi
  809316:	eb 67                	jmp    80937f <tcp_slowtmr+0xa1>
  if (pcb == NULL) {
    LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: no active pcbs\n"));
  }
  while (pcb != NULL) {
    LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: processing active pcb\n"));
    LWIP_ASSERT("tcp_slowtmr: active pcb->state != CLOSED\n", pcb->state != CLOSED);
  809318:	8b 46 10             	mov    0x10(%esi),%eax
  80931b:	85 c0                	test   %eax,%eax
  80931d:	75 1c                	jne    80933b <tcp_slowtmr+0x5d>
  80931f:	c7 44 24 08 10 3b 81 	movl   $0x813b10,0x8(%esp)
  809326:	00 
  809327:	c7 44 24 04 36 02 00 	movl   $0x236,0x4(%esp)
  80932e:	00 
  80932f:	c7 04 24 47 3a 81 00 	movl   $0x813a47,(%esp)
  809336:	e8 61 76 ff ff       	call   80099c <_panic>
    LWIP_ASSERT("tcp_slowtmr: active pcb->state != LISTEN\n", pcb->state != LISTEN);
  80933b:	83 f8 01             	cmp    $0x1,%eax
  80933e:	75 1c                	jne    80935c <tcp_slowtmr+0x7e>
  809340:	c7 44 24 08 3c 3b 81 	movl   $0x813b3c,0x8(%esp)
  809347:	00 
  809348:	c7 44 24 04 37 02 00 	movl   $0x237,0x4(%esp)
  80934f:	00 
  809350:	c7 04 24 47 3a 81 00 	movl   $0x813a47,(%esp)
  809357:	e8 40 76 ff ff       	call   80099c <_panic>
    LWIP_ASSERT("tcp_slowtmr: active pcb->state != TIME-WAIT\n", pcb->state != TIME_WAIT);
  80935c:	83 f8 0a             	cmp    $0xa,%eax
  80935f:	75 1c                	jne    80937d <tcp_slowtmr+0x9f>
  809361:	c7 44 24 08 68 3b 81 	movl   $0x813b68,0x8(%esp)
  809368:	00 
  809369:	c7 44 24 04 38 02 00 	movl   $0x238,0x4(%esp)
  809370:	00 
  809371:	c7 04 24 47 3a 81 00 	movl   $0x813a47,(%esp)
  809378:	e8 1f 76 ff ff       	call   80099c <_panic>
  80937d:	89 f3                	mov    %esi,%ebx

    pcb_remove = 0;

    if (pcb->state == SYN_SENT && pcb->nrtx == TCP_SYNMAXRTX) {
  80937f:	83 f8 02             	cmp    $0x2,%eax
  809382:	75 0a                	jne    80938e <tcp_slowtmr+0xb0>
  809384:	80 7b 46 06          	cmpb   $0x6,0x46(%ebx)
  809388:	0f 84 ef 00 00 00    	je     80947d <tcp_slowtmr+0x19f>
      ++pcb_remove;
      LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max SYN retries reached\n"));
    }
    else if (pcb->nrtx == TCP_MAXRTX) {
  80938e:	80 7b 46 0c          	cmpb   $0xc,0x46(%ebx)
  809392:	0f 84 e5 00 00 00    	je     80947d <tcp_slowtmr+0x19f>
      ++pcb_remove;
      LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max DATA retries reached\n"));
    } else {
      if (pcb->persist_backoff > 0) {
  809398:	80 bb a4 00 00 00 00 	cmpb   $0x0,0xa4(%ebx)
  80939f:	90                   	nop
  8093a0:	74 55                	je     8093f7 <tcp_slowtmr+0x119>
        /* If snd_wnd is zero, use persist timer to send 1 byte probes
         * instead of using the standard retransmission mechanism. */
        pcb->persist_cnt++;
  8093a2:	8b 83 a0 00 00 00    	mov    0xa0(%ebx),%eax
  8093a8:	83 c0 01             	add    $0x1,%eax
  8093ab:	89 83 a0 00 00 00    	mov    %eax,0xa0(%ebx)
        if (pcb->persist_cnt >= tcp_persist_backoff[pcb->persist_backoff-1]) {
  8093b1:	0f b6 93 a4 00 00 00 	movzbl 0xa4(%ebx),%edx
  8093b8:	0f b6 92 9c 3c 81 00 	movzbl 0x813c9c(%edx),%edx
  8093bf:	39 d0                	cmp    %edx,%eax
  8093c1:	0f 82 bd 00 00 00    	jb     809484 <tcp_slowtmr+0x1a6>
          pcb->persist_cnt = 0;
  8093c7:	c7 83 a0 00 00 00 00 	movl   $0x0,0xa0(%ebx)
  8093ce:	00 00 00 
          if (pcb->persist_backoff < sizeof(tcp_persist_backoff)) {
  8093d1:	0f b6 83 a4 00 00 00 	movzbl 0xa4(%ebx),%eax
  8093d8:	3c 06                	cmp    $0x6,%al
  8093da:	77 09                	ja     8093e5 <tcp_slowtmr+0x107>
            pcb->persist_backoff++;
  8093dc:	83 c0 01             	add    $0x1,%eax
  8093df:	88 83 a4 00 00 00    	mov    %al,0xa4(%ebx)
          }
          tcp_zero_window_probe(pcb);
  8093e5:	89 1c 24             	mov    %ebx,(%esp)
  8093e8:	e8 63 1b 00 00       	call   80af50 <tcp_zero_window_probe>
  8093ed:	be 00 00 00 00       	mov    $0x0,%esi
  8093f2:	e9 92 00 00 00       	jmp    809489 <tcp_slowtmr+0x1ab>
        }
      } else {
        /* Increase the retransmission timer if it is running */
        if(pcb->rtime >= 0)
  8093f7:	0f b7 43 32          	movzwl 0x32(%ebx),%eax
  8093fb:	66 85 c0             	test   %ax,%ax
  8093fe:	78 07                	js     809407 <tcp_slowtmr+0x129>
          ++pcb->rtime;
  809400:	83 c0 01             	add    $0x1,%eax
  809403:	66 89 43 32          	mov    %ax,0x32(%ebx)

        if (pcb->unacked != NULL && pcb->rtime >= pcb->rto) {
  809407:	83 7b 78 00          	cmpl   $0x0,0x78(%ebx)
  80940b:	74 77                	je     809484 <tcp_slowtmr+0x1a6>
  80940d:	0f b7 43 32          	movzwl 0x32(%ebx),%eax
  809411:	66 3b 43 44          	cmp    0x44(%ebx),%ax
  809415:	7c 6d                	jl     809484 <tcp_slowtmr+0x1a6>
                                      " pcb->rto %"S16_F"\n",
                                      pcb->rtime, pcb->rto));

          /* Double retransmission time-out unless we are trying to
           * connect to somebody (i.e., we are in SYN_SENT). */
          if (pcb->state != SYN_SENT) {
  809417:	83 7b 10 02          	cmpl   $0x2,0x10(%ebx)
  80941b:	74 20                	je     80943d <tcp_slowtmr+0x15f>
            pcb->rto = ((pcb->sa >> 3) + pcb->sv) << tcp_backoff[pcb->nrtx];
  80941d:	0f b7 43 40          	movzwl 0x40(%ebx),%eax
  809421:	66 c1 f8 03          	sar    $0x3,%ax
  809425:	98                   	cwtl   
  809426:	0f bf 53 42          	movswl 0x42(%ebx),%edx
  80942a:	01 d0                	add    %edx,%eax
  80942c:	0f b6 53 46          	movzbl 0x46(%ebx),%edx
  809430:	0f b6 8a 90 3c 81 00 	movzbl 0x813c90(%edx),%ecx
  809437:	d3 e0                	shl    %cl,%eax
  809439:	66 89 43 44          	mov    %ax,0x44(%ebx)
          }

          /* Reset the retransmission timer. */
          pcb->rtime = 0;
  80943d:	66 c7 43 32 00 00    	movw   $0x0,0x32(%ebx)

          /* Reduce congestion window and ssthresh. */
          eff_wnd = LWIP_MIN(pcb->cwnd, pcb->snd_wnd);
          pcb->ssthresh = eff_wnd >> 1;
  809443:	0f b7 43 5c          	movzwl 0x5c(%ebx),%eax
  809447:	66 39 43 4e          	cmp    %ax,0x4e(%ebx)
  80944b:	66 0f 46 43 4e       	cmovbe 0x4e(%ebx),%ax
  809450:	66 d1 e8             	shr    %ax
  809453:	66 89 43 50          	mov    %ax,0x50(%ebx)
          if (pcb->ssthresh < pcb->mss) {
  809457:	0f b7 53 34          	movzwl 0x34(%ebx),%edx
  80945b:	66 39 d0             	cmp    %dx,%ax
  80945e:	73 06                	jae    809466 <tcp_slowtmr+0x188>
            pcb->ssthresh = pcb->mss * 2;
  809460:	01 d2                	add    %edx,%edx
  809462:	66 89 53 50          	mov    %dx,0x50(%ebx)
          }
          pcb->cwnd = pcb->mss;
  809466:	0f b7 43 34          	movzwl 0x34(%ebx),%eax
  80946a:	66 89 43 4e          	mov    %ax,0x4e(%ebx)
                                       " ssthresh %"U16_F"\n",
                                       pcb->cwnd, pcb->ssthresh));
 
          /* The following needs to be called AFTER cwnd is set to one
             mss - STJ */
          tcp_rexmit_rto(pcb);
  80946e:	89 1c 24             	mov    %ebx,(%esp)
  809471:	e8 fd 23 00 00       	call   80b873 <tcp_rexmit_rto>
  809476:	be 00 00 00 00       	mov    $0x0,%esi
  80947b:	eb 0c                	jmp    809489 <tcp_slowtmr+0x1ab>
  80947d:	be 01 00 00 00       	mov    $0x1,%esi
  809482:	eb 05                	jmp    809489 <tcp_slowtmr+0x1ab>
  809484:	be 00 00 00 00       	mov    $0x0,%esi
        }
      }
    }
    /* Check if this PCB has stayed too long in FIN-WAIT-2 */
    if (pcb->state == FIN_WAIT_2) {
  809489:	8b 43 10             	mov    0x10(%ebx),%eax
  80948c:	83 f8 06             	cmp    $0x6,%eax
  80948f:	75 13                	jne    8094a4 <tcp_slowtmr+0x1c6>
      if ((u32_t)(tcp_ticks - pcb->tmr) >
  809491:	8b 15 0c f6 b3 00    	mov    0xb3f60c,%edx
  809497:	2b 53 2c             	sub    0x2c(%ebx),%edx
          TCP_FIN_WAIT_TIMEOUT / TCP_SLOW_INTERVAL) {
        ++pcb_remove;
  80949a:	83 fa 29             	cmp    $0x29,%edx
  80949d:	89 f2                	mov    %esi,%edx
  80949f:	80 da ff             	sbb    $0xff,%dl
  8094a2:	89 d6                	mov    %edx,%esi
        LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in FIN-WAIT-2\n"));
      }
    }

    /* Check if KEEPALIVE should be sent */
    if((pcb->so_options & SOF_KEEPALIVE) && 
  8094a4:	f6 43 08 08          	testb  $0x8,0x8(%ebx)
  8094a8:	74 6a                	je     809514 <tcp_slowtmr+0x236>
  8094aa:	83 f8 04             	cmp    $0x4,%eax
  8094ad:	74 05                	je     8094b4 <tcp_slowtmr+0x1d6>
  8094af:	83 f8 07             	cmp    $0x7,%eax
  8094b2:	75 60                	jne    809514 <tcp_slowtmr+0x236>
#if LWIP_TCP_KEEPALIVE
      if((u32_t)(tcp_ticks - pcb->tmr) > 
         (pcb->keep_idle + (pcb->keep_cnt*pcb->keep_intvl))
         / TCP_SLOW_INTERVAL)
#else      
      if((u32_t)(tcp_ticks - pcb->tmr) > 
  8094b4:	a1 0c f6 b3 00       	mov    0xb3f60c,%eax
  8094b9:	2b 43 2c             	sub    0x2c(%ebx),%eax
  8094bc:	89 45 e4             	mov    %eax,-0x1c(%ebp)
         (pcb->keep_idle + TCP_MAXIDLE) / TCP_SLOW_INTERVAL)
  8094bf:	8b 8b 9c 00 00 00    	mov    0x9c(%ebx),%ecx
#if LWIP_TCP_KEEPALIVE
      if((u32_t)(tcp_ticks - pcb->tmr) > 
         (pcb->keep_idle + (pcb->keep_cnt*pcb->keep_intvl))
         / TCP_SLOW_INTERVAL)
#else      
      if((u32_t)(tcp_ticks - pcb->tmr) > 
  8094c5:	8d 81 b8 4c 0a 00    	lea    0xa4cb8(%ecx),%eax
  8094cb:	ba d3 4d 62 10       	mov    $0x10624dd3,%edx
  8094d0:	f7 e2                	mul    %edx
  8094d2:	c1 ea 05             	shr    $0x5,%edx
  8094d5:	39 55 e4             	cmp    %edx,-0x1c(%ebp)
  8094d8:	76 0a                	jbe    8094e4 <tcp_slowtmr+0x206>
      {
        LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: KEEPALIVE timeout. Aborting connection to %"U16_F".%"U16_F".%"U16_F".%"U16_F".\n",
                                ip4_addr1(&pcb->remote_ip), ip4_addr2(&pcb->remote_ip),
                                ip4_addr3(&pcb->remote_ip), ip4_addr4(&pcb->remote_ip)));
        
        tcp_abort(pcb);
  8094da:	89 1c 24             	mov    %ebx,(%esp)
  8094dd:	e8 3c fb ff ff       	call   80901e <tcp_abort>
  8094e2:	eb 30                	jmp    809514 <tcp_slowtmr+0x236>
      else if((u32_t)(tcp_ticks - pcb->tmr) > 
              (pcb->keep_idle + pcb->keep_cnt_sent * pcb->keep_intvl)
              / TCP_SLOW_INTERVAL)
#else
      else if((u32_t)(tcp_ticks - pcb->tmr) > 
              (pcb->keep_idle + pcb->keep_cnt_sent * TCP_KEEPINTVL_DEFAULT) 
  8094e4:	0f b6 93 a5 00 00 00 	movzbl 0xa5(%ebx),%edx
  8094eb:	69 d2 f8 24 01 00    	imul   $0x124f8,%edx,%edx
  8094f1:	8d 0c 0a             	lea    (%edx,%ecx,1),%ecx
  8094f4:	ba d3 4d 62 10       	mov    $0x10624dd3,%edx
  8094f9:	89 c8                	mov    %ecx,%eax
  8094fb:	f7 e2                	mul    %edx
  8094fd:	c1 ea 05             	shr    $0x5,%edx
  809500:	39 55 e4             	cmp    %edx,-0x1c(%ebp)
  809503:	76 0f                	jbe    809514 <tcp_slowtmr+0x236>
              / TCP_SLOW_INTERVAL)
#endif /* LWIP_TCP_KEEPALIVE */
      {
        tcp_keepalive(pcb);
  809505:	89 1c 24             	mov    %ebx,(%esp)
  809508:	e8 ba 1b 00 00       	call   80b0c7 <tcp_keepalive>
        pcb->keep_cnt_sent++;
  80950d:	80 83 a5 00 00 00 01 	addb   $0x1,0xa5(%ebx)

    /* If this PCB has queued out of sequence data, but has been
       inactive for too long, will drop the data (it will eventually
       be retransmitted). */
#if TCP_QUEUE_OOSEQ    
    if (pcb->ooseq != NULL &&
  809514:	8b 53 7c             	mov    0x7c(%ebx),%edx
  809517:	85 d2                	test   %edx,%edx
  809519:	74 25                	je     809540 <tcp_slowtmr+0x262>
        (u32_t)tcp_ticks - pcb->tmr >= pcb->rto * TCP_OOSEQ_TIMEOUT) {
  80951b:	8b 0d 0c f6 b3 00    	mov    0xb3f60c,%ecx
  809521:	2b 4b 2c             	sub    0x2c(%ebx),%ecx
  809524:	0f bf 43 44          	movswl 0x44(%ebx),%eax
  809528:	8d 04 40             	lea    (%eax,%eax,2),%eax
  80952b:	01 c0                	add    %eax,%eax
  80952d:	39 c1                	cmp    %eax,%ecx
  80952f:	72 0f                	jb     809540 <tcp_slowtmr+0x262>
      tcp_segs_free(pcb->ooseq);
  809531:	89 14 24             	mov    %edx,(%esp)
  809534:	e8 7d f5 ff ff       	call   808ab6 <tcp_segs_free>
      pcb->ooseq = NULL;
  809539:	c7 43 7c 00 00 00 00 	movl   $0x0,0x7c(%ebx)
      LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_slowtmr: dropping OOSEQ queued data\n"));
    }
#endif /* TCP_QUEUE_OOSEQ */

    /* Check if this PCB has stayed too long in SYN-RCVD */
    if (pcb->state == SYN_RCVD) {
  809540:	8b 43 10             	mov    0x10(%ebx),%eax
  809543:	83 f8 03             	cmp    $0x3,%eax
  809546:	75 13                	jne    80955b <tcp_slowtmr+0x27d>
      if ((u32_t)(tcp_ticks - pcb->tmr) >
  809548:	8b 15 0c f6 b3 00    	mov    0xb3f60c,%edx
  80954e:	2b 53 2c             	sub    0x2c(%ebx),%edx
  809551:	83 fa 28             	cmp    $0x28,%edx
  809554:	76 05                	jbe    80955b <tcp_slowtmr+0x27d>
          TCP_SYN_RCVD_TIMEOUT / TCP_SLOW_INTERVAL) {
        ++pcb_remove;
  809556:	83 c6 01             	add    $0x1,%esi
  809559:	eb 19                	jmp    809574 <tcp_slowtmr+0x296>
        LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in SYN-RCVD\n"));
      }
    }

    /* Check if this PCB has stayed too long in LAST-ACK */
    if (pcb->state == LAST_ACK) {
  80955b:	83 f8 09             	cmp    $0x9,%eax
  80955e:	75 14                	jne    809574 <tcp_slowtmr+0x296>
      if ((u32_t)(tcp_ticks - pcb->tmr) > 2 * TCP_MSL / TCP_SLOW_INTERVAL) {
  809560:	a1 0c f6 b3 00       	mov    0xb3f60c,%eax
  809565:	2b 43 2c             	sub    0x2c(%ebx),%eax
        ++pcb_remove;
  809568:	3d f1 00 00 00       	cmp    $0xf1,%eax
  80956d:	89 f2                	mov    %esi,%edx
  80956f:	80 da ff             	sbb    $0xff,%dl
  809572:	89 d6                	mov    %edx,%esi
        LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in LAST-ACK\n"));
      }
    }

    /* If the PCB should be removed, do it. */
    if (pcb_remove) {
  809574:	89 f0                	mov    %esi,%eax
  809576:	84 c0                	test   %al,%al
  809578:	0f 84 94 00 00 00    	je     809612 <tcp_slowtmr+0x334>
      tcp_pcb_purge(pcb);      
  80957e:	89 1c 24             	mov    %ebx,(%esp)
  809581:	e8 61 f5 ff ff       	call   808ae7 <tcp_pcb_purge>
      /* Remove PCB from tcp_active_pcbs list. */
      if (prev != NULL) {
  809586:	85 ff                	test   %edi,%edi
  809588:	74 2c                	je     8095b6 <tcp_slowtmr+0x2d8>
        LWIP_ASSERT("tcp_slowtmr: middle tcp != tcp_active_pcbs", pcb != tcp_active_pcbs);
  80958a:	3b 1d 08 f6 b3 00    	cmp    0xb3f608,%ebx
  809590:	75 1c                	jne    8095ae <tcp_slowtmr+0x2d0>
  809592:	c7 44 24 08 98 3b 81 	movl   $0x813b98,0x8(%esp)
  809599:	00 
  80959a:	c7 44 24 04 c1 02 00 	movl   $0x2c1,0x4(%esp)
  8095a1:	00 
  8095a2:	c7 04 24 47 3a 81 00 	movl   $0x813a47,(%esp)
  8095a9:	e8 ee 73 ff ff       	call   80099c <_panic>
        prev->next = pcb->next;
  8095ae:	8b 43 0c             	mov    0xc(%ebx),%eax
  8095b1:	89 47 0c             	mov    %eax,0xc(%edi)
  8095b4:	eb 2d                	jmp    8095e3 <tcp_slowtmr+0x305>
      } else {
        /* This PCB was the first. */
        LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_active_pcbs", tcp_active_pcbs == pcb);
  8095b6:	a1 08 f6 b3 00       	mov    0xb3f608,%eax
  8095bb:	39 d8                	cmp    %ebx,%eax
  8095bd:	74 1c                	je     8095db <tcp_slowtmr+0x2fd>
  8095bf:	c7 44 24 08 c4 3b 81 	movl   $0x813bc4,0x8(%esp)
  8095c6:	00 
  8095c7:	c7 44 24 04 c5 02 00 	movl   $0x2c5,0x4(%esp)
  8095ce:	00 
  8095cf:	c7 04 24 47 3a 81 00 	movl   $0x813a47,(%esp)
  8095d6:	e8 c1 73 ff ff       	call   80099c <_panic>
        tcp_active_pcbs = pcb->next;
  8095db:	8b 40 0c             	mov    0xc(%eax),%eax
  8095de:	a3 08 f6 b3 00       	mov    %eax,0xb3f608
      }

      TCP_EVENT_ERR(pcb->errf, pcb->callback_arg, ERR_ABRT);
  8095e3:	8b 83 98 00 00 00    	mov    0x98(%ebx),%eax
  8095e9:	85 c0                	test   %eax,%eax
  8095eb:	74 10                	je     8095fd <tcp_slowtmr+0x31f>
  8095ed:	c7 44 24 04 fb ff ff 	movl   $0xfffffffb,0x4(%esp)
  8095f4:	ff 
  8095f5:	8b 53 18             	mov    0x18(%ebx),%edx
  8095f8:	89 14 24             	mov    %edx,(%esp)
  8095fb:	ff d0                	call   *%eax

      pcb2 = pcb->next;
  8095fd:	8b 73 0c             	mov    0xc(%ebx),%esi
      memp_free(MEMP_TCP_PCB, pcb);
  809600:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  809604:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  80960b:	e8 64 e1 ff ff       	call   807774 <memp_free>
  809610:	eb 3f                	jmp    809651 <tcp_slowtmr+0x373>
      pcb = pcb2;
    } else {

      /* We check if we should poll the connection. */
      ++pcb->polltmr;
  809612:	0f b6 43 30          	movzbl 0x30(%ebx),%eax
  809616:	83 c0 01             	add    $0x1,%eax
  809619:	88 43 30             	mov    %al,0x30(%ebx)
      if (pcb->polltmr >= pcb->pollinterval) {
  80961c:	3a 43 31             	cmp    0x31(%ebx),%al
  80961f:	72 2b                	jb     80964c <tcp_slowtmr+0x36e>
        pcb->polltmr = 0;
  809621:	c6 43 30 00          	movb   $0x0,0x30(%ebx)
        LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: polling application\n"));
        TCP_EVENT_POLL(pcb, err);
  809625:	8b 83 94 00 00 00    	mov    0x94(%ebx),%eax
  80962b:	85 c0                	test   %eax,%eax
  80962d:	74 0f                	je     80963e <tcp_slowtmr+0x360>
  80962f:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  809633:	8b 53 18             	mov    0x18(%ebx),%edx
  809636:	89 14 24             	mov    %edx,(%esp)
  809639:	ff d0                	call   *%eax
  80963b:	88 45 e3             	mov    %al,-0x1d(%ebp)
        if (err == ERR_OK) {
  80963e:	80 7d e3 00          	cmpb   $0x0,-0x1d(%ebp)
  809642:	75 08                	jne    80964c <tcp_slowtmr+0x36e>
          tcp_output(pcb);
  809644:	89 1c 24             	mov    %ebx,(%esp)
  809647:	e8 2f 1d 00 00       	call   80b37b <tcp_output>
        }
      }
      
      prev = pcb;
      pcb = pcb->next;
  80964c:	8b 73 0c             	mov    0xc(%ebx),%esi
  80964f:	89 df                	mov    %ebx,%edi
  prev = NULL;
  pcb = tcp_active_pcbs;
  if (pcb == NULL) {
    LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: no active pcbs\n"));
  }
  while (pcb != NULL) {
  809651:	85 f6                	test   %esi,%esi
  809653:	0f 85 bf fc ff ff    	jne    809318 <tcp_slowtmr+0x3a>
  }

  
  /* Steps through all of the TIME-WAIT PCBs. */
  prev = NULL;    
  pcb = tcp_tw_pcbs;
  809659:	8b 1d 1c f6 b3 00    	mov    0xb3f61c,%ebx
  while (pcb != NULL) {
  80965f:	85 db                	test   %ebx,%ebx
  809661:	0f 84 c7 00 00 00    	je     80972e <tcp_slowtmr+0x450>
    LWIP_ASSERT("tcp_slowtmr: TIME-WAIT pcb->state == TIME-WAIT", pcb->state == TIME_WAIT);
  809667:	83 7b 10 0a          	cmpl   $0xa,0x10(%ebx)
  80966b:	75 0d                	jne    80967a <tcp_slowtmr+0x39c>
  80966d:	be 00 00 00 00       	mov    $0x0,%esi
  809672:	eb 24                	jmp    809698 <tcp_slowtmr+0x3ba>
  809674:	83 7f 10 0a          	cmpl   $0xa,0x10(%edi)
  809678:	74 1c                	je     809696 <tcp_slowtmr+0x3b8>
  80967a:	c7 44 24 08 f0 3b 81 	movl   $0x813bf0,0x8(%esp)
  809681:	00 
  809682:	c7 44 24 04 e5 02 00 	movl   $0x2e5,0x4(%esp)
  809689:	00 
  80968a:	c7 04 24 47 3a 81 00 	movl   $0x813a47,(%esp)
  809691:	e8 06 73 ff ff       	call   80099c <_panic>
  809696:	89 fb                	mov    %edi,%ebx
    pcb_remove = 0;

    /* Check if this PCB has stayed long enough in TIME-WAIT */
    if ((u32_t)(tcp_ticks - pcb->tmr) > 2 * TCP_MSL / TCP_SLOW_INTERVAL) {
  809698:	a1 0c f6 b3 00       	mov    0xb3f60c,%eax
  80969d:	2b 43 2c             	sub    0x2c(%ebx),%eax
  8096a0:	3d f0 00 00 00       	cmp    $0xf0,%eax
  8096a5:	76 7a                	jbe    809721 <tcp_slowtmr+0x443>
    


    /* If the PCB should be removed, do it. */
    if (pcb_remove) {
      tcp_pcb_purge(pcb);      
  8096a7:	89 1c 24             	mov    %ebx,(%esp)
  8096aa:	e8 38 f4 ff ff       	call   808ae7 <tcp_pcb_purge>
      /* Remove PCB from tcp_tw_pcbs list. */
      if (prev != NULL) {
  8096af:	85 f6                	test   %esi,%esi
  8096b1:	74 2c                	je     8096df <tcp_slowtmr+0x401>
        LWIP_ASSERT("tcp_slowtmr: middle tcp != tcp_tw_pcbs", pcb != tcp_tw_pcbs);
  8096b3:	3b 1d 1c f6 b3 00    	cmp    0xb3f61c,%ebx
  8096b9:	75 1c                	jne    8096d7 <tcp_slowtmr+0x3f9>
  8096bb:	c7 44 24 08 20 3c 81 	movl   $0x813c20,0x8(%esp)
  8096c2:	00 
  8096c3:	c7 44 24 04 f4 02 00 	movl   $0x2f4,0x4(%esp)
  8096ca:	00 
  8096cb:	c7 04 24 47 3a 81 00 	movl   $0x813a47,(%esp)
  8096d2:	e8 c5 72 ff ff       	call   80099c <_panic>
        prev->next = pcb->next;
  8096d7:	8b 43 0c             	mov    0xc(%ebx),%eax
  8096da:	89 46 0c             	mov    %eax,0xc(%esi)
  8096dd:	eb 2d                	jmp    80970c <tcp_slowtmr+0x42e>
      } else {
        /* This PCB was the first. */
        LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_tw_pcbs", tcp_tw_pcbs == pcb);
  8096df:	a1 1c f6 b3 00       	mov    0xb3f61c,%eax
  8096e4:	39 d8                	cmp    %ebx,%eax
  8096e6:	74 1c                	je     809704 <tcp_slowtmr+0x426>
  8096e8:	c7 44 24 08 48 3c 81 	movl   $0x813c48,0x8(%esp)
  8096ef:	00 
  8096f0:	c7 44 24 04 f8 02 00 	movl   $0x2f8,0x4(%esp)
  8096f7:	00 
  8096f8:	c7 04 24 47 3a 81 00 	movl   $0x813a47,(%esp)
  8096ff:	e8 98 72 ff ff       	call   80099c <_panic>
        tcp_tw_pcbs = pcb->next;
  809704:	8b 40 0c             	mov    0xc(%eax),%eax
  809707:	a3 1c f6 b3 00       	mov    %eax,0xb3f61c
      }
      pcb2 = pcb->next;
  80970c:	8b 7b 0c             	mov    0xc(%ebx),%edi
      memp_free(MEMP_TCP_PCB, pcb);
  80970f:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  809713:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  80971a:	e8 55 e0 ff ff       	call   807774 <memp_free>
  80971f:	eb 05                	jmp    809726 <tcp_slowtmr+0x448>
      pcb = pcb2;
    } else {
      prev = pcb;
      pcb = pcb->next;
  809721:	8b 7b 0c             	mov    0xc(%ebx),%edi
  809724:	89 de                	mov    %ebx,%esi

  
  /* Steps through all of the TIME-WAIT PCBs. */
  prev = NULL;    
  pcb = tcp_tw_pcbs;
  while (pcb != NULL) {
  809726:	85 ff                	test   %edi,%edi
  809728:	0f 85 46 ff ff ff    	jne    809674 <tcp_slowtmr+0x396>
    } else {
      prev = pcb;
      pcb = pcb->next;
    }
  }
}
  80972e:	83 c4 2c             	add    $0x2c,%esp
  809731:	5b                   	pop    %ebx
  809732:	5e                   	pop    %esi
  809733:	5f                   	pop    %edi
  809734:	5d                   	pop    %ebp
  809735:	c3                   	ret    

00809736 <tcp_tmr>:
 * Called periodically to dispatch TCP timers.
 *
 */
void
tcp_tmr(void)
{
  809736:	55                   	push   %ebp
  809737:	89 e5                	mov    %esp,%ebp
  809739:	83 ec 08             	sub    $0x8,%esp
  /* Call tcp_fasttmr() every 250 ms */
  tcp_fasttmr();
  80973c:	e8 6b f2 ff ff       	call   8089ac <tcp_fasttmr>

  if (++tcp_timer & 1) {
  809741:	0f b6 05 a8 87 b3 00 	movzbl 0xb387a8,%eax
  809748:	83 c0 01             	add    $0x1,%eax
  80974b:	a2 a8 87 b3 00       	mov    %al,0xb387a8
  809750:	a8 01                	test   $0x1,%al
  809752:	74 05                	je     809759 <tcp_tmr+0x23>
    /* Call tcp_tmr() every 500 ms, i.e., every other timer
       tcp_tmr() is called. */
    tcp_slowtmr();
  809754:	e8 85 fb ff ff       	call   8092de <tcp_slowtmr>
  }
}
  809759:	c9                   	leave  
  80975a:	c3                   	ret    

0080975b <tcp_close>:
 * @return ERR_OK if connection has been closed
 *         another err_t if closing failed and pcb is not freed
 */
err_t
tcp_close(struct tcp_pcb *pcb)
{
  80975b:	55                   	push   %ebp
  80975c:	89 e5                	mov    %esp,%ebp
  80975e:	53                   	push   %ebx
  80975f:	83 ec 14             	sub    $0x14,%esp
  809762:	8b 5d 08             	mov    0x8(%ebp),%ebx
#if TCP_DEBUG
  LWIP_DEBUGF(TCP_DEBUG, ("tcp_close: closing in "));
  tcp_debug_print_state(pcb->state);
#endif /* TCP_DEBUG */

  switch (pcb->state) {
  809765:	83 7b 10 07          	cmpl   $0x7,0x10(%ebx)
  809769:	77 0a                	ja     809775 <tcp_close+0x1a>
  80976b:	8b 43 10             	mov    0x10(%ebx),%eax
  80976e:	ff 24 85 70 3c 81 00 	jmp    *0x813c70(,%eax,4)
  809775:	bb 00 00 00 00       	mov    $0x0,%ebx
  80977a:	e9 05 01 00 00       	jmp    809884 <tcp_close+0x129>
     * Calling tcp_close() with a pcb that has already been closed, (i.e. twice)
     * or for a pcb that has been used and then entered the CLOSED state 
     * is erroneous, but this should never happen as the pcb has in those cases
     * been freed, and so any remaining handles are bogus. */
    err = ERR_OK;
    TCP_RMV(&tcp_bound_pcbs, pcb);
  80977f:	8b 15 18 f6 b3 00    	mov    0xb3f618,%edx
  809785:	39 da                	cmp    %ebx,%edx
  809787:	75 0a                	jne    809793 <tcp_close+0x38>
  809789:	8b 42 0c             	mov    0xc(%edx),%eax
  80978c:	a3 18 f6 b3 00       	mov    %eax,0xb3f618
  809791:	eb 2a                	jmp    8097bd <tcp_close+0x62>
  809793:	89 15 14 f6 b3 00    	mov    %edx,0xb3f614
  809799:	85 d2                	test   %edx,%edx
  80979b:	74 20                	je     8097bd <tcp_close+0x62>
  80979d:	8b 42 0c             	mov    0xc(%edx),%eax
  8097a0:	85 c0                	test   %eax,%eax
  8097a2:	0f 84 fd 00 00 00    	je     8098a5 <tcp_close+0x14a>
  8097a8:	39 c3                	cmp    %eax,%ebx
  8097aa:	75 08                	jne    8097b4 <tcp_close+0x59>
  8097ac:	8b 43 0c             	mov    0xc(%ebx),%eax
  8097af:	89 42 0c             	mov    %eax,0xc(%edx)
  8097b2:	eb 09                	jmp    8097bd <tcp_close+0x62>
  8097b4:	a3 14 f6 b3 00       	mov    %eax,0xb3f614
  8097b9:	89 c2                	mov    %eax,%edx
  8097bb:	eb e0                	jmp    80979d <tcp_close+0x42>
  8097bd:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
    memp_free(MEMP_TCP_PCB, pcb);
  8097c4:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  8097c8:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  8097cf:	e8 a0 df ff ff       	call   807774 <memp_free>
  8097d4:	b8 00 00 00 00       	mov    $0x0,%eax
    pcb = NULL;
    break;
  8097d9:	e9 c1 00 00 00       	jmp    80989f <tcp_close+0x144>
  case LISTEN:
    err = ERR_OK;
    tcp_pcb_remove((struct tcp_pcb **)&tcp_listen_pcbs.pcbs, pcb);
  8097de:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  8097e2:	c7 04 24 10 f6 b3 00 	movl   $0xb3f610,(%esp)
  8097e9:	e8 72 f3 ff ff       	call   808b60 <tcp_pcb_remove>
    memp_free(MEMP_TCP_PCB_LISTEN, pcb);
  8097ee:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  8097f2:	c7 04 24 03 00 00 00 	movl   $0x3,(%esp)
  8097f9:	e8 76 df ff ff       	call   807774 <memp_free>
  8097fe:	b8 00 00 00 00       	mov    $0x0,%eax
    pcb = NULL;
    break;
  809803:	e9 97 00 00 00       	jmp    80989f <tcp_close+0x144>
  case SYN_SENT:
    err = ERR_OK;
    tcp_pcb_remove(&tcp_active_pcbs, pcb);
  809808:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  80980c:	c7 04 24 08 f6 b3 00 	movl   $0xb3f608,(%esp)
  809813:	e8 48 f3 ff ff       	call   808b60 <tcp_pcb_remove>
    memp_free(MEMP_TCP_PCB, pcb);
  809818:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  80981c:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  809823:	e8 4c df ff ff       	call   807774 <memp_free>
  809828:	b8 00 00 00 00       	mov    $0x0,%eax
    pcb = NULL;
    snmp_inc_tcpattemptfails();
    break;
  80982d:	eb 70                	jmp    80989f <tcp_close+0x144>
  case SYN_RCVD:
    err = tcp_send_ctrl(pcb, TCP_FIN);
  80982f:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  809836:	00 
  809837:	89 1c 24             	mov    %ebx,(%esp)
  80983a:	e8 f9 27 00 00       	call   80c038 <tcp_send_ctrl>
    if (err == ERR_OK) {
  80983f:	84 c0                	test   %al,%al
  809841:	75 5c                	jne    80989f <tcp_close+0x144>
      snmp_inc_tcpattemptfails();
      pcb->state = FIN_WAIT_1;
  809843:	c7 43 10 05 00 00 00 	movl   $0x5,0x10(%ebx)
  80984a:	eb 38                	jmp    809884 <tcp_close+0x129>
    }
    break;
  case ESTABLISHED:
    err = tcp_send_ctrl(pcb, TCP_FIN);
  80984c:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  809853:	00 
  809854:	89 1c 24             	mov    %ebx,(%esp)
  809857:	e8 dc 27 00 00       	call   80c038 <tcp_send_ctrl>
    if (err == ERR_OK) {
  80985c:	84 c0                	test   %al,%al
  80985e:	75 3f                	jne    80989f <tcp_close+0x144>
      snmp_inc_tcpestabresets();
      pcb->state = FIN_WAIT_1;
  809860:	c7 43 10 05 00 00 00 	movl   $0x5,0x10(%ebx)
  809867:	eb 1b                	jmp    809884 <tcp_close+0x129>
    }
    break;
  case CLOSE_WAIT:
    err = tcp_send_ctrl(pcb, TCP_FIN);
  809869:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  809870:	00 
  809871:	89 1c 24             	mov    %ebx,(%esp)
  809874:	e8 bf 27 00 00       	call   80c038 <tcp_send_ctrl>
    if (err == ERR_OK) {
  809879:	84 c0                	test   %al,%al
  80987b:	75 22                	jne    80989f <tcp_close+0x144>
      snmp_inc_tcpestabresets();
      pcb->state = LAST_ACK;
  80987d:	c7 43 10 09 00 00 00 	movl   $0x9,0x10(%ebx)
    err = ERR_OK;
    pcb = NULL;
    break;
  }

  if (pcb != NULL && err == ERR_OK) {
  809884:	85 db                	test   %ebx,%ebx
  809886:	75 0a                	jne    809892 <tcp_close+0x137>
  809888:	b8 00 00 00 00       	mov    $0x0,%eax
  80988d:	8d 76 00             	lea    0x0(%esi),%esi
  809890:	eb 0d                	jmp    80989f <tcp_close+0x144>
       Since we don't really have to ensure all data has been sent when tcp_close
       returns (unsent data is sent from tcp timer functions, also), we don't care
       for the return value of tcp_output for now. */
    /* @todo: When implementing SO_LINGER, this must be changed somehow:
       If SOF_LINGER is set, the data should be sent when tcp_close returns. */
    tcp_output(pcb);
  809892:	89 1c 24             	mov    %ebx,(%esp)
  809895:	e8 e1 1a 00 00       	call   80b37b <tcp_output>
  80989a:	b8 00 00 00 00       	mov    $0x0,%eax
  }
  return err;
}
  80989f:	83 c4 14             	add    $0x14,%esp
  8098a2:	5b                   	pop    %ebx
  8098a3:	5d                   	pop    %ebp
  8098a4:	c3                   	ret    
     * Calling tcp_close() with a pcb that has already been closed, (i.e. twice)
     * or for a pcb that has been used and then entered the CLOSED state 
     * is erroneous, but this should never happen as the pcb has in those cases
     * been freed, and so any remaining handles are bogus. */
    err = ERR_OK;
    TCP_RMV(&tcp_bound_pcbs, pcb);
  8098a5:	a3 14 f6 b3 00       	mov    %eax,0xb3f614
  8098aa:	e9 0e ff ff ff       	jmp    8097bd <tcp_close+0x62>

008098af <tcp_recv_null>:
 * Default receive callback that is called if the user didn't register
 * a recv callback for the pcb.
 */
static err_t
tcp_recv_null(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
{
  8098af:	55                   	push   %ebp
  8098b0:	89 e5                	mov    %esp,%ebp
  8098b2:	83 ec 18             	sub    $0x18,%esp
  8098b5:	8b 45 10             	mov    0x10(%ebp),%eax
  8098b8:	0f b6 55 14          	movzbl 0x14(%ebp),%edx
  arg = arg;
  if (p != NULL) {
  8098bc:	85 c0                	test   %eax,%eax
  8098be:	74 0f                	je     8098cf <tcp_recv_null+0x20>
    pbuf_free(p);
  8098c0:	89 04 24             	mov    %eax,(%esp)
  8098c3:	e8 35 e6 ff ff       	call   807efd <pbuf_free>
  8098c8:	b8 00 00 00 00       	mov    $0x0,%eax
  8098cd:	eb 14                	jmp    8098e3 <tcp_recv_null+0x34>
  } else if (err == ERR_OK) {
  8098cf:	b8 00 00 00 00       	mov    $0x0,%eax
  8098d4:	84 d2                	test   %dl,%dl
  8098d6:	75 0b                	jne    8098e3 <tcp_recv_null+0x34>
    return tcp_close(pcb);
  8098d8:	8b 45 0c             	mov    0xc(%ebp),%eax
  8098db:	89 04 24             	mov    %eax,(%esp)
  8098de:	e8 78 fe ff ff       	call   80975b <tcp_close>
  }
  return ERR_OK;
}
  8098e3:	c9                   	leave  
  8098e4:	c3                   	ret    
  8098e5:	00 00                	add    %al,(%eax)
	...

008098e8 <ip_addr_isbroadcast>:
 * @param addr address to be checked
 * @param netif the network interface against which the address is checked
 * @return returns non-zero if the address is a broadcast address
 */
u8_t ip_addr_isbroadcast(struct ip_addr *addr, struct netif *netif)
{
  8098e8:	55                   	push   %ebp
  8098e9:	89 e5                	mov    %esp,%ebp
  8098eb:	53                   	push   %ebx
  8098ec:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  u32_t addr2test;

  addr2test = addr->addr;
  8098ef:	8b 45 08             	mov    0x8(%ebp),%eax
  8098f2:	8b 10                	mov    (%eax),%edx
  /* all ones (broadcast) or all zeroes (old skool broadcast) */
  if ((~addr2test == IP_ADDR_ANY_VALUE) ||
  8098f4:	8d 5a ff             	lea    -0x1(%edx),%ebx
  8098f7:	b8 01 00 00 00       	mov    $0x1,%eax
  8098fc:	83 fb fd             	cmp    $0xfffffffd,%ebx
  8098ff:	77 26                	ja     809927 <ip_addr_isbroadcast+0x3f>
      (addr2test == IP_ADDR_ANY_VALUE))
    return 1;
  /* no broadcast support on this network interface? */
  else if ((netif->flags & NETIF_FLAG_BROADCAST) == 0)
  809901:	f6 41 2e 02          	testb  $0x2,0x2e(%ecx)
  809905:	74 1b                	je     809922 <ip_addr_isbroadcast+0x3a>
    /* the given address cannot be a broadcast address
     * nor can we check against any broadcast addresses */
    return 0;
  /* address matches network interface address exactly? => no broadcast */
  else if (addr2test == netif->ip_addr.addr)
  809907:	8b 41 04             	mov    0x4(%ecx),%eax
  80990a:	39 d0                	cmp    %edx,%eax
  80990c:	74 14                	je     809922 <ip_addr_isbroadcast+0x3a>
    return 0;
  /*  on the same (sub) network... */
  else if (ip_addr_netcmp(addr, &(netif->ip_addr), &(netif->netmask))
  80990e:	8b 49 08             	mov    0x8(%ecx),%ecx
  809911:	31 d0                	xor    %edx,%eax
  809913:	85 c8                	test   %ecx,%eax
  809915:	75 0b                	jne    809922 <ip_addr_isbroadcast+0x3a>
         /* ...and host identifier bits are all ones? =>... */
          && ((addr2test & ~netif->netmask.addr) ==
  809917:	f7 d1                	not    %ecx
  809919:	21 ca                	and    %ecx,%edx
  80991b:	39 d1                	cmp    %edx,%ecx
  80991d:	0f 94 c0             	sete   %al
  809920:	eb 05                	jmp    809927 <ip_addr_isbroadcast+0x3f>
  809922:	b8 00 00 00 00       	mov    $0x0,%eax
           (IP_ADDR_BROADCAST_VALUE & ~netif->netmask.addr)))
    /* => network broadcast address */
    return 1;
  else
    return 0;
}
  809927:	5b                   	pop    %ebx
  809928:	5d                   	pop    %ebp
  809929:	c3                   	ret    
  80992a:	00 00                	add    %al,(%eax)
  80992c:	00 00                	add    %al,(%eax)
	...

00809930 <ip_output_if>:
 */
err_t
ip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
             u8_t ttl, u8_t tos,
             u8_t proto, struct netif *netif)
{
  809930:	55                   	push   %ebp
  809931:	89 e5                	mov    %esp,%ebp
  809933:	83 ec 48             	sub    $0x48,%esp
  809936:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  809939:	89 75 f8             	mov    %esi,-0x8(%ebp)
  80993c:	89 7d fc             	mov    %edi,-0x4(%ebp)
  80993f:	8b 5d 08             	mov    0x8(%ebp),%ebx
  809942:	8b 7d 10             	mov    0x10(%ebp),%edi
  809945:	8b 75 20             	mov    0x20(%ebp),%esi
  809948:	0f b6 45 14          	movzbl 0x14(%ebp),%eax
  80994c:	88 45 d8             	mov    %al,-0x28(%ebp)
  80994f:	0f b6 55 18          	movzbl 0x18(%ebp),%edx
  809953:	88 55 d7             	mov    %dl,-0x29(%ebp)
  809956:	0f b6 45 1c          	movzbl 0x1c(%ebp),%eax
  80995a:	88 45 d6             	mov    %al,-0x2a(%ebp)
  static u16_t ip_id = 0;

  snmp_inc_ipoutrequests();

  /* Should the IP header be generated or is it already included in p? */
  if (dest != IP_HDRINCL) {
  80995d:	85 ff                	test   %edi,%edi
  80995f:	0f 84 3a 01 00 00    	je     809a9f <ip_output_if+0x16f>
    /* generate IP header */
    if (pbuf_header(p, IP_HLEN)) {
  809965:	c7 44 24 04 14 00 00 	movl   $0x14,0x4(%esp)
  80996c:	00 
  80996d:	89 1c 24             	mov    %ebx,(%esp)
  809970:	e8 1e e2 ff ff       	call   807b93 <pbuf_header>
  809975:	89 c2                	mov    %eax,%edx
  809977:	b8 fe ff ff ff       	mov    $0xfffffffe,%eax
  80997c:	84 d2                	test   %dl,%dl
  80997e:	0f 85 50 01 00 00    	jne    809ad4 <ip_output_if+0x1a4>
      IP_STATS_INC(ip.err);
      snmp_inc_ipoutdiscards();
      return ERR_BUF;
    }

    iphdr = p->payload;
  809984:	8b 43 04             	mov    0x4(%ebx),%eax
    LWIP_ASSERT("check that first pbuf can hold struct ip_hdr",
  809987:	66 83 7b 0a 13       	cmpw   $0x13,0xa(%ebx)
  80998c:	77 1c                	ja     8099aa <ip_output_if+0x7a>
  80998e:	c7 44 24 08 ac 3c 81 	movl   $0x813cac,0x8(%esp)
  809995:	00 
  809996:	c7 44 24 04 ee 01 00 	movl   $0x1ee,0x4(%esp)
  80999d:	00 
  80999e:	c7 04 24 d9 3c 81 00 	movl   $0x813cd9,(%esp)
  8099a5:	e8 f2 6f ff ff       	call   80099c <_panic>
      IP_STATS_INC(ip.err);
      snmp_inc_ipoutdiscards();
      return ERR_BUF;
    }

    iphdr = p->payload;
  8099aa:	89 45 d0             	mov    %eax,-0x30(%ebp)
    LWIP_ASSERT("check that first pbuf can hold struct ip_hdr",
               (p->len >= sizeof(struct ip_hdr)));

    IPH_TTL_SET(iphdr, ttl);
  8099ad:	0f b7 40 08          	movzwl 0x8(%eax),%eax
  8099b1:	89 04 24             	mov    %eax,(%esp)
  8099b4:	e8 47 13 00 00       	call   80ad00 <ntohs>
  8099b9:	0f b6 d0             	movzbl %al,%edx
  8099bc:	0f b6 45 d8          	movzbl -0x28(%ebp),%eax
  8099c0:	c1 e0 08             	shl    $0x8,%eax
  8099c3:	09 d0                	or     %edx,%eax
  8099c5:	0f b7 c0             	movzwl %ax,%eax
  8099c8:	89 04 24             	mov    %eax,(%esp)
  8099cb:	e8 23 13 00 00       	call   80acf3 <htons>
  8099d0:	8b 55 d0             	mov    -0x30(%ebp),%edx
  8099d3:	66 89 42 08          	mov    %ax,0x8(%edx)
    IPH_PROTO_SET(iphdr, proto);
  8099d7:	0f b7 c0             	movzwl %ax,%eax
  8099da:	89 04 24             	mov    %eax,(%esp)
  8099dd:	e8 1e 13 00 00       	call   80ad00 <ntohs>
  8099e2:	89 c2                	mov    %eax,%edx
  8099e4:	81 e2 00 ff 00 00    	and    $0xff00,%edx
  8099ea:	0f b6 45 d6          	movzbl -0x2a(%ebp),%eax
  8099ee:	09 d0                	or     %edx,%eax
  8099f0:	0f b7 c0             	movzwl %ax,%eax
  8099f3:	89 04 24             	mov    %eax,(%esp)
  8099f6:	e8 f8 12 00 00       	call   80acf3 <htons>
  8099fb:	8b 55 d0             	mov    -0x30(%ebp),%edx
  8099fe:	66 89 42 08          	mov    %ax,0x8(%edx)

    ip_addr_set(&(iphdr->dest), dest);
  809a02:	8b 07                	mov    (%edi),%eax
  809a04:	89 42 10             	mov    %eax,0x10(%edx)

    IPH_VHLTOS_SET(iphdr, 4, IP_HLEN / 4, tos);
  809a07:	0f b6 45 d7          	movzbl -0x29(%ebp),%eax
  809a0b:	80 cc 45             	or     $0x45,%ah
  809a0e:	89 04 24             	mov    %eax,(%esp)
  809a11:	e8 dd 12 00 00       	call   80acf3 <htons>
  809a16:	8b 55 d0             	mov    -0x30(%ebp),%edx
  809a19:	66 89 02             	mov    %ax,(%edx)
    IPH_LEN_SET(iphdr, htons(p->tot_len));
  809a1c:	0f b7 43 08          	movzwl 0x8(%ebx),%eax
  809a20:	89 04 24             	mov    %eax,(%esp)
  809a23:	e8 cb 12 00 00       	call   80acf3 <htons>
  809a28:	8b 55 d0             	mov    -0x30(%ebp),%edx
  809a2b:	66 89 42 02          	mov    %ax,0x2(%edx)
    IPH_OFFSET_SET(iphdr, 0);
  809a2f:	66 c7 42 06 00 00    	movw   $0x0,0x6(%edx)
    IPH_ID_SET(iphdr, htons(ip_id));
  809a35:	0f b7 05 ac 87 b3 00 	movzwl 0xb387ac,%eax
  809a3c:	89 04 24             	mov    %eax,(%esp)
  809a3f:	e8 af 12 00 00       	call   80acf3 <htons>
  809a44:	8b 55 d0             	mov    -0x30(%ebp),%edx
  809a47:	66 89 42 04          	mov    %ax,0x4(%edx)
    ++ip_id;
  809a4b:	66 83 05 ac 87 b3 00 	addw   $0x1,0xb387ac
  809a52:	01 

    if (ip_addr_isany(src)) {
  809a53:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  809a57:	74 09                	je     809a62 <ip_output_if+0x132>
  809a59:	8b 55 0c             	mov    0xc(%ebp),%edx
  809a5c:	8b 02                	mov    (%edx),%eax
  809a5e:	85 c0                	test   %eax,%eax
  809a60:	75 15                	jne    809a77 <ip_output_if+0x147>
      ip_addr_set(&(iphdr->src), &(netif->ip_addr));
  809a62:	b8 00 00 00 00       	mov    $0x0,%eax
  809a67:	83 fe fc             	cmp    $0xfffffffc,%esi
  809a6a:	74 03                	je     809a6f <ip_output_if+0x13f>
  809a6c:	8b 46 04             	mov    0x4(%esi),%eax
  809a6f:	8b 55 d0             	mov    -0x30(%ebp),%edx
  809a72:	89 42 0c             	mov    %eax,0xc(%edx)
    IPH_LEN_SET(iphdr, htons(p->tot_len));
    IPH_OFFSET_SET(iphdr, 0);
    IPH_ID_SET(iphdr, htons(ip_id));
    ++ip_id;

    if (ip_addr_isany(src)) {
  809a75:	eb 06                	jmp    809a7d <ip_output_if+0x14d>
      ip_addr_set(&(iphdr->src), &(netif->ip_addr));
    } else {
      ip_addr_set(&(iphdr->src), src);
  809a77:	8b 55 d0             	mov    -0x30(%ebp),%edx
  809a7a:	89 42 0c             	mov    %eax,0xc(%edx)
    }

    IPH_CHKSUM_SET(iphdr, 0);
  809a7d:	8b 45 d0             	mov    -0x30(%ebp),%eax
  809a80:	66 c7 40 0a 00 00    	movw   $0x0,0xa(%eax)
#if CHECKSUM_GEN_IP
    IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN));
  809a86:	c7 44 24 04 14 00 00 	movl   $0x14,0x4(%esp)
  809a8d:	00 
  809a8e:	89 04 24             	mov    %eax,(%esp)
  809a91:	e8 44 0f 00 00       	call   80a9da <inet_chksum>
  809a96:	8b 55 d0             	mov    -0x30(%ebp),%edx
  809a99:	66 89 42 0a          	mov    %ax,0xa(%edx)
  809a9d:	eb 06                	jmp    809aa5 <ip_output_if+0x175>
#endif
  } else {
    /* IP header already included in p */
    iphdr = p->payload;
    dest = &(iphdr->dest);
  809a9f:	8b 7b 04             	mov    0x4(%ebx),%edi
  809aa2:	83 c7 10             	add    $0x10,%edi
  }

#if IP_FRAG
  /* don't fragment if interface has mtu set to 0 [loopif] */
  if (netif->mtu && (p->tot_len > netif->mtu))
  809aa5:	0f b7 46 2c          	movzwl 0x2c(%esi),%eax
  809aa9:	66 85 c0             	test   %ax,%ax
  809aac:	74 18                	je     809ac6 <ip_output_if+0x196>
  809aae:	66 3b 43 08          	cmp    0x8(%ebx),%ax
  809ab2:	73 12                	jae    809ac6 <ip_output_if+0x196>
    return ip_frag(p,netif,dest);
  809ab4:	89 7c 24 08          	mov    %edi,0x8(%esp)
  809ab8:	89 74 24 04          	mov    %esi,0x4(%esp)
  809abc:	89 1c 24             	mov    %ebx,(%esp)
  809abf:	e8 ac 03 00 00       	call   809e70 <ip_frag>
  809ac4:	eb 0e                	jmp    809ad4 <ip_output_if+0x1a4>
  } else
#endif /* (LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF) */
  {
    LWIP_DEBUGF(IP_DEBUG, ("netif->output()"));

    return netif->output(netif, p, dest);
  809ac6:	89 7c 24 08          	mov    %edi,0x8(%esp)
  809aca:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  809ace:	89 34 24             	mov    %esi,(%esp)
  809ad1:	ff 56 14             	call   *0x14(%esi)
  }
}
  809ad4:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  809ad7:	8b 75 f8             	mov    -0x8(%ebp),%esi
  809ada:	8b 7d fc             	mov    -0x4(%ebp),%edi
  809add:	89 ec                	mov    %ebp,%esp
  809adf:	5d                   	pop    %ebp
  809ae0:	c3                   	ret    

00809ae1 <ip_route>:
 * @param dest the destination IP address for which to find the route
 * @return the netif on which to send to reach dest
 */
struct netif *
ip_route(struct ip_addr *dest)
{
  809ae1:	55                   	push   %ebp
  809ae2:	89 e5                	mov    %esp,%ebp
  809ae4:	56                   	push   %esi
  809ae5:	53                   	push   %ebx
  809ae6:	83 ec 10             	sub    $0x10,%esp
  809ae9:	8b 75 08             	mov    0x8(%ebp),%esi
  struct netif *netif;

  /* iterate through netifs */
  for(netif = netif_list; netif != NULL; netif = netif->next) {
  809aec:	8b 1d 00 f6 b3 00    	mov    0xb3f600,%ebx
  809af2:	85 db                	test   %ebx,%ebx
  809af4:	74 1c                	je     809b12 <ip_route+0x31>
    /* network mask matches? */
    if (netif_is_up(netif)) {
  809af6:	89 1c 24             	mov    %ebx,(%esp)
  809af9:	e8 11 de ff ff       	call   80790f <netif_is_up>
  809afe:	84 c0                	test   %al,%al
  809b00:	74 0a                	je     809b0c <ip_route+0x2b>
      if (ip_addr_netcmp(dest, &(netif->ip_addr), &(netif->netmask))) {
  809b02:	8b 43 04             	mov    0x4(%ebx),%eax
  809b05:	33 06                	xor    (%esi),%eax
  809b07:	85 43 08             	test   %eax,0x8(%ebx)
  809b0a:	74 28                	je     809b34 <ip_route+0x53>
ip_route(struct ip_addr *dest)
{
  struct netif *netif;

  /* iterate through netifs */
  for(netif = netif_list; netif != NULL; netif = netif->next) {
  809b0c:	8b 1b                	mov    (%ebx),%ebx
  809b0e:	85 db                	test   %ebx,%ebx
  809b10:	75 e4                	jne    809af6 <ip_route+0x15>
        /* return netif on which to forward IP packet */
        return netif;
      }
    }
  }
  if ((netif_default == NULL) || (!netif_is_up(netif_default))) {
  809b12:	a1 04 f6 b3 00       	mov    0xb3f604,%eax
  809b17:	85 c0                	test   %eax,%eax
  809b19:	74 14                	je     809b2f <ip_route+0x4e>
  809b1b:	89 04 24             	mov    %eax,(%esp)
  809b1e:	e8 ec dd ff ff       	call   80790f <netif_is_up>
  809b23:	84 c0                	test   %al,%al
  809b25:	74 08                	je     809b2f <ip_route+0x4e>
    IP_STATS_INC(ip.rterr);
    snmp_inc_ipoutnoroutes();
    return NULL;
  }
  /* no matching netif found, use default netif */
  return netif_default;
  809b27:	8b 1d 04 f6 b3 00    	mov    0xb3f604,%ebx
  809b2d:	eb 05                	jmp    809b34 <ip_route+0x53>
  809b2f:	bb 00 00 00 00       	mov    $0x0,%ebx
}
  809b34:	89 d8                	mov    %ebx,%eax
  809b36:	83 c4 10             	add    $0x10,%esp
  809b39:	5b                   	pop    %ebx
  809b3a:	5e                   	pop    %esi
  809b3b:	5d                   	pop    %ebp
  809b3c:	c3                   	ret    

00809b3d <ip_output>:
 *         see ip_output_if() for more return values
 */
err_t
ip_output(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
          u8_t ttl, u8_t tos, u8_t proto)
{
  809b3d:	55                   	push   %ebp
  809b3e:	89 e5                	mov    %esp,%ebp
  809b40:	83 ec 48             	sub    $0x48,%esp
  809b43:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  809b46:	89 75 f8             	mov    %esi,-0x8(%ebp)
  809b49:	89 7d fc             	mov    %edi,-0x4(%ebp)
  809b4c:	8b 5d 10             	mov    0x10(%ebp),%ebx
  809b4f:	0f b6 45 14          	movzbl 0x14(%ebp),%eax
  809b53:	88 45 e7             	mov    %al,-0x19(%ebp)
  809b56:	0f b6 7d 18          	movzbl 0x18(%ebp),%edi
  809b5a:	0f b6 75 1c          	movzbl 0x1c(%ebp),%esi
  struct netif *netif;

  if ((netif = ip_route(dest)) == NULL) {
  809b5e:	89 1c 24             	mov    %ebx,(%esp)
  809b61:	e8 7b ff ff ff       	call   809ae1 <ip_route>
  809b66:	89 c2                	mov    %eax,%edx
  809b68:	b8 fc ff ff ff       	mov    $0xfffffffc,%eax
  809b6d:	85 d2                	test   %edx,%edx
  809b6f:	74 36                	je     809ba7 <ip_output+0x6a>
    return ERR_RTE;
  }

  return ip_output_if(p, src, dest, ttl, tos, proto, netif);
  809b71:	89 54 24 18          	mov    %edx,0x18(%esp)
  809b75:	81 e6 ff 00 00 00    	and    $0xff,%esi
  809b7b:	89 74 24 14          	mov    %esi,0x14(%esp)
  809b7f:	81 e7 ff 00 00 00    	and    $0xff,%edi
  809b85:	89 7c 24 10          	mov    %edi,0x10(%esp)
  809b89:	0f b6 45 e7          	movzbl -0x19(%ebp),%eax
  809b8d:	89 44 24 0c          	mov    %eax,0xc(%esp)
  809b91:	89 5c 24 08          	mov    %ebx,0x8(%esp)
  809b95:	8b 45 0c             	mov    0xc(%ebp),%eax
  809b98:	89 44 24 04          	mov    %eax,0x4(%esp)
  809b9c:	8b 45 08             	mov    0x8(%ebp),%eax
  809b9f:	89 04 24             	mov    %eax,(%esp)
  809ba2:	e8 89 fd ff ff       	call   809930 <ip_output_if>
}
  809ba7:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  809baa:	8b 75 f8             	mov    -0x8(%ebp),%esi
  809bad:	8b 7d fc             	mov    -0x4(%ebp),%edi
  809bb0:	89 ec                	mov    %ebp,%esp
  809bb2:	5d                   	pop    %ebp
  809bb3:	c3                   	ret    

00809bb4 <ip_input>:
 * @return ERR_OK if the packet was processed (could return ERR_* if it wasn't
 *         processed, but currently always returns ERR_OK)
 */
err_t
ip_input(struct pbuf *p, struct netif *inp)
{
  809bb4:	55                   	push   %ebp
  809bb5:	89 e5                	mov    %esp,%ebp
  809bb7:	83 ec 48             	sub    $0x48,%esp
  809bba:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  809bbd:	89 75 f8             	mov    %esi,-0x8(%ebp)
  809bc0:	89 7d fc             	mov    %edi,-0x4(%ebp)
  809bc3:	8b 75 08             	mov    0x8(%ebp),%esi

  IP_STATS_INC(ip.recv);
  snmp_inc_ipinreceives();

  /* identify the IP header */
  iphdr = p->payload;
  809bc6:	8b 5e 04             	mov    0x4(%esi),%ebx
  if (IPH_V(iphdr) != 4) {
  809bc9:	0f b7 03             	movzwl (%ebx),%eax
  809bcc:	89 04 24             	mov    %eax,(%esp)
  809bcf:	e8 2c 11 00 00       	call   80ad00 <ntohs>
  809bd4:	66 c1 e8 0c          	shr    $0xc,%ax
  809bd8:	66 83 f8 04          	cmp    $0x4,%ax
  809bdc:	74 0d                	je     809beb <ip_input+0x37>
    LWIP_DEBUGF(IP_DEBUG | 1, ("IP packet dropped due to bad version number %"U16_F"\n", IPH_V(iphdr)));
    ip_debug_print(p);
    pbuf_free(p);
  809bde:	89 34 24             	mov    %esi,(%esp)
  809be1:	e8 17 e3 ff ff       	call   807efd <pbuf_free>
    IP_STATS_INC(ip.err);
    IP_STATS_INC(ip.drop);
    snmp_inc_ipinhdrerrors();
    return ERR_OK;
  809be6:	e9 72 02 00 00       	jmp    809e5d <ip_input+0x2a9>
  }

  /* obtain IP header length in number of 32-bit words */
  iphdr_hlen = IPH_HL(iphdr);
  809beb:	0f b7 03             	movzwl (%ebx),%eax
  809bee:	89 04 24             	mov    %eax,(%esp)
  809bf1:	e8 0a 11 00 00       	call   80ad00 <ntohs>
  809bf6:	66 c1 e8 06          	shr    $0x6,%ax
  /* calculate IP header length in bytes */
  iphdr_hlen *= 4;
  809bfa:	83 e0 3c             	and    $0x3c,%eax
  809bfd:	66 89 45 e0          	mov    %ax,-0x20(%ebp)
  /* obtain ip length in bytes */
  iphdr_len = ntohs(IPH_LEN(iphdr));
  809c01:	0f b7 43 02          	movzwl 0x2(%ebx),%eax
  809c05:	89 04 24             	mov    %eax,(%esp)
  809c08:	e8 f3 10 00 00       	call   80ad00 <ntohs>
  809c0d:	89 c7                	mov    %eax,%edi

  /* header length exceeds first pbuf length, or ip length exceeds total pbuf length? */
  if ((iphdr_hlen > p->len) || (iphdr_len > p->tot_len)) {
  809c0f:	0f b7 45 e0          	movzwl -0x20(%ebp),%eax
  809c13:	66 3b 46 0a          	cmp    0xa(%esi),%ax
  809c17:	77 06                	ja     809c1f <ip_input+0x6b>
  809c19:	66 3b 7e 08          	cmp    0x8(%esi),%di
  809c1d:	76 0d                	jbe    809c2c <ip_input+0x78>
    if (iphdr_len > p->tot_len)
    LWIP_DEBUGF(IP_DEBUG | 2, ("IP (len %"U16_F") is longer than pbuf (len %"U16_F"), "
                               "IP packet dropped.\n",
                               iphdr_len, p->tot_len));
    /* free (drop) packet pbufs */
    pbuf_free(p);
  809c1f:	89 34 24             	mov    %esi,(%esp)
  809c22:	e8 d6 e2 ff ff       	call   807efd <pbuf_free>
    IP_STATS_INC(ip.lenerr);
    IP_STATS_INC(ip.drop);
    snmp_inc_ipindiscards();
    return ERR_OK;
  809c27:	e9 31 02 00 00       	jmp    809e5d <ip_input+0x2a9>
  }

  /* verify checksum */
#if CHECKSUM_CHECK_IP
  if (inet_chksum(iphdr, iphdr_hlen) != 0) {
  809c2c:	0f b7 45 e0          	movzwl -0x20(%ebp),%eax
  809c30:	89 44 24 04          	mov    %eax,0x4(%esp)
  809c34:	89 1c 24             	mov    %ebx,(%esp)
  809c37:	e8 9e 0d 00 00       	call   80a9da <inet_chksum>
  809c3c:	66 85 c0             	test   %ax,%ax
  809c3f:	74 0d                	je     809c4e <ip_input+0x9a>

    LWIP_DEBUGF(IP_DEBUG | 2, ("Checksum (0x%"X16_F") failed, IP packet dropped.\n", inet_chksum(iphdr, iphdr_hlen)));
    ip_debug_print(p);
    pbuf_free(p);
  809c41:	89 34 24             	mov    %esi,(%esp)
  809c44:	e8 b4 e2 ff ff       	call   807efd <pbuf_free>
    IP_STATS_INC(ip.chkerr);
    IP_STATS_INC(ip.drop);
    snmp_inc_ipinhdrerrors();
    return ERR_OK;
  809c49:	e9 0f 02 00 00       	jmp    809e5d <ip_input+0x2a9>
  }
#endif

  /* Trim pbuf. This should have been done at the netif layer,
   * but we'll do it anyway just to be sure that its done. */
  pbuf_realloc(p, iphdr_len);
  809c4e:	0f b7 ff             	movzwl %di,%edi
  809c51:	89 7c 24 04          	mov    %edi,0x4(%esp)
  809c55:	89 34 24             	mov    %esi,(%esp)
  809c58:	e8 2c e4 ff ff       	call   808089 <pbuf_realloc>
      /* interface is up and configured? */
      if ((netif_is_up(netif)) && (!ip_addr_isany(&(netif->ip_addr)))) {
        /* unicast to this interface address? */
        if (ip_addr_cmp(&(iphdr->dest), &(netif->ip_addr)) ||
            /* or broadcast on this interface network address? */
            ip_addr_isbroadcast(&(iphdr->dest), netif)) {
  809c5d:	8d 43 10             	lea    0x10(%ebx),%eax
  809c60:	89 45 dc             	mov    %eax,-0x24(%ebp)
  809c63:	8b 7d 0c             	mov    0xc(%ebp),%edi
  809c66:	c7 45 d8 01 00 00 00 	movl   $0x1,-0x28(%ebp)
        netif = netif->next;
      }
      if (netif == inp) {
        netif = netif->next;
      }
    } while(netif != NULL);
  809c6d:	89 75 d4             	mov    %esi,-0x2c(%ebp)
  809c70:	89 de                	mov    %ebx,%esi
  809c72:	bb 01 00 00 00       	mov    $0x1,%ebx
          iphdr->dest.addr & netif->netmask.addr,
          netif->ip_addr.addr & netif->netmask.addr,
          iphdr->dest.addr & ~(netif->netmask.addr)));

      /* interface is up and configured? */
      if ((netif_is_up(netif)) && (!ip_addr_isany(&(netif->ip_addr)))) {
  809c77:	89 3c 24             	mov    %edi,(%esp)
  809c7a:	e8 90 dc ff ff       	call   80790f <netif_is_up>
  809c7f:	84 c0                	test   %al,%al
  809c81:	74 27                	je     809caa <ip_input+0xf6>
  809c83:	83 ff fc             	cmp    $0xfffffffc,%edi
  809c86:	74 22                	je     809caa <ip_input+0xf6>
  809c88:	8b 47 04             	mov    0x4(%edi),%eax
  809c8b:	85 c0                	test   %eax,%eax
  809c8d:	8d 76 00             	lea    0x0(%esi),%esi
  809c90:	74 18                	je     809caa <ip_input+0xf6>
        /* unicast to this interface address? */
        if (ip_addr_cmp(&(iphdr->dest), &(netif->ip_addr)) ||
  809c92:	3b 46 10             	cmp    0x10(%esi),%eax
  809c95:	74 36                	je     809ccd <ip_input+0x119>
            /* or broadcast on this interface network address? */
            ip_addr_isbroadcast(&(iphdr->dest), netif)) {
  809c97:	89 7c 24 04          	mov    %edi,0x4(%esp)
  809c9b:	8b 45 dc             	mov    -0x24(%ebp),%eax
  809c9e:	89 04 24             	mov    %eax,(%esp)
  809ca1:	e8 42 fc ff ff       	call   8098e8 <ip_addr_isbroadcast>
          iphdr->dest.addr & ~(netif->netmask.addr)));

      /* interface is up and configured? */
      if ((netif_is_up(netif)) && (!ip_addr_isany(&(netif->ip_addr)))) {
        /* unicast to this interface address? */
        if (ip_addr_cmp(&(iphdr->dest), &(netif->ip_addr)) ||
  809ca6:	84 c0                	test   %al,%al
  809ca8:	75 23                	jne    809ccd <ip_input+0x119>
              netif->name[0], netif->name[1]));
          /* break out of for loop */
          break;
        }
      }
      if (first) {
  809caa:	85 db                	test   %ebx,%ebx
  809cac:	74 08                	je     809cb6 <ip_input+0x102>
        first = 0;
        netif = netif_list;
  809cae:	8b 3d 00 f6 b3 00    	mov    0xb3f600,%edi
  809cb4:	eb 02                	jmp    809cb8 <ip_input+0x104>
      } else {
        netif = netif->next;
  809cb6:	8b 3f                	mov    (%edi),%edi
      }
      if (netif == inp) {
  809cb8:	3b 7d 0c             	cmp    0xc(%ebp),%edi
  809cbb:	75 05                	jne    809cc2 <ip_input+0x10e>
        netif = netif->next;
  809cbd:	8b 45 0c             	mov    0xc(%ebp),%eax
  809cc0:	8b 38                	mov    (%eax),%edi
      }
    } while(netif != NULL);
  809cc2:	85 ff                	test   %edi,%edi
  809cc4:	74 12                	je     809cd8 <ip_input+0x124>
  809cc6:	bb 00 00 00 00       	mov    $0x0,%ebx
  809ccb:	eb aa                	jmp    809c77 <ip_input+0xc3>
  809ccd:	89 f3                	mov    %esi,%ebx
  809ccf:	8b 75 d4             	mov    -0x2c(%ebp),%esi
#if LWIP_DHCP
  /* Pass DHCP messages regardless of destination address. DHCP traffic is addressed
   * using link layer addressing (such as Ethernet MAC) so we must not filter on IP.
   * According to RFC 1542 section 3.1.1, referred by RFC 2131).
   */
  if (netif == NULL) {
  809cd2:	85 ff                	test   %edi,%edi
  809cd4:	75 2e                	jne    809d04 <ip_input+0x150>
  809cd6:	eb 05                	jmp    809cdd <ip_input+0x129>
  809cd8:	89 f3                	mov    %esi,%ebx
  809cda:	8b 75 d4             	mov    -0x2c(%ebp),%esi
    /* remote port is DHCP server? */
    if (IPH_PROTO(iphdr) == IP_PROTO_UDP) {
  809cdd:	0f b7 43 08          	movzwl 0x8(%ebx),%eax
  809ce1:	89 04 24             	mov    %eax,(%esp)
  809ce4:	e8 17 10 00 00       	call   80ad00 <ntohs>
  809ce9:	3c 11                	cmp    $0x11,%al
  809ceb:	75 17                	jne    809d04 <ip_input+0x150>
      LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_TRACE | 1, ("ip_input: UDP packet to DHCP client port %"U16_F"\n",
        ntohs(((struct udp_hdr *)((u8_t *)iphdr + iphdr_hlen))->dest)));
      if (ntohs(((struct udp_hdr *)((u8_t *)iphdr + iphdr_hlen))->dest) == DHCP_CLIENT_PORT) {
  809ced:	0f b7 45 e0          	movzwl -0x20(%ebp),%eax
  809cf1:	0f b7 44 03 02       	movzwl 0x2(%ebx,%eax,1),%eax
  809cf6:	89 04 24             	mov    %eax,(%esp)
  809cf9:	e8 02 10 00 00       	call   80ad00 <ntohs>
  809cfe:	66 83 f8 44          	cmp    $0x44,%ax
  809d02:	74 4e                	je     809d52 <ip_input+0x19e>

  /* broadcast or multicast packet source address? Compliant with RFC 1122: 3.2.1.3 */
#if LWIP_DHCP
  if (check_ip_src)
#endif /* LWIP_DHCP */
  {  if ((ip_addr_isbroadcast(&(iphdr->src), inp)) ||
  809d04:	8b 45 0c             	mov    0xc(%ebp),%eax
  809d07:	89 44 24 04          	mov    %eax,0x4(%esp)
  809d0b:	8d 43 0c             	lea    0xc(%ebx),%eax
  809d0e:	89 04 24             	mov    %eax,(%esp)
  809d11:	e8 d2 fb ff ff       	call   8098e8 <ip_addr_isbroadcast>
  809d16:	84 c0                	test   %al,%al
  809d18:	75 2b                	jne    809d45 <ip_input+0x191>
         (ip_addr_ismulticast(&(iphdr->src)))) {
  809d1a:	8b 43 0c             	mov    0xc(%ebx),%eax
  809d1d:	89 45 dc             	mov    %eax,-0x24(%ebp)
  809d20:	c7 04 24 00 00 00 f0 	movl   $0xf0000000,(%esp)
  809d27:	e8 09 12 00 00       	call   80af35 <ntohl>
  809d2c:	89 45 e0             	mov    %eax,-0x20(%ebp)
  809d2f:	c7 04 24 00 00 00 e0 	movl   $0xe0000000,(%esp)
  809d36:	e8 fa 11 00 00       	call   80af35 <ntohl>

  /* broadcast or multicast packet source address? Compliant with RFC 1122: 3.2.1.3 */
#if LWIP_DHCP
  if (check_ip_src)
#endif /* LWIP_DHCP */
  {  if ((ip_addr_isbroadcast(&(iphdr->src), inp)) ||
  809d3b:	8b 55 e0             	mov    -0x20(%ebp),%edx
  809d3e:	23 55 dc             	and    -0x24(%ebp),%edx
  809d41:	39 c2                	cmp    %eax,%edx
  809d43:	75 10                	jne    809d55 <ip_input+0x1a1>
         (ip_addr_ismulticast(&(iphdr->src)))) {
      /* packet source is not valid */
      LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_TRACE | 1, ("ip_input: packet source is not valid.\n"));
      /* free (drop) packet pbufs */
      pbuf_free(p);
  809d45:	89 34 24             	mov    %esi,(%esp)
  809d48:	e8 b0 e1 ff ff       	call   807efd <pbuf_free>
      IP_STATS_INC(ip.drop);
      snmp_inc_ipinaddrerrors();
      snmp_inc_ipindiscards();
      return ERR_OK;
  809d4d:	e9 0b 01 00 00       	jmp    809e5d <ip_input+0x2a9>
  809d52:	8b 7d 0c             	mov    0xc(%ebp),%edi
    }
  }

  /* packet not for us? */
  if (netif == NULL) {
  809d55:	85 ff                	test   %edi,%edi
  809d57:	75 11                	jne    809d6a <ip_input+0x1b6>
#endif /* IP_FORWARD */
    {
      snmp_inc_ipinaddrerrors();
      snmp_inc_ipindiscards();
    }
    pbuf_free(p);
  809d59:	89 34 24             	mov    %esi,(%esp)
  809d5c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  809d60:	e8 98 e1 ff ff       	call   807efd <pbuf_free>
    return ERR_OK;
  809d65:	e9 f3 00 00 00       	jmp    809e5d <ip_input+0x2a9>
  }
  /* packet consists of multiple fragments? */
  if ((IPH_OFFSET(iphdr) & htons(IP_OFFMASK | IP_MF)) != 0) {
  809d6a:	0f b7 7b 06          	movzwl 0x6(%ebx),%edi
  809d6e:	c7 04 24 ff 3f 00 00 	movl   $0x3fff,(%esp)
  809d75:	e8 79 0f 00 00       	call   80acf3 <htons>
  809d7a:	66 85 f8             	test   %di,%ax
  809d7d:	74 15                	je     809d94 <ip_input+0x1e0>
#if IP_REASSEMBLY /* packet fragment reassembly code present? */
    LWIP_DEBUGF(IP_DEBUG, ("IP packet is a fragment (id=0x%04"X16_F" tot_len=%"U16_F" len=%"U16_F" MF=%"U16_F" offset=%"U16_F"), calling ip_reass()\n",
      ntohs(IPH_ID(iphdr)), p->tot_len, ntohs(IPH_LEN(iphdr)), !!(IPH_OFFSET(iphdr) & htons(IP_MF)), (ntohs(IPH_OFFSET(iphdr)) & IP_OFFMASK)*8));
    /* reassemble the packet*/
    p = ip_reass(p);
  809d7f:	89 34 24             	mov    %esi,(%esp)
  809d82:	e8 4a 05 00 00       	call   80a2d1 <ip_reass>
  809d87:	89 c6                	mov    %eax,%esi
    /* packet not fully reassembled yet? */
    if (p == NULL) {
  809d89:	85 c0                	test   %eax,%eax
  809d8b:	0f 84 cc 00 00 00    	je     809e5d <ip_input+0x2a9>
      return ERR_OK;
    }
    iphdr = p->payload;
  809d91:	8b 58 04             	mov    0x4(%eax),%ebx
  ip_debug_print(p);
  LWIP_DEBUGF(IP_DEBUG, ("ip_input: p->len %"U16_F" p->tot_len %"U16_F"\n", p->len, p->tot_len));

#if LWIP_RAW
  /* raw input did not eat the packet? */
  if (raw_input(p, inp) == 0)
  809d94:	8b 45 0c             	mov    0xc(%ebp),%eax
  809d97:	89 44 24 04          	mov    %eax,0x4(%esp)
  809d9b:	89 34 24             	mov    %esi,(%esp)
  809d9e:	e8 50 7e 00 00       	call   811bf3 <raw_input>
  809da3:	84 c0                	test   %al,%al
  809da5:	0f 85 b2 00 00 00    	jne    809e5d <ip_input+0x2a9>
#endif /* LWIP_RAW */
  {

    switch (IPH_PROTO(iphdr)) {
  809dab:	0f b7 43 08          	movzwl 0x8(%ebx),%eax
  809daf:	89 04 24             	mov    %eax,(%esp)
  809db2:	e8 49 0f 00 00       	call   80ad00 <ntohs>
  809db7:	0f b6 c0             	movzbl %al,%eax
  809dba:	83 f8 06             	cmp    $0x6,%eax
  809dbd:	74 24                	je     809de3 <ip_input+0x22f>
  809dbf:	83 f8 11             	cmp    $0x11,%eax
  809dc2:	74 0e                	je     809dd2 <ip_input+0x21e>
  809dc4:	83 f8 01             	cmp    $0x1,%eax
  809dc7:	75 3c                	jne    809e05 <ip_input+0x251>
  809dc9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  809dd0:	eb 22                	jmp    809df4 <ip_input+0x240>
    case IP_PROTO_UDP:
#if LWIP_UDPLITE
    case IP_PROTO_UDPLITE:
#endif /* LWIP_UDPLITE */
      snmp_inc_ipindelivers();
      udp_input(p, inp);
  809dd2:	8b 45 0c             	mov    0xc(%ebp),%eax
  809dd5:	89 44 24 04          	mov    %eax,0x4(%esp)
  809dd9:	89 34 24             	mov    %esi,(%esp)
  809ddc:	e8 c7 26 00 00       	call   80c4a8 <udp_input>
      break;
  809de1:	eb 7a                	jmp    809e5d <ip_input+0x2a9>
#endif /* LWIP_UDP */
#if LWIP_TCP
    case IP_PROTO_TCP:
      snmp_inc_ipindelivers();
      tcp_input(p, inp);
  809de3:	8b 45 0c             	mov    0xc(%ebp),%eax
  809de6:	89 44 24 04          	mov    %eax,0x4(%esp)
  809dea:	89 34 24             	mov    %esi,(%esp)
  809ded:	e8 c5 6d 00 00       	call   810bb7 <tcp_input>
      break;
  809df2:	eb 69                	jmp    809e5d <ip_input+0x2a9>
#endif /* LWIP_TCP */
#if LWIP_ICMP
    case IP_PROTO_ICMP:
      snmp_inc_ipindelivers();
      icmp_input(p, inp);
  809df4:	8b 45 0c             	mov    0xc(%ebp),%eax
  809df7:	89 44 24 04          	mov    %eax,0x4(%esp)
  809dfb:	89 34 24             	mov    %esi,(%esp)
  809dfe:	e8 c1 80 00 00       	call   811ec4 <icmp_input>
      break;
  809e03:	eb 58                	jmp    809e5d <ip_input+0x2a9>
      break;
#endif /* LWIP_IGMP */
    default:
#if LWIP_ICMP
      /* send ICMP destination protocol unreachable unless is was a broadcast */
      if (!ip_addr_isbroadcast(&(iphdr->dest), inp) &&
  809e05:	8b 45 0c             	mov    0xc(%ebp),%eax
  809e08:	89 44 24 04          	mov    %eax,0x4(%esp)
  809e0c:	8d 43 10             	lea    0x10(%ebx),%eax
  809e0f:	89 04 24             	mov    %eax,(%esp)
  809e12:	e8 d1 fa ff ff       	call   8098e8 <ip_addr_isbroadcast>
  809e17:	84 c0                	test   %al,%al
  809e19:	75 3a                	jne    809e55 <ip_input+0x2a1>
          !ip_addr_ismulticast(&(iphdr->dest))) {
  809e1b:	8b 43 10             	mov    0x10(%ebx),%eax
  809e1e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  809e21:	c7 04 24 00 00 00 f0 	movl   $0xf0000000,(%esp)
  809e28:	e8 08 11 00 00       	call   80af35 <ntohl>
  809e2d:	89 c7                	mov    %eax,%edi
  809e2f:	c7 04 24 00 00 00 e0 	movl   $0xe0000000,(%esp)
  809e36:	e8 fa 10 00 00       	call   80af35 <ntohl>
      break;
#endif /* LWIP_IGMP */
    default:
#if LWIP_ICMP
      /* send ICMP destination protocol unreachable unless is was a broadcast */
      if (!ip_addr_isbroadcast(&(iphdr->dest), inp) &&
  809e3b:	23 7d e4             	and    -0x1c(%ebp),%edi
  809e3e:	39 c7                	cmp    %eax,%edi
  809e40:	74 13                	je     809e55 <ip_input+0x2a1>
          !ip_addr_ismulticast(&(iphdr->dest))) {
        p->payload = iphdr;
  809e42:	89 5e 04             	mov    %ebx,0x4(%esi)
        icmp_dest_unreach(p, ICMP_DUR_PROTO);
  809e45:	c7 44 24 04 02 00 00 	movl   $0x2,0x4(%esp)
  809e4c:	00 
  809e4d:	89 34 24             	mov    %esi,(%esp)
  809e50:	e8 5d 7f 00 00       	call   811db2 <icmp_dest_unreach>
      }
#endif /* LWIP_ICMP */
      pbuf_free(p);
  809e55:	89 34 24             	mov    %esi,(%esp)
  809e58:	e8 a0 e0 ff ff       	call   807efd <pbuf_free>
      snmp_inc_ipinunknownprotos();
    }
  }

  return ERR_OK;
}
  809e5d:	b8 00 00 00 00       	mov    $0x0,%eax
  809e62:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  809e65:	8b 75 f8             	mov    -0x8(%ebp),%esi
  809e68:	8b 7d fc             	mov    -0x4(%ebp),%edi
  809e6b:	89 ec                	mov    %ebp,%esp
  809e6d:	5d                   	pop    %ebp
  809e6e:	c3                   	ret    
	...

00809e70 <ip_frag>:
 *
 * @return ERR_OK if sent successfully, err_t otherwise
 */
err_t 
ip_frag(struct pbuf *p, struct netif *netif, struct ip_addr *dest)
{
  809e70:	55                   	push   %ebp
  809e71:	89 e5                	mov    %esp,%ebp
  809e73:	57                   	push   %edi
  809e74:	56                   	push   %esi
  809e75:	53                   	push   %ebx
  809e76:	83 ec 5c             	sub    $0x5c,%esp
  struct ip_hdr *original_iphdr;
#endif
  struct ip_hdr *iphdr;
  u16_t nfb;
  u16_t left, cop;
  u16_t mtu = netif->mtu;
  809e79:	8b 45 0c             	mov    0xc(%ebp),%eax
  809e7c:	0f b7 70 2c          	movzwl 0x2c(%eax),%esi
#if IP_FRAG_USES_STATIC_BUF
  /* When using a static buffer, we use a PBUF_REF, which we will
   * use to reference the packet (without link header).
   * Layer and length is irrelevant.
   */
  rambuf = pbuf_alloc(PBUF_LINK, 0, PBUF_REF);
  809e80:	c7 44 24 08 02 00 00 	movl   $0x2,0x8(%esp)
  809e87:	00 
  809e88:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  809e8f:	00 
  809e90:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  809e97:	e8 1d e3 ff ff       	call   8081b9 <pbuf_alloc>
  809e9c:	89 45 d8             	mov    %eax,-0x28(%ebp)
  if (rambuf == NULL) {
  809e9f:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  809ea4:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  809ea8:	0f 84 c6 01 00 00    	je     80a074 <ip_frag+0x204>
    LWIP_DEBUGF(IP_REASS_DEBUG, ("ip_frag: pbuf_alloc(PBUF_LINK, 0, PBUF_REF) failed\n"));
    return ERR_MEM;
  }
  rambuf->tot_len = rambuf->len = mtu;
  809eae:	8b 55 d8             	mov    -0x28(%ebp),%edx
  809eb1:	66 89 72 0a          	mov    %si,0xa(%edx)
  809eb5:	66 89 72 08          	mov    %si,0x8(%edx)
  rambuf->payload = LWIP_MEM_ALIGN((void *)buf);
  809eb9:	bb e3 87 b3 00       	mov    $0xb387e3,%ebx
  809ebe:	83 e3 fc             	and    $0xfffffffc,%ebx
  809ec1:	89 5a 04             	mov    %ebx,0x4(%edx)

  /* Copy the IP header in it */
  iphdr = rambuf->payload;
  SMEMCPY(iphdr, p->payload, IP_HLEN);
  809ec4:	c7 44 24 08 14 00 00 	movl   $0x14,0x8(%esp)
  809ecb:	00 
  809ecc:	8b 55 08             	mov    0x8(%ebp),%edx
  809ecf:	8b 42 04             	mov    0x4(%edx),%eax
  809ed2:	89 44 24 04          	mov    %eax,0x4(%esp)
  809ed6:	89 1c 24             	mov    %ebx,(%esp)
  809ed9:	e8 83 74 ff ff       	call   801361 <memcpy>
  original_iphdr = p->payload;
  iphdr = original_iphdr;
#endif /* IP_FRAG_USES_STATIC_BUF */

  /* Save original offset */
  tmp = ntohs(IPH_OFFSET(iphdr));
  809ede:	0f b7 43 06          	movzwl 0x6(%ebx),%eax
  809ee2:	89 04 24             	mov    %eax,(%esp)
  809ee5:	e8 16 0e 00 00       	call   80ad00 <ntohs>
  809eea:	89 c2                	mov    %eax,%edx
  ofo = tmp & IP_OFFMASK;
  omf = tmp & IP_MF;
  809eec:	66 25 00 20          	and    $0x2000,%ax
  809ef0:	66 89 45 d2          	mov    %ax,-0x2e(%ebp)

  left = p->tot_len - IP_HLEN;
  809ef4:	8b 45 08             	mov    0x8(%ebp),%eax
  809ef7:	0f b7 48 08          	movzwl 0x8(%eax),%ecx

  nfb = (mtu - IP_HLEN) / 8;
  809efb:	0f b7 f6             	movzwl %si,%esi
  809efe:	8d 46 f3             	lea    -0xd(%esi),%eax
  809f01:	83 ee 14             	sub    $0x14,%esi
  809f04:	89 75 d4             	mov    %esi,-0x2c(%ebp)
  809f07:	0f 49 c6             	cmovns %esi,%eax
  809f0a:	c1 e8 03             	shr    $0x3,%eax
  809f0d:	66 89 45 b8          	mov    %ax,-0x48(%ebp)

  while (left) {
  809f11:	66 83 e9 14          	sub    $0x14,%cx
  809f15:	66 89 4d e6          	mov    %cx,-0x1a(%ebp)
  809f19:	0f 84 45 01 00 00    	je     80a064 <ip_frag+0x1f4>
  iphdr = original_iphdr;
#endif /* IP_FRAG_USES_STATIC_BUF */

  /* Save original offset */
  tmp = ntohs(IPH_OFFSET(iphdr));
  ofo = tmp & IP_OFFMASK;
  809f1f:	66 81 e2 ff 1f       	and    $0x1fff,%dx
  809f24:	66 89 55 e0          	mov    %dx,-0x20(%ebp)
    tmp = omf | (IP_OFFMASK & (ofo));
    if (!last)
      tmp = tmp | IP_MF;

    /* Fill this fragment */
    cop = last ? left : nfb * 8;
  809f28:	66 c7 45 e2 14 00    	movw   $0x14,-0x1e(%ebp)
    last = (left <= mtu - IP_HLEN);

    /* Set new offset and MF flag */
    tmp = omf | (IP_OFFMASK & (ofo));
    if (!last)
      tmp = tmp | IP_MF;
  809f2e:	c1 e0 03             	shl    $0x3,%eax
  809f31:	66 89 45 b2          	mov    %ax,-0x4e(%ebp)

    /* Fill this fragment */
    cop = last ? left : nfb * 8;

#if IP_FRAG_USES_STATIC_BUF
    poff += pbuf_copy_partial(p, (u8_t*)iphdr + IP_HLEN, cop, poff);
  809f35:	8d 53 14             	lea    0x14(%ebx),%edx
  809f38:	89 55 b4             	mov    %edx,-0x4c(%ebp)
  left = p->tot_len - IP_HLEN;

  nfb = (mtu - IP_HLEN) / 8;

  while (left) {
    last = (left <= mtu - IP_HLEN);
  809f3b:	0f b7 45 e6          	movzwl -0x1a(%ebp),%eax
  809f3f:	39 45 d4             	cmp    %eax,-0x2c(%ebp)
  809f42:	0f 9d c0             	setge  %al
  809f45:	0f b6 f0             	movzbl %al,%esi

    /* Set new offset and MF flag */
    tmp = omf | (IP_OFFMASK & (ofo));
  809f48:	0f b7 45 e0          	movzwl -0x20(%ebp),%eax
  809f4c:	66 25 ff 1f          	and    $0x1fff,%ax
  809f50:	66 0b 45 d2          	or     -0x2e(%ebp),%ax
  809f54:	66 89 45 e4          	mov    %ax,-0x1c(%ebp)
    if (!last)
  809f58:	0f b7 7d e6          	movzwl -0x1a(%ebp),%edi
  809f5c:	66 85 f6             	test   %si,%si
  809f5f:	75 0a                	jne    809f6b <ip_frag+0xfb>
      tmp = tmp | IP_MF;
  809f61:	66 81 4d e4 00 20    	orw    $0x2000,-0x1c(%ebp)
  809f67:	0f b7 7d b2          	movzwl -0x4e(%ebp),%edi

    /* Fill this fragment */
    cop = last ? left : nfb * 8;

#if IP_FRAG_USES_STATIC_BUF
    poff += pbuf_copy_partial(p, (u8_t*)iphdr + IP_HLEN, cop, poff);
  809f6b:	0f b7 45 e2          	movzwl -0x1e(%ebp),%eax
  809f6f:	89 44 24 0c          	mov    %eax,0xc(%esp)
  809f73:	0f b7 c7             	movzwl %di,%eax
  809f76:	89 44 24 08          	mov    %eax,0x8(%esp)
  809f7a:	8b 45 b4             	mov    -0x4c(%ebp),%eax
  809f7d:	89 44 24 04          	mov    %eax,0x4(%esp)
  809f81:	8b 55 08             	mov    0x8(%ebp),%edx
  809f84:	89 14 24             	mov    %edx,(%esp)
  809f87:	e8 fa dc ff ff       	call   807c86 <pbuf_copy_partial>
  809f8c:	66 89 45 de          	mov    %ax,-0x22(%ebp)
    }
    poff = newpbuflen;
#endif /* IP_FRAG_USES_STATIC_BUF */

    /* Correct header */
    IPH_OFFSET_SET(iphdr, htons(tmp));
  809f90:	0f b7 45 e4          	movzwl -0x1c(%ebp),%eax
  809f94:	89 04 24             	mov    %eax,(%esp)
  809f97:	e8 57 0d 00 00       	call   80acf3 <htons>
  809f9c:	66 89 43 06          	mov    %ax,0x6(%ebx)
    IPH_LEN_SET(iphdr, htons(cop + IP_HLEN));
  809fa0:	8d 47 14             	lea    0x14(%edi),%eax
  809fa3:	0f b7 c0             	movzwl %ax,%eax
  809fa6:	89 04 24             	mov    %eax,(%esp)
  809fa9:	e8 45 0d 00 00       	call   80acf3 <htons>
  809fae:	66 89 43 02          	mov    %ax,0x2(%ebx)
    IPH_CHKSUM_SET(iphdr, 0);
  809fb2:	66 c7 43 0a 00 00    	movw   $0x0,0xa(%ebx)
    IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN));
  809fb8:	c7 44 24 04 14 00 00 	movl   $0x14,0x4(%esp)
  809fbf:	00 
  809fc0:	89 1c 24             	mov    %ebx,(%esp)
  809fc3:	e8 12 0a 00 00       	call   80a9da <inet_chksum>
  809fc8:	66 89 43 0a          	mov    %ax,0xa(%ebx)

#if IP_FRAG_USES_STATIC_BUF
    if (last)
  809fcc:	66 85 f6             	test   %si,%si
  809fcf:	74 19                	je     809fea <ip_frag+0x17a>
      pbuf_realloc(rambuf, left + IP_HLEN);
  809fd1:	0f b7 45 e6          	movzwl -0x1a(%ebp),%eax
  809fd5:	83 c0 14             	add    $0x14,%eax
  809fd8:	0f b7 c0             	movzwl %ax,%eax
  809fdb:	89 44 24 04          	mov    %eax,0x4(%esp)
  809fdf:	8b 45 d8             	mov    -0x28(%ebp),%eax
  809fe2:	89 04 24             	mov    %eax,(%esp)
  809fe5:	e8 9f e0 ff ff       	call   808089 <pbuf_realloc>
    /* This part is ugly: we alloc a RAM based pbuf for 
     * the link level header for each chunk and then 
     * free it.A PBUF_ROM style pbuf for which pbuf_header
     * worked would make things simpler.
     */
    header = pbuf_alloc(PBUF_LINK, 0, PBUF_RAM);
  809fea:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  809ff1:	00 
  809ff2:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  809ff9:	00 
  809ffa:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  80a001:	e8 b3 e1 ff ff       	call   8081b9 <pbuf_alloc>
  80a006:	89 c6                	mov    %eax,%esi
    if (header != NULL) {
  80a008:	85 c0                	test   %eax,%eax
  80a00a:	74 46                	je     80a052 <ip_frag+0x1e2>
      pbuf_chain(header, rambuf);
  80a00c:	8b 55 d8             	mov    -0x28(%ebp),%edx
  80a00f:	89 54 24 04          	mov    %edx,0x4(%esp)
  80a013:	89 04 24             	mov    %eax,(%esp)
  80a016:	e8 51 db ff ff       	call   807b6c <pbuf_chain>
      netif->output(netif, header, dest);
  80a01b:	8b 45 10             	mov    0x10(%ebp),%eax
  80a01e:	89 44 24 08          	mov    %eax,0x8(%esp)
  80a022:	89 74 24 04          	mov    %esi,0x4(%esp)
  80a026:	8b 55 0c             	mov    0xc(%ebp),%edx
  80a029:	89 14 24             	mov    %edx,(%esp)
  80a02c:	ff 52 14             	call   *0x14(%edx)
      IPFRAG_STATS_INC(ip_frag.xmit);
      snmp_inc_ipfragcreates();
      pbuf_free(header);
  80a02f:	89 34 24             	mov    %esi,(%esp)
  80a032:	e8 c6 de ff ff       	call   807efd <pbuf_free>

  left = p->tot_len - IP_HLEN;

  nfb = (mtu - IP_HLEN) / 8;

  while (left) {
  80a037:	66 29 7d e6          	sub    %di,-0x1a(%ebp)
  80a03b:	74 27                	je     80a064 <ip_frag+0x1f4>

    /* Fill this fragment */
    cop = last ? left : nfb * 8;

#if IP_FRAG_USES_STATIC_BUF
    poff += pbuf_copy_partial(p, (u8_t*)iphdr + IP_HLEN, cop, poff);
  80a03d:	0f b7 45 de          	movzwl -0x22(%ebp),%eax
  80a041:	66 01 45 e2          	add    %ax,-0x1e(%ebp)
     */
    
    pbuf_free(rambuf);
#endif /* IP_FRAG_USES_STATIC_BUF */
    left -= cop;
    ofo += nfb;
  80a045:	0f b7 55 b8          	movzwl -0x48(%ebp),%edx
  80a049:	66 01 55 e0          	add    %dx,-0x20(%ebp)
  80a04d:	e9 e9 fe ff ff       	jmp    809f3b <ip_frag+0xcb>
      IPFRAG_STATS_INC(ip_frag.xmit);
      snmp_inc_ipfragcreates();
      pbuf_free(header);
    } else {
      LWIP_DEBUGF(IP_REASS_DEBUG, ("ip_frag: pbuf_alloc() for header failed\n"));
      pbuf_free(rambuf);
  80a052:	8b 45 d8             	mov    -0x28(%ebp),%eax
  80a055:	89 04 24             	mov    %eax,(%esp)
  80a058:	e8 a0 de ff ff       	call   807efd <pbuf_free>
  80a05d:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
      return ERR_MEM;
  80a062:	eb 10                	jmp    80a074 <ip_frag+0x204>
#endif /* IP_FRAG_USES_STATIC_BUF */
    left -= cop;
    ofo += nfb;
  }
#if IP_FRAG_USES_STATIC_BUF
  pbuf_free(rambuf);
  80a064:	8b 55 d8             	mov    -0x28(%ebp),%edx
  80a067:	89 14 24             	mov    %edx,(%esp)
  80a06a:	e8 8e de ff ff       	call   807efd <pbuf_free>
  80a06f:	b8 00 00 00 00       	mov    $0x0,%eax
#endif /* IP_FRAG_USES_STATIC_BUF */
  snmp_inc_ipfragoks();
  return ERR_OK;
}
  80a074:	83 c4 5c             	add    $0x5c,%esp
  80a077:	5b                   	pop    %ebx
  80a078:	5e                   	pop    %esi
  80a079:	5f                   	pop    %edi
  80a07a:	5d                   	pop    %ebp
  80a07b:	c3                   	ret    

0080a07c <ip_reass_dequeue_datagram>:
 * Dequeues a datagram from the datagram queue. Doesn't deallocate the pbufs.
 * @param ipr points to the queue entry to dequeue
 */
static void
ip_reass_dequeue_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev)
{
  80a07c:	55                   	push   %ebp
  80a07d:	89 e5                	mov    %esp,%ebp
  80a07f:	83 ec 18             	sub    $0x18,%esp
  
  /* dequeue the reass struct  */
  if (reassdatagrams == ipr) {
  80a082:	8b 0d c0 87 b3 00    	mov    0xb387c0,%ecx
  80a088:	39 c1                	cmp    %eax,%ecx
  80a08a:	75 0a                	jne    80a096 <ip_reass_dequeue_datagram+0x1a>
    /* it was the first in the list */
    reassdatagrams = ipr->next;
  80a08c:	8b 11                	mov    (%ecx),%edx
  80a08e:	89 15 c0 87 b3 00    	mov    %edx,0xb387c0
  80a094:	eb 24                	jmp    80a0ba <ip_reass_dequeue_datagram+0x3e>
  } else {
    /* it wasn't the first, so it must have a valid 'prev' */
    LWIP_ASSERT("sanity check linked list", prev != NULL);
  80a096:	85 d2                	test   %edx,%edx
  80a098:	75 1c                	jne    80a0b6 <ip_reass_dequeue_datagram+0x3a>
  80a09a:	c7 44 24 08 f1 3c 81 	movl   $0x813cf1,0x8(%esp)
  80a0a1:	00 
  80a0a2:	c7 44 24 04 29 01 00 	movl   $0x129,0x4(%esp)
  80a0a9:	00 
  80a0aa:	c7 04 24 0a 3d 81 00 	movl   $0x813d0a,(%esp)
  80a0b1:	e8 e6 68 ff ff       	call   80099c <_panic>
    prev->next = ipr->next;
  80a0b6:	8b 08                	mov    (%eax),%ecx
  80a0b8:	89 0a                	mov    %ecx,(%edx)
  }

  /* now we can free the ip_reass struct */
  memp_free(MEMP_REASSDATA, ipr);
  80a0ba:	89 44 24 04          	mov    %eax,0x4(%esp)
  80a0be:	c7 04 24 05 00 00 00 	movl   $0x5,(%esp)
  80a0c5:	e8 aa d6 ff ff       	call   807774 <memp_free>
}
  80a0ca:	c9                   	leave  
  80a0cb:	c3                   	ret    

0080a0cc <ip_reass_free_complete_datagram>:
 * @param prev the previous datagram in the linked list
 * @return the number of pbufs freed
 */
static int
ip_reass_free_complete_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev)
{
  80a0cc:	55                   	push   %ebp
  80a0cd:	89 e5                	mov    %esp,%ebp
  80a0cf:	57                   	push   %edi
  80a0d0:	56                   	push   %esi
  80a0d1:	53                   	push   %ebx
  80a0d2:	83 ec 2c             	sub    $0x2c,%esp
  80a0d5:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  80a0d8:	89 55 e0             	mov    %edx,-0x20(%ebp)
  int pbufs_freed = 0;
  struct pbuf *p;
  struct ip_reass_helper *iprh;

  LWIP_ASSERT("prev != ipr", prev != ipr);
  80a0db:	39 c2                	cmp    %eax,%edx
  80a0dd:	75 1c                	jne    80a0fb <ip_reass_free_complete_datagram+0x2f>
  80a0df:	c7 44 24 08 27 3d 81 	movl   $0x813d27,0x8(%esp)
  80a0e6:	00 
  80a0e7:	c7 44 24 04 99 00 00 	movl   $0x99,0x4(%esp)
  80a0ee:	00 
  80a0ef:	c7 04 24 0a 3d 81 00 	movl   $0x813d0a,(%esp)
  80a0f6:	e8 a1 68 ff ff       	call   80099c <_panic>
  if (prev != NULL) {
  80a0fb:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  80a0ff:	74 26                	je     80a127 <ip_reass_free_complete_datagram+0x5b>
    LWIP_ASSERT("prev->next == ipr", prev->next == ipr);
  80a101:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80a104:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80a107:	39 10                	cmp    %edx,(%eax)
  80a109:	74 1c                	je     80a127 <ip_reass_free_complete_datagram+0x5b>
  80a10b:	c7 44 24 08 33 3d 81 	movl   $0x813d33,0x8(%esp)
  80a112:	00 
  80a113:	c7 44 24 04 9b 00 00 	movl   $0x9b,0x4(%esp)
  80a11a:	00 
  80a11b:	c7 04 24 0a 3d 81 00 	movl   $0x813d0a,(%esp)
  80a122:	e8 75 68 ff ff       	call   80099c <_panic>
  }

  snmp_inc_ipreasmfails();
#if LWIP_ICMP
  iprh = (struct ip_reass_helper *)ipr->p->payload;
  80a127:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80a12a:	8b 58 04             	mov    0x4(%eax),%ebx
  80a12d:	8b 43 04             	mov    0x4(%ebx),%eax
  if (iprh->start == 0) {
  80a130:	bf 00 00 00 00       	mov    $0x0,%edi
  80a135:	66 83 78 04 00       	cmpw   $0x0,0x4(%eax)
  80a13a:	75 47                	jne    80a183 <ip_reass_free_complete_datagram+0xb7>
    /* The first fragment was received, send ICMP time exceeded. */
    /* First, de-queue the first pbuf from r->p. */
    p = ipr->p;
    ipr->p = iprh->next_pbuf;
  80a13c:	8b 00                	mov    (%eax),%eax
  80a13e:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80a141:	89 42 04             	mov    %eax,0x4(%edx)
    /* Then, copy the original header into it. */
    SMEMCPY(p->payload, &ipr->iphdr, IP_HLEN);
  80a144:	c7 44 24 08 14 00 00 	movl   $0x14,0x8(%esp)
  80a14b:	00 
  80a14c:	89 d0                	mov    %edx,%eax
  80a14e:	83 c0 08             	add    $0x8,%eax
  80a151:	89 44 24 04          	mov    %eax,0x4(%esp)
  80a155:	8b 43 04             	mov    0x4(%ebx),%eax
  80a158:	89 04 24             	mov    %eax,(%esp)
  80a15b:	e8 01 72 ff ff       	call   801361 <memcpy>
    icmp_time_exceeded(p, ICMP_TE_FRAG);
  80a160:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  80a167:	00 
  80a168:	89 1c 24             	mov    %ebx,(%esp)
  80a16b:	e8 30 7b 00 00       	call   811ca0 <icmp_time_exceeded>
    pbufs_freed += pbuf_clen(p);
  80a170:	89 1c 24             	mov    %ebx,(%esp)
  80a173:	e8 28 d9 ff ff       	call   807aa0 <pbuf_clen>
  80a178:	0f b6 f8             	movzbl %al,%edi
    pbuf_free(p);
  80a17b:	89 1c 24             	mov    %ebx,(%esp)
  80a17e:	e8 7a dd ff ff       	call   807efd <pbuf_free>
  }
#endif /* LWIP_ICMP */

  /* First, free all received pbufs.  The individual pbufs need to be released 
     separately as they have not yet been chained */
  p = ipr->p;
  80a183:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80a186:	8b 58 04             	mov    0x4(%eax),%ebx
  while (p != NULL) {
  80a189:	85 db                	test   %ebx,%ebx
  80a18b:	74 22                	je     80a1af <ip_reass_free_complete_datagram+0xe3>
    struct pbuf *pcur;
    iprh = (struct ip_reass_helper *)p->payload;
  80a18d:	8b 43 04             	mov    0x4(%ebx),%eax
    pcur = p;
    /* get the next pointer before freeing */
    p = iprh->next_pbuf;
  80a190:	8b 30                	mov    (%eax),%esi
    pbufs_freed += pbuf_clen(pcur);
  80a192:	89 1c 24             	mov    %ebx,(%esp)
  80a195:	e8 06 d9 ff ff       	call   807aa0 <pbuf_clen>
  80a19a:	0f b6 c0             	movzbl %al,%eax
  80a19d:	01 c7                	add    %eax,%edi
    pbuf_free(pcur);    
  80a19f:	89 1c 24             	mov    %ebx,(%esp)
  80a1a2:	e8 56 dd ff ff       	call   807efd <pbuf_free>
#endif /* LWIP_ICMP */

  /* First, free all received pbufs.  The individual pbufs need to be released 
     separately as they have not yet been chained */
  p = ipr->p;
  while (p != NULL) {
  80a1a7:	85 f6                	test   %esi,%esi
  80a1a9:	74 04                	je     80a1af <ip_reass_free_complete_datagram+0xe3>
  80a1ab:	89 f3                	mov    %esi,%ebx
  80a1ad:	eb de                	jmp    80a18d <ip_reass_free_complete_datagram+0xc1>
    p = iprh->next_pbuf;
    pbufs_freed += pbuf_clen(pcur);
    pbuf_free(pcur);    
  }
  /* Then, unchain the struct ip_reassdata from the list and free it. */
  ip_reass_dequeue_datagram(ipr, prev);
  80a1af:	8b 55 e0             	mov    -0x20(%ebp),%edx
  80a1b2:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80a1b5:	e8 c2 fe ff ff       	call   80a07c <ip_reass_dequeue_datagram>
  LWIP_ASSERT("ip_reass_pbufcount >= clen", ip_reass_pbufcount >= pbufs_freed);
  80a1ba:	0f b7 05 c4 87 b3 00 	movzwl 0xb387c4,%eax
  80a1c1:	0f b7 d0             	movzwl %ax,%edx
  80a1c4:	39 fa                	cmp    %edi,%edx
  80a1c6:	7d 1c                	jge    80a1e4 <ip_reass_free_complete_datagram+0x118>
  80a1c8:	c7 44 24 08 45 3d 81 	movl   $0x813d45,0x8(%esp)
  80a1cf:	00 
  80a1d0:	c7 44 24 04 bc 00 00 	movl   $0xbc,0x4(%esp)
  80a1d7:	00 
  80a1d8:	c7 04 24 0a 3d 81 00 	movl   $0x813d0a,(%esp)
  80a1df:	e8 b8 67 ff ff       	call   80099c <_panic>
  ip_reass_pbufcount -= pbufs_freed;
  80a1e4:	66 29 f8             	sub    %di,%ax
  80a1e7:	66 a3 c4 87 b3 00    	mov    %ax,0xb387c4

  return pbufs_freed;
}
  80a1ed:	89 f8                	mov    %edi,%eax
  80a1ef:	83 c4 2c             	add    $0x2c,%esp
  80a1f2:	5b                   	pop    %ebx
  80a1f3:	5e                   	pop    %esi
  80a1f4:	5f                   	pop    %edi
  80a1f5:	5d                   	pop    %ebp
  80a1f6:	c3                   	ret    

0080a1f7 <ip_reass_remove_oldest_datagram>:
 *        (used for freeing other datagrams if not enough space)
 * @return the number of pbufs freed
 */
static int
ip_reass_remove_oldest_datagram(struct ip_hdr *fraghdr, int pbufs_needed)
{
  80a1f7:	55                   	push   %ebp
  80a1f8:	89 e5                	mov    %esp,%ebp
  80a1fa:	57                   	push   %edi
  80a1fb:	56                   	push   %esi
  80a1fc:	53                   	push   %ebx
  80a1fd:	83 ec 2c             	sub    $0x2c,%esp
  80a200:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  80a203:	89 55 dc             	mov    %edx,-0x24(%ebp)
  80a206:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
   * but don't free the datagram that 'fraghdr' belongs to! */
  do {
    oldest = NULL;
    prev = NULL;
    other_datagrams = 0;
    r = reassdatagrams;
  80a20d:	8b 0d c0 87 b3 00    	mov    0xb387c0,%ecx
    while (r != NULL) {
  80a213:	85 c9                	test   %ecx,%ecx
  80a215:	74 6f                	je     80a286 <ip_reass_remove_oldest_datagram+0x8f>
      if (!IP_ADDRESSES_AND_ID_MATCH(&r->iphdr, fraghdr)) {
  80a217:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80a21a:	8b 78 0c             	mov    0xc(%eax),%edi
  80a21d:	ba 00 00 00 00       	mov    $0x0,%edx
  80a222:	b8 00 00 00 00       	mov    $0x0,%eax
  80a227:	bb 00 00 00 00       	mov    $0x0,%ebx
  80a22c:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  80a22f:	39 79 14             	cmp    %edi,0x14(%ecx)
  80a232:	75 15                	jne    80a249 <ip_reass_remove_oldest_datagram+0x52>
  80a234:	8b 51 18             	mov    0x18(%ecx),%edx
  80a237:	8b 75 e4             	mov    -0x1c(%ebp),%esi
  80a23a:	3b 56 10             	cmp    0x10(%esi),%edx
  80a23d:	75 0a                	jne    80a249 <ip_reass_remove_oldest_datagram+0x52>
  80a23f:	0f b7 51 0c          	movzwl 0xc(%ecx),%edx
  80a243:	66 3b 56 04          	cmp    0x4(%esi),%dx
  80a247:	74 14                	je     80a25d <ip_reass_remove_oldest_datagram+0x66>
        /* Not the same datagram as fraghdr */
        other_datagrams++;
  80a249:	83 c3 01             	add    $0x1,%ebx
        if (oldest == NULL) {
  80a24c:	85 c0                	test   %eax,%eax
  80a24e:	74 0b                	je     80a25b <ip_reass_remove_oldest_datagram+0x64>
          oldest = r;
        } else if (r->timer <= oldest->timer) {
  80a250:	0f b6 71 1f          	movzbl 0x1f(%ecx),%esi
  80a254:	89 f2                	mov    %esi,%edx
  80a256:	3a 50 1f             	cmp    0x1f(%eax),%dl
  80a259:	77 02                	ja     80a25d <ip_reass_remove_oldest_datagram+0x66>
  80a25b:	89 c8                	mov    %ecx,%eax
          /* older than the previous oldest */
          oldest = r;
        }
      }
      if (r->next != NULL) {
  80a25d:	8b 31                	mov    (%ecx),%esi
  80a25f:	85 f6                	test   %esi,%esi
  80a261:	74 07                	je     80a26a <ip_reass_remove_oldest_datagram+0x73>
  80a263:	89 4d d4             	mov    %ecx,-0x2c(%ebp)
  80a266:	89 f1                	mov    %esi,%ecx
  80a268:	eb c5                	jmp    80a22f <ip_reass_remove_oldest_datagram+0x38>
  80a26a:	8b 55 d4             	mov    -0x2c(%ebp),%edx
        prev = r;
      }
      r = r->next;
    }
    if (oldest != NULL) {
  80a26d:	85 c0                	test   %eax,%eax
  80a26f:	74 08                	je     80a279 <ip_reass_remove_oldest_datagram+0x82>
      pbufs_freed_current = ip_reass_free_complete_datagram(oldest, prev);
  80a271:	e8 56 fe ff ff       	call   80a0cc <ip_reass_free_complete_datagram>
      pbufs_freed += pbufs_freed_current;
  80a276:	01 45 e0             	add    %eax,-0x20(%ebp)
    }
  } while ((pbufs_freed < pbufs_needed) && (other_datagrams > 1));
  80a279:	8b 75 dc             	mov    -0x24(%ebp),%esi
  80a27c:	39 75 e0             	cmp    %esi,-0x20(%ebp)
  80a27f:	7d 05                	jge    80a286 <ip_reass_remove_oldest_datagram+0x8f>
  80a281:	83 fb 01             	cmp    $0x1,%ebx
  80a284:	7f 87                	jg     80a20d <ip_reass_remove_oldest_datagram+0x16>
  return pbufs_freed;
}
  80a286:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80a289:	83 c4 2c             	add    $0x2c,%esp
  80a28c:	5b                   	pop    %ebx
  80a28d:	5e                   	pop    %esi
  80a28e:	5f                   	pop    %edi
  80a28f:	5d                   	pop    %ebp
  80a290:	c3                   	ret    

0080a291 <ip_reass_tmr>:
 *
 * Should be called every 1000 msec (defined by IP_TMR_INTERVAL).
 */
void
ip_reass_tmr(void)
{
  80a291:	55                   	push   %ebp
  80a292:	89 e5                	mov    %esp,%ebp
  80a294:	56                   	push   %esi
  80a295:	53                   	push   %ebx
  struct ip_reassdata *r, *prev = NULL;

  r = reassdatagrams;
  80a296:	a1 c0 87 b3 00       	mov    0xb387c0,%eax
  while (r != NULL) {
  80a29b:	85 c0                	test   %eax,%eax
  80a29d:	74 2a                	je     80a2c9 <ip_reass_tmr+0x38>
  80a29f:	be 00 00 00 00       	mov    $0x0,%esi
    /* Decrement the timer. Once it reaches 0,
     * clean up the incomplete fragment assembly */
    if (r->timer > 0) {
  80a2a4:	0f b6 50 1f          	movzbl 0x1f(%eax),%edx
  80a2a8:	84 d2                	test   %dl,%dl
  80a2aa:	74 0c                	je     80a2b8 <ip_reass_tmr+0x27>
      r->timer--;
  80a2ac:	83 ea 01             	sub    $0x1,%edx
  80a2af:	88 50 1f             	mov    %dl,0x1f(%eax)
      LWIP_DEBUGF(IP_REASS_DEBUG, ("ip_reass_tmr: timer dec %"U16_F"\n",(u16_t)r->timer));
      prev = r;
      r = r->next;
  80a2b2:	8b 18                	mov    (%eax),%ebx
  80a2b4:	89 c6                	mov    %eax,%esi
  80a2b6:	eb 09                	jmp    80a2c1 <ip_reass_tmr+0x30>
      /* reassembly timed out */
      struct ip_reassdata *tmp;
      LWIP_DEBUGF(IP_REASS_DEBUG, ("ip_reass_tmr: timer timed out\n"));
      tmp = r;
      /* get the next pointer before freeing */
      r = r->next;
  80a2b8:	8b 18                	mov    (%eax),%ebx
      /* free the helper struct and all enqueued pbufs */
      ip_reass_free_complete_datagram(tmp, prev);
  80a2ba:	89 f2                	mov    %esi,%edx
  80a2bc:	e8 0b fe ff ff       	call   80a0cc <ip_reass_free_complete_datagram>
ip_reass_tmr(void)
{
  struct ip_reassdata *r, *prev = NULL;

  r = reassdatagrams;
  while (r != NULL) {
  80a2c1:	85 db                	test   %ebx,%ebx
  80a2c3:	74 04                	je     80a2c9 <ip_reass_tmr+0x38>
  80a2c5:	89 d8                	mov    %ebx,%eax
  80a2c7:	eb db                	jmp    80a2a4 <ip_reass_tmr+0x13>
      r = r->next;
      /* free the helper struct and all enqueued pbufs */
      ip_reass_free_complete_datagram(tmp, prev);
     }
   }
}
  80a2c9:	5b                   	pop    %ebx
  80a2ca:	5e                   	pop    %esi
  80a2cb:	5d                   	pop    %ebp
  80a2cc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  80a2d0:	c3                   	ret    

0080a2d1 <ip_reass>:
 * @param p points to a pbuf chain of the fragment
 * @return NULL if reassembly is incomplete, ? otherwise
 */
struct pbuf *
ip_reass(struct pbuf *p)
{
  80a2d1:	55                   	push   %ebp
  80a2d2:	89 e5                	mov    %esp,%ebp
  80a2d4:	57                   	push   %edi
  80a2d5:	56                   	push   %esi
  80a2d6:	53                   	push   %ebx
  80a2d7:	83 ec 3c             	sub    $0x3c,%esp
  struct ip_reassdata *ipr_prev = NULL;

  IPFRAG_STATS_INC(ip_frag.recv);
  snmp_inc_ipreasmreqds();

  fraghdr = (struct ip_hdr*)p->payload;
  80a2da:	8b 45 08             	mov    0x8(%ebp),%eax
  80a2dd:	8b 58 04             	mov    0x4(%eax),%ebx

  if ((IPH_HL(fraghdr) * 4) != IP_HLEN) {
  80a2e0:	0f b7 03             	movzwl (%ebx),%eax
  80a2e3:	89 04 24             	mov    %eax,(%esp)
  80a2e6:	e8 15 0a 00 00       	call   80ad00 <ntohs>
  80a2eb:	c1 e8 06             	shr    $0x6,%eax
  80a2ee:	83 e0 3c             	and    $0x3c,%eax
  80a2f1:	83 f8 14             	cmp    $0x14,%eax
  80a2f4:	0f 85 f3 04 00 00    	jne    80a7ed <ip_reass+0x51c>
    LWIP_DEBUGF(IP_REASS_DEBUG,("ip_reass: IP options currently not supported!\n"));
    IPFRAG_STATS_INC(ip_frag.err);
    goto nullreturn;
  }

  offset = (ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) * 8;
  80a2fa:	0f b7 43 06          	movzwl 0x6(%ebx),%eax
  80a2fe:	89 04 24             	mov    %eax,(%esp)
  80a301:	e8 fa 09 00 00       	call   80ad00 <ntohs>
  80a306:	66 89 45 d0          	mov    %ax,-0x30(%ebp)
  len = ntohs(IPH_LEN(fraghdr)) - IPH_HL(fraghdr) * 4;
  80a30a:	0f b7 43 02          	movzwl 0x2(%ebx),%eax
  80a30e:	89 04 24             	mov    %eax,(%esp)
  80a311:	e8 ea 09 00 00       	call   80ad00 <ntohs>
  80a316:	66 89 45 da          	mov    %ax,-0x26(%ebp)
  80a31a:	0f b7 03             	movzwl (%ebx),%eax
  80a31d:	89 04 24             	mov    %eax,(%esp)
  80a320:	e8 db 09 00 00       	call   80ad00 <ntohs>
  80a325:	66 89 45 dc          	mov    %ax,-0x24(%ebp)

  /* Check if we are allowed to enqueue more datagrams. */
  clen = pbuf_clen(p);
  80a329:	8b 55 08             	mov    0x8(%ebp),%edx
  80a32c:	89 14 24             	mov    %edx,(%esp)
  80a32f:	e8 6c d7 ff ff       	call   807aa0 <pbuf_clen>
  80a334:	89 c7                	mov    %eax,%edi
  if ((ip_reass_pbufcount + clen) > IP_REASS_MAX_PBUFS) {
  80a336:	0f b6 c8             	movzbl %al,%ecx
  80a339:	89 4d e0             	mov    %ecx,-0x20(%ebp)
  80a33c:	0f b7 05 c4 87 b3 00 	movzwl 0xb387c4,%eax
  80a343:	01 c8                	add    %ecx,%eax
  80a345:	83 f8 0a             	cmp    $0xa,%eax
  80a348:	7e 24                	jle    80a36e <ip_reass+0x9d>
#if IP_REASS_FREE_OLDEST
    if (!ip_reass_remove_oldest_datagram(fraghdr, clen) ||
  80a34a:	89 ca                	mov    %ecx,%edx
  80a34c:	89 d8                	mov    %ebx,%eax
  80a34e:	e8 a4 fe ff ff       	call   80a1f7 <ip_reass_remove_oldest_datagram>
  80a353:	85 c0                	test   %eax,%eax
  80a355:	0f 84 92 04 00 00    	je     80a7ed <ip_reass+0x51c>
  80a35b:	0f b7 05 c4 87 b3 00 	movzwl 0xb387c4,%eax
  80a362:	03 45 e0             	add    -0x20(%ebp),%eax
  80a365:	83 f8 0a             	cmp    $0xa,%eax
  80a368:	0f 8f 7f 04 00 00    	jg     80a7ed <ip_reass+0x51c>
    }
  }

  /* Look for the datagram the fragment belongs to in the current datagram queue,
   * remembering the previous in the queue for later dequeueing. */
  for (ipr = reassdatagrams; ipr != NULL; ipr = ipr->next) {
  80a36e:	8b 35 c0 87 b3 00    	mov    0xb387c0,%esi
  80a374:	85 f6                	test   %esi,%esi
  80a376:	0f 84 97 04 00 00    	je     80a813 <ip_reass+0x542>
    /* Check if the incoming fragment matches the one currently present
       in the reassembly buffer. If so, we proceed with copying the
       fragment into the buffer. */
    if (IP_ADDRESSES_AND_ID_MATCH(&ipr->iphdr, fraghdr)) {
  80a37c:	8b 53 0c             	mov    0xc(%ebx),%edx
  80a37f:	c7 45 d4 00 00 00 00 	movl   $0x0,-0x2c(%ebp)
  80a386:	b9 00 00 00 00       	mov    $0x0,%ecx
  80a38b:	39 56 14             	cmp    %edx,0x14(%esi)
  80a38e:	75 12                	jne    80a3a2 <ip_reass+0xd1>
  80a390:	8b 46 18             	mov    0x18(%esi),%eax
  80a393:	3b 43 10             	cmp    0x10(%ebx),%eax
  80a396:	75 0a                	jne    80a3a2 <ip_reass+0xd1>
  80a398:	0f b7 46 0c          	movzwl 0xc(%esi),%eax
  80a39c:	66 3b 43 04          	cmp    0x4(%ebx),%ax
  80a3a0:	74 11                	je     80a3b3 <ip_reass+0xe2>
    }
  }

  /* Look for the datagram the fragment belongs to in the current datagram queue,
   * remembering the previous in the queue for later dequeueing. */
  for (ipr = reassdatagrams; ipr != NULL; ipr = ipr->next) {
  80a3a2:	8b 06                	mov    (%esi),%eax
  80a3a4:	85 c0                	test   %eax,%eax
  80a3a6:	75 05                	jne    80a3ad <ip_reass+0xdc>
  80a3a8:	89 75 d4             	mov    %esi,-0x2c(%ebp)
  80a3ab:	eb 10                	jmp    80a3bd <ip_reass+0xec>
  80a3ad:	89 f1                	mov    %esi,%ecx
  80a3af:	89 c6                	mov    %eax,%esi
  80a3b1:	eb d8                	jmp    80a38b <ip_reass+0xba>
  80a3b3:	89 4d d4             	mov    %ecx,-0x2c(%ebp)
  80a3b6:	89 75 cc             	mov    %esi,-0x34(%ebp)
      break;
    }
    ipr_prev = ipr;
  }

  if (ipr == NULL) {
  80a3b9:	85 f6                	test   %esi,%esi
  80a3bb:	75 7d                	jne    80a43a <ip_reass+0x169>
static struct ip_reassdata*
ip_reass_enqueue_new_datagram(struct ip_hdr *fraghdr, int clen)
{
  struct ip_reassdata* ipr;
  /* No matching previous fragment found, allocate a new reassdata struct */
  ipr = memp_malloc(MEMP_REASSDATA);
  80a3bd:	c7 04 24 05 00 00 00 	movl   $0x5,(%esp)
  80a3c4:	e8 ef d3 ff ff       	call   8077b8 <memp_malloc>
  80a3c9:	89 c6                	mov    %eax,%esi
  if (ipr == NULL) {
  80a3cb:	85 c0                	test   %eax,%eax
  80a3cd:	75 29                	jne    80a3f8 <ip_reass+0x127>
#if IP_REASS_FREE_OLDEST
    if (ip_reass_remove_oldest_datagram(fraghdr, clen) >= clen) {
  80a3cf:	8b 55 e0             	mov    -0x20(%ebp),%edx
  80a3d2:	89 d8                	mov    %ebx,%eax
  80a3d4:	e8 1e fe ff ff       	call   80a1f7 <ip_reass_remove_oldest_datagram>
  80a3d9:	39 45 e0             	cmp    %eax,-0x20(%ebp)
  80a3dc:	0f 8f 0b 04 00 00    	jg     80a7ed <ip_reass+0x51c>
      ipr = memp_malloc(MEMP_REASSDATA);
  80a3e2:	c7 04 24 05 00 00 00 	movl   $0x5,(%esp)
  80a3e9:	e8 ca d3 ff ff       	call   8077b8 <memp_malloc>
  80a3ee:	89 c6                	mov    %eax,%esi
    }
    if (ipr == NULL)
  80a3f0:	85 c0                	test   %eax,%eax
  80a3f2:	0f 84 f5 03 00 00    	je     80a7ed <ip_reass+0x51c>
      IPFRAG_STATS_INC(ip_frag.memerr);
      LWIP_DEBUGF(IP_REASS_DEBUG,("Failed to alloc reassdata struct\n"));
      return NULL;
    }
  }
  memset(ipr, 0, sizeof(struct ip_reassdata));
  80a3f8:	c7 44 24 08 20 00 00 	movl   $0x20,0x8(%esp)
  80a3ff:	00 
  80a400:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80a407:	00 
  80a408:	89 34 24             	mov    %esi,(%esp)
  80a40b:	e8 76 6e ff ff       	call   801286 <memset>
  ipr->timer = IP_REASS_MAXAGE;
  80a410:	c6 46 1f 03          	movb   $0x3,0x1f(%esi)

  /* enqueue the new structure to the front of the list */
  ipr->next = reassdatagrams;
  80a414:	a1 c0 87 b3 00       	mov    0xb387c0,%eax
  80a419:	89 06                	mov    %eax,(%esi)
  reassdatagrams = ipr;
  80a41b:	89 35 c0 87 b3 00    	mov    %esi,0xb387c0
  /* copy the ip header for later tests and input */
  /* @todo: no ip options supported? */
  SMEMCPY(&(ipr->iphdr), fraghdr, IP_HLEN);
  80a421:	c7 44 24 08 14 00 00 	movl   $0x14,0x8(%esp)
  80a428:	00 
  80a429:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  80a42d:	8d 46 08             	lea    0x8(%esi),%eax
  80a430:	89 04 24             	mov    %eax,(%esp)
  80a433:	e8 29 6f ff ff       	call   801361 <memcpy>
  80a438:	eb 41                	jmp    80a47b <ip_reass+0x1aa>
    /* Bail if unable to enqueue */
    if(ipr == NULL) {
      goto nullreturn;
    }
  } else {
    if (((ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) == 0) && 
  80a43a:	0f b7 43 06          	movzwl 0x6(%ebx),%eax
  80a43e:	89 04 24             	mov    %eax,(%esp)
  80a441:	e8 ba 08 00 00       	call   80ad00 <ntohs>
  80a446:	66 a9 ff 1f          	test   $0x1fff,%ax
  80a44a:	75 2f                	jne    80a47b <ip_reass+0x1aa>
      ((ntohs(IPH_OFFSET(&ipr->iphdr)) & IP_OFFMASK) != 0)) {
  80a44c:	8b 55 cc             	mov    -0x34(%ebp),%edx
  80a44f:	0f b7 42 0e          	movzwl 0xe(%edx),%eax
  80a453:	89 04 24             	mov    %eax,(%esp)
  80a456:	e8 a5 08 00 00       	call   80ad00 <ntohs>
    /* Bail if unable to enqueue */
    if(ipr == NULL) {
      goto nullreturn;
    }
  } else {
    if (((ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) == 0) && 
  80a45b:	66 a9 ff 1f          	test   $0x1fff,%ax
  80a45f:	74 1a                	je     80a47b <ip_reass+0x1aa>
      ((ntohs(IPH_OFFSET(&ipr->iphdr)) & IP_OFFMASK) != 0)) {
      /* ipr->iphdr is not the header from the first fragment, but fraghdr is
       * -> copy fraghdr into ipr->iphdr since we want to have the header
       * of the first fragment (for ICMP time exceeded and later, for copying
       * all options, if supported)*/
      SMEMCPY(&ipr->iphdr, fraghdr, IP_HLEN);
  80a461:	c7 44 24 08 14 00 00 	movl   $0x14,0x8(%esp)
  80a468:	00 
  80a469:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  80a46d:	8b 45 cc             	mov    -0x34(%ebp),%eax
  80a470:	83 c0 08             	add    $0x8,%eax
  80a473:	89 04 24             	mov    %eax,(%esp)
  80a476:	e8 e6 6e ff ff       	call   801361 <memcpy>
    }
  }
  /* Track the current number of pbufs current 'in-flight', in order to limit 
  the number of fragments that may be enqueued at any one time */
  ip_reass_pbufcount += clen;
  80a47b:	66 81 e7 ff 00       	and    $0xff,%di
  80a480:	66 01 3d c4 87 b3 00 	add    %di,0xb387c4

  /* At this point, we have either created a new entry or pointing 
   * to an existing one */

  /* check for 'no more fragments', and update queue entry*/
  if ((ntohs(IPH_OFFSET(fraghdr)) & IP_MF) == 0) {
  80a487:	0f b7 43 06          	movzwl 0x6(%ebx),%eax
  80a48b:	89 04 24             	mov    %eax,(%esp)
  80a48e:	e8 6d 08 00 00       	call   80ad00 <ntohs>
  80a493:	f6 c4 20             	test   $0x20,%ah
  80a496:	75 23                	jne    80a4bb <ip_reass+0x1ea>
    ipr->flags |= IP_REASS_FLAG_LASTFRAG;
  80a498:	80 4e 1e 01          	orb    $0x1,0x1e(%esi)
    ipr->datagram_len = offset + len;
  80a49c:	0f b7 4d d0          	movzwl -0x30(%ebp),%ecx
  80a4a0:	0f b7 5d da          	movzwl -0x26(%ebp),%ebx
  80a4a4:	8d 14 cb             	lea    (%ebx,%ecx,8),%edx
  80a4a7:	0f b7 45 dc          	movzwl -0x24(%ebp),%eax
  80a4ab:	66 c1 e8 08          	shr    $0x8,%ax
  80a4af:	83 e0 0f             	and    $0xf,%eax
  80a4b2:	f7 d8                	neg    %eax
  80a4b4:	8d 04 82             	lea    (%edx,%eax,4),%eax
  80a4b7:	66 89 46 1c          	mov    %ax,0x1c(%esi)
  u16_t offset,len;
  struct ip_hdr *fraghdr;
  int valid = 1;

  /* Extract length and fragment offset from current fragment */
  fraghdr = (struct ip_hdr*)new_p->payload; 
  80a4bb:	8b 7d 08             	mov    0x8(%ebp),%edi
  80a4be:	8b 5f 04             	mov    0x4(%edi),%ebx
  len = ntohs(IPH_LEN(fraghdr)) - IPH_HL(fraghdr) * 4;
  80a4c1:	0f b7 43 02          	movzwl 0x2(%ebx),%eax
  80a4c5:	89 04 24             	mov    %eax,(%esp)
  80a4c8:	e8 33 08 00 00       	call   80ad00 <ntohs>
  80a4cd:	89 c7                	mov    %eax,%edi
  80a4cf:	0f b7 03             	movzwl (%ebx),%eax
  80a4d2:	89 04 24             	mov    %eax,(%esp)
  80a4d5:	e8 26 08 00 00       	call   80ad00 <ntohs>
  80a4da:	66 89 45 dc          	mov    %ax,-0x24(%ebp)
  offset = (ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) * 8;
  80a4de:	0f b7 43 06          	movzwl 0x6(%ebx),%eax
  80a4e2:	89 04 24             	mov    %eax,(%esp)
  80a4e5:	e8 16 08 00 00       	call   80ad00 <ntohs>
  80a4ea:	c1 e0 03             	shl    $0x3,%eax
  /* overwrite the fragment's ip header from the pbuf with our helper struct,
   * and setup the embedded helper structure. */
  /* make sure the struct ip_reass_helper fits into the IP header */
  LWIP_ASSERT("sizeof(struct ip_reass_helper) <= IP_HLEN",
              sizeof(struct ip_reass_helper) <= IP_HLEN);
  iprh = (struct ip_reass_helper*)new_p->payload;
  80a4ed:	8b 55 08             	mov    0x8(%ebp),%edx
  80a4f0:	8b 52 04             	mov    0x4(%edx),%edx
  80a4f3:	89 55 e0             	mov    %edx,-0x20(%ebp)
  iprh->next_pbuf = NULL;
  80a4f6:	c7 02 00 00 00 00    	movl   $0x0,(%edx)
  iprh->start = offset;
  80a4fc:	66 89 42 04          	mov    %ax,0x4(%edx)
  iprh->end = offset + len;
  80a500:	8d 0c 38             	lea    (%eax,%edi,1),%ecx
  80a503:	0f b7 55 dc          	movzwl -0x24(%ebp),%edx
  80a507:	66 c1 ea 08          	shr    $0x8,%dx
  80a50b:	83 e2 0f             	and    $0xf,%edx
  80a50e:	f7 da                	neg    %edx
  80a510:	8d 14 91             	lea    (%ecx,%edx,4),%edx
  80a513:	66 89 55 da          	mov    %dx,-0x26(%ebp)
  80a517:	8b 4d e0             	mov    -0x20(%ebp),%ecx
  80a51a:	66 89 51 06          	mov    %dx,0x6(%ecx)

  /* Iterate through until we either get to the end of the list (append),
   * or we find on with a larger offset (insert). */
  for (q = ipr->p; q != NULL;) {
  80a51e:	8b 7e 04             	mov    0x4(%esi),%edi
  80a521:	85 ff                	test   %edi,%edi
  80a523:	0f 84 0c 03 00 00    	je     80a835 <ip_reass+0x564>
    iprh_tmp = (struct ip_reass_helper*)q->payload;
  80a529:	8b 57 04             	mov    0x4(%edi),%edx
    if (iprh->start < iprh_tmp->start) {
  80a52c:	0f b7 4a 04          	movzwl 0x4(%edx),%ecx
  80a530:	66 39 c8             	cmp    %cx,%ax
  80a533:	0f 82 e6 02 00 00    	jb     80a81f <ip_reass+0x54e>
      } else {
        /* fragment with the lowest offset */
        ipr->p = new_p;
      }
      break;
    } else if(iprh->start == iprh_tmp->start) {
  80a539:	66 39 c8             	cmp    %cx,%ax
  80a53c:	0f 84 1f 02 00 00    	je     80a761 <ip_reass+0x490>
      /* received the same datagram twice: no need to keep the datagram */
      goto freepbuf;
#if IP_REASS_CHECK_OVERLAP
    } else if(iprh->start < iprh_tmp->end) {
  80a542:	c7 45 dc 01 00 00 00 	movl   $0x1,-0x24(%ebp)
  80a549:	66 39 42 06          	cmp    %ax,0x6(%edx)
  80a54d:	0f 86 87 00 00 00    	jbe    80a5da <ip_reass+0x309>
  80a553:	e9 09 02 00 00       	jmp    80a761 <ip_reass+0x490>
  iprh->end = offset + len;

  /* Iterate through until we either get to the end of the list (append),
   * or we find on with a larger offset (insert). */
  for (q = ipr->p; q != NULL;) {
    iprh_tmp = (struct ip_reass_helper*)q->payload;
  80a558:	8b 4f 04             	mov    0x4(%edi),%ecx
    if (iprh->start < iprh_tmp->start) {
  80a55b:	0f b7 59 04          	movzwl 0x4(%ecx),%ebx
  80a55f:	66 39 d8             	cmp    %bx,%ax
  80a562:	73 49                	jae    80a5ad <ip_reass+0x2dc>
  80a564:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
  80a567:	89 75 dc             	mov    %esi,-0x24(%ebp)
  80a56a:	8b 75 d0             	mov    -0x30(%ebp),%esi
  80a56d:	89 d3                	mov    %edx,%ebx
      /* the new pbuf should be inserted before this */
      iprh->next_pbuf = q;
  80a56f:	8b 4d e0             	mov    -0x20(%ebp),%ecx
  80a572:	89 39                	mov    %edi,(%ecx)
      if (iprh_prev != NULL) {
  80a574:	85 d2                	test   %edx,%edx
  80a576:	74 25                	je     80a59d <ip_reass+0x2cc>
        /* not the fragment with the lowest offset */
#if IP_REASS_CHECK_OVERLAP
        if ((iprh->start < iprh_prev->end) || (iprh->end > iprh_tmp->start)) {
  80a578:	66 3b 42 06          	cmp    0x6(%edx),%ax
  80a57c:	0f 82 df 01 00 00    	jb     80a761 <ip_reass+0x490>
  80a582:	0f b7 45 da          	movzwl -0x26(%ebp),%eax
  80a586:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  80a589:	66 3b 47 04          	cmp    0x4(%edi),%ax
  80a58d:	0f 87 ce 01 00 00    	ja     80a761 <ip_reass+0x490>
          /* fragment overlaps with previous or following, throw away */
          goto freepbuf;
        }
#endif /* IP_REASS_CHECK_OVERLAP */
        iprh_prev->next_pbuf = new_p;
  80a593:	8b 55 08             	mov    0x8(%ebp),%edx
  80a596:	89 13                	mov    %edx,(%ebx)
  80a598:	e9 c6 00 00 00       	jmp    80a663 <ip_reass+0x392>
      } else {
        /* fragment with the lowest offset */
        ipr->p = new_p;
  80a59d:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80a5a0:	89 4e 04             	mov    %ecx,0x4(%esi)
    q = iprh_tmp->next_pbuf;
    iprh_prev = iprh_tmp;
  }

  /* If q is NULL, then we made it to the end of the list. Determine what to do now */
  if (q == NULL) {
  80a5a3:	85 ff                	test   %edi,%edi
  80a5a5:	0f 85 b8 00 00 00    	jne    80a663 <ip_reass+0x392>
  80a5ab:	eb 43                	jmp    80a5f0 <ip_reass+0x31f>
      } else {
        /* fragment with the lowest offset */
        ipr->p = new_p;
      }
      break;
    } else if(iprh->start == iprh_tmp->start) {
  80a5ad:	66 39 d8             	cmp    %bx,%ax
  80a5b0:	0f 84 ab 01 00 00    	je     80a761 <ip_reass+0x490>
      /* received the same datagram twice: no need to keep the datagram */
      goto freepbuf;
#if IP_REASS_CHECK_OVERLAP
    } else if(iprh->start < iprh_tmp->end) {
  80a5b6:	66 3b 41 06          	cmp    0x6(%ecx),%ax
  80a5ba:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  80a5c0:	0f 82 9b 01 00 00    	jb     80a761 <ip_reass+0x490>
      /* overlap: no need to keep the new datagram */
      goto freepbuf;
#endif /* IP_REASS_CHECK_OVERLAP */
    } else {
      /* Check if the fragments received so far have no wholes. */
      if (iprh_prev != NULL) {
  80a5c6:	85 d2                	test   %edx,%edx
  80a5c8:	74 0c                	je     80a5d6 <ip_reass+0x305>
        if (iprh_prev->end != iprh_tmp->start) {
  80a5ca:	66 3b 5a 06          	cmp    0x6(%edx),%bx
  80a5ce:	bb 00 00 00 00       	mov    $0x0,%ebx
  80a5d3:	0f 45 f3             	cmovne %ebx,%esi
  80a5d6:	89 ca                	mov    %ecx,%edx
  80a5d8:	eb 06                	jmp    80a5e0 <ip_reass+0x30f>
  80a5da:	89 75 d0             	mov    %esi,-0x30(%ebp)
  80a5dd:	8b 75 dc             	mov    -0x24(%ebp),%esi
           * and the previous fragment */
          valid = 0;
        }
      }
    }
    q = iprh_tmp->next_pbuf;
  80a5e0:	8b 3a                	mov    (%edx),%edi
  iprh->start = offset;
  iprh->end = offset + len;

  /* Iterate through until we either get to the end of the list (append),
   * or we find on with a larger offset (insert). */
  for (q = ipr->p; q != NULL;) {
  80a5e2:	85 ff                	test   %edi,%edi
  80a5e4:	0f 85 6e ff ff ff    	jne    80a558 <ip_reass+0x287>
  80a5ea:	89 75 dc             	mov    %esi,-0x24(%ebp)
  80a5ed:	8b 75 d0             	mov    -0x30(%ebp),%esi
    iprh_prev = iprh_tmp;
  }

  /* If q is NULL, then we made it to the end of the list. Determine what to do now */
  if (q == NULL) {
    if (iprh_prev != NULL) {
  80a5f0:	85 d2                	test   %edx,%edx
  80a5f2:	74 47                	je     80a63b <ip_reass+0x36a>
      /* this is (for now), the fragment with the highest offset:
       * chain it to the last fragment */
#if IP_REASS_CHECK_OVERLAP
      LWIP_ASSERT("check fragments don't overlap", iprh_prev->end <= iprh->start);
  80a5f4:	0f b7 42 06          	movzwl 0x6(%edx),%eax
  80a5f8:	8b 7d e0             	mov    -0x20(%ebp),%edi
  80a5fb:	66 3b 47 04          	cmp    0x4(%edi),%ax
  80a5ff:	76 1c                	jbe    80a61d <ip_reass+0x34c>
  80a601:	c7 44 24 08 60 3d 81 	movl   $0x813d60,0x8(%esp)
  80a608:	00 
  80a609:	c7 44 24 04 83 01 00 	movl   $0x183,0x4(%esp)
  80a610:	00 
  80a611:	c7 04 24 0a 3d 81 00 	movl   $0x813d0a,(%esp)
  80a618:	e8 7f 63 ff ff       	call   80099c <_panic>
#endif /* IP_REASS_CHECK_OVERLAP */
      iprh_prev->next_pbuf = new_p;
  80a61d:	8b 45 08             	mov    0x8(%ebp),%eax
  80a620:	89 02                	mov    %eax,(%edx)
      if (iprh_prev->end != iprh->start) {
  80a622:	0f b7 42 06          	movzwl 0x6(%edx),%eax
  80a626:	8b 55 e0             	mov    -0x20(%ebp),%edx
  80a629:	66 3b 42 04          	cmp    0x4(%edx),%ax
  80a62d:	b8 00 00 00 00       	mov    $0x0,%eax
  80a632:	0f 44 45 dc          	cmove  -0x24(%ebp),%eax
  80a636:	89 45 dc             	mov    %eax,-0x24(%ebp)
  80a639:	eb 28                	jmp    80a663 <ip_reass+0x392>
        valid = 0;
      }
    } else {
#if IP_REASS_CHECK_OVERLAP
      LWIP_ASSERT("no previous fragment, this must be the first fragment!",
  80a63b:	83 7e 04 00          	cmpl   $0x0,0x4(%esi)
  80a63f:	74 1c                	je     80a65d <ip_reass+0x38c>
  80a641:	c7 44 24 08 8c 3d 81 	movl   $0x813d8c,0x8(%esp)
  80a648:	00 
  80a649:	c7 44 24 04 8c 01 00 	movl   $0x18c,0x4(%esp)
  80a650:	00 
  80a651:	c7 04 24 0a 3d 81 00 	movl   $0x813d0a,(%esp)
  80a658:	e8 3f 63 ff ff       	call   80099c <_panic>
        ipr->p == NULL);
#endif /* IP_REASS_CHECK_OVERLAP */
      /* this is the first fragment we ever received for this ip datagram */
      ipr->p = new_p;
  80a65d:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80a660:	89 4e 04             	mov    %ecx,0x4(%esi)
    }
  }

  /* At this point, the validation part begins: */
  /* If we already received the last fragment */
  if ((ipr->flags & IP_REASS_FLAG_LASTFRAG) != 0) {
  80a663:	f6 46 1e 01          	testb  $0x1,0x1e(%esi)
  80a667:	0f 84 94 01 00 00    	je     80a801 <ip_reass+0x530>
    /* and had no wholes so far */
    if (valid) {
  80a66d:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
  80a671:	0f 84 8a 01 00 00    	je     80a801 <ip_reass+0x530>
      /* then check if the rest of the fragments is here */
      /* Check if the queue starts with the first datagram */
      if (((struct ip_reass_helper*)ipr->p->payload)->start != 0) {
  80a677:	8b 56 04             	mov    0x4(%esi),%edx
  80a67a:	8b 42 04             	mov    0x4(%edx),%eax
  80a67d:	66 83 78 04 00       	cmpw   $0x0,0x4(%eax)
  80a682:	0f 85 79 01 00 00    	jne    80a801 <ip_reass+0x530>
        valid = 0;
      } else {
        /* and check that there are no wholes after this datagram */
        iprh_prev = iprh;
        q = iprh->next_pbuf;
  80a688:	8b 5d e0             	mov    -0x20(%ebp),%ebx
  80a68b:	8b 0b                	mov    (%ebx),%ecx
        while (q != NULL) {
  80a68d:	85 c9                	test   %ecx,%ecx
  80a68f:	0f 84 b1 01 00 00    	je     80a846 <ip_reass+0x575>
          iprh = (struct ip_reass_helper*)q->payload;
  80a695:	8b 49 04             	mov    0x4(%ecx),%ecx
          if (iprh_prev->end != iprh->start) {
  80a698:	0f b7 5b 06          	movzwl 0x6(%ebx),%ebx
  80a69c:	89 4d e0             	mov    %ecx,-0x20(%ebp)
  80a69f:	66 3b 59 04          	cmp    0x4(%ecx),%bx
  80a6a3:	74 1d                	je     80a6c2 <ip_reass+0x3f1>
  80a6a5:	e9 57 01 00 00       	jmp    80a801 <ip_reass+0x530>
      } else {
        /* and check that there are no wholes after this datagram */
        iprh_prev = iprh;
        q = iprh->next_pbuf;
        while (q != NULL) {
          iprh = (struct ip_reass_helper*)q->payload;
  80a6aa:	8b 49 04             	mov    0x4(%ecx),%ecx
          if (iprh_prev->end != iprh->start) {
  80a6ad:	0f b7 5b 06          	movzwl 0x6(%ebx),%ebx
  80a6b1:	66 3b 59 04          	cmp    0x4(%ecx),%bx
  80a6b5:	0f 85 46 01 00 00    	jne    80a801 <ip_reass+0x530>
  80a6bb:	89 cb                	mov    %ecx,%ebx
  80a6bd:	8d 76 00             	lea    0x0(%esi),%esi
  80a6c0:	eb 03                	jmp    80a6c5 <ip_reass+0x3f4>
  80a6c2:	8b 5d e0             	mov    -0x20(%ebp),%ebx
            valid = 0;
            break;
          }
          iprh_prev = iprh;
          q = iprh->next_pbuf;
  80a6c5:	8b 0b                	mov    (%ebx),%ecx
        valid = 0;
      } else {
        /* and check that there are no wholes after this datagram */
        iprh_prev = iprh;
        q = iprh->next_pbuf;
        while (q != NULL) {
  80a6c7:	85 c9                	test   %ecx,%ecx
  80a6c9:	75 df                	jne    80a6aa <ip_reass+0x3d9>
  80a6cb:	89 5d e0             	mov    %ebx,-0x20(%ebp)
  80a6ce:	e9 73 01 00 00       	jmp    80a846 <ip_reass+0x575>
          q = iprh->next_pbuf;
        }
        /* if still valid, all fragments are received
         * (because to the MF==0 already arrived */
        if (valid) {
          LWIP_ASSERT("sanity check", ipr->p != NULL);
  80a6d3:	c7 44 24 08 7e 3d 81 	movl   $0x813d7e,0x8(%esp)
  80a6da:	00 
  80a6db:	c7 44 24 04 ac 01 00 	movl   $0x1ac,0x4(%esp)
  80a6e2:	00 
  80a6e3:	c7 04 24 0a 3d 81 00 	movl   $0x813d0a,(%esp)
  80a6ea:	e8 ad 62 ff ff       	call   80099c <_panic>
          LWIP_ASSERT("sanity check",
  80a6ef:	3b 45 e0             	cmp    -0x20(%ebp),%eax
  80a6f2:	75 1c                	jne    80a710 <ip_reass+0x43f>
  80a6f4:	c7 44 24 08 7e 3d 81 	movl   $0x813d7e,0x8(%esp)
  80a6fb:	00 
  80a6fc:	c7 44 24 04 ae 01 00 	movl   $0x1ae,0x4(%esp)
  80a703:	00 
  80a704:	c7 04 24 0a 3d 81 00 	movl   $0x813d0a,(%esp)
  80a70b:	e8 8c 62 ff ff       	call   80099c <_panic>
            ((struct ip_reass_helper*)ipr->p->payload) != iprh);
          LWIP_ASSERT("validate_datagram:next_pbuf!=NULL",
  80a710:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80a713:	83 38 00             	cmpl   $0x0,(%eax)
  80a716:	74 1c                	je     80a734 <ip_reass+0x463>
  80a718:	c7 44 24 08 c4 3d 81 	movl   $0x813dc4,0x8(%esp)
  80a71f:	00 
  80a720:	c7 44 24 04 b0 01 00 	movl   $0x1b0,0x4(%esp)
  80a727:	00 
  80a728:	c7 04 24 0a 3d 81 00 	movl   $0x813d0a,(%esp)
  80a72f:	e8 68 62 ff ff       	call   80099c <_panic>
            iprh->next_pbuf == NULL);
          LWIP_ASSERT("validate_datagram:datagram end!=datagram len",
  80a734:	8b 55 e0             	mov    -0x20(%ebp),%edx
  80a737:	0f b7 42 06          	movzwl 0x6(%edx),%eax
  80a73b:	66 3b 46 1c          	cmp    0x1c(%esi),%ax
  80a73f:	0f 84 10 01 00 00    	je     80a855 <ip_reass+0x584>
  80a745:	c7 44 24 08 e8 3d 81 	movl   $0x813de8,0x8(%esp)
  80a74c:	00 
  80a74d:	c7 44 24 04 b2 01 00 	movl   $0x1b2,0x4(%esp)
  80a754:	00 
  80a755:	c7 04 24 0a 3d 81 00 	movl   $0x813d0a,(%esp)
  80a75c:	e8 3b 62 ff ff       	call   80099c <_panic>
  }
  /* If we come here, not all fragments were received, yet! */
  return 0; /* not yet valid! */
#if IP_REASS_CHECK_OVERLAP
freepbuf:
  ip_reass_pbufcount -= pbuf_clen(new_p);
  80a761:	0f b7 1d c4 87 b3 00 	movzwl 0xb387c4,%ebx
  80a768:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80a76b:	89 0c 24             	mov    %ecx,(%esp)
  80a76e:	e8 2d d3 ff ff       	call   807aa0 <pbuf_clen>
  80a773:	0f b6 c0             	movzbl %al,%eax
  80a776:	66 29 c3             	sub    %ax,%bx
  80a779:	66 89 1d c4 87 b3 00 	mov    %bx,0xb387c4
  pbuf_free(new_p);
  80a780:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80a783:	89 1c 24             	mov    %ebx,(%esp)
  80a786:	e8 72 d7 ff ff       	call   807efd <pbuf_free>
  80a78b:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  80a792:	eb 74                	jmp    80a808 <ip_reass+0x537>
  80a794:	89 75 e0             	mov    %esi,-0x20(%ebp)
  80a797:	8b 75 e4             	mov    -0x1c(%ebp),%esi

    p = ipr->p;

    /* chain together the pbufs contained within the reass_data list. */
    while(r != NULL) {
      iprh = (struct ip_reass_helper*)r->payload;
  80a79a:	8b 5f 04             	mov    0x4(%edi),%ebx

      /* hide the ip header for every succeding fragment */
      pbuf_header(r, -IP_HLEN);
  80a79d:	c7 44 24 04 ec ff ff 	movl   $0xffffffec,0x4(%esp)
  80a7a4:	ff 
  80a7a5:	89 3c 24             	mov    %edi,(%esp)
  80a7a8:	e8 e6 d3 ff ff       	call   807b93 <pbuf_header>
      pbuf_cat(p, r);
  80a7ad:	89 7c 24 04          	mov    %edi,0x4(%esp)
  80a7b1:	89 34 24             	mov    %esi,(%esp)
  80a7b4:	e8 12 d3 ff ff       	call   807acb <pbuf_cat>
      r = iprh->next_pbuf;
  80a7b9:	8b 3b                	mov    (%ebx),%edi
    IPH_CHKSUM_SET(fraghdr, inet_chksum(fraghdr, IP_HLEN));

    p = ipr->p;

    /* chain together the pbufs contained within the reass_data list. */
    while(r != NULL) {
  80a7bb:	85 ff                	test   %edi,%edi
  80a7bd:	75 db                	jne    80a79a <ip_reass+0x4c9>
  80a7bf:	8b 75 e0             	mov    -0x20(%ebp),%esi
      pbuf_header(r, -IP_HLEN);
      pbuf_cat(p, r);
      r = iprh->next_pbuf;
    }
    /* release the sources allocate for the fragment queue entry */
    ip_reass_dequeue_datagram(ipr, ipr_prev);
  80a7c2:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  80a7c5:	89 f0                	mov    %esi,%eax
  80a7c7:	e8 b0 f8 ff ff       	call   80a07c <ip_reass_dequeue_datagram>

    /* and adjust the number of pbufs currently queued for reassembly. */
    ip_reass_pbufcount -= pbuf_clen(p);
  80a7cc:	0f b7 1d c4 87 b3 00 	movzwl 0xb387c4,%ebx
  80a7d3:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  80a7d6:	89 3c 24             	mov    %edi,(%esp)
  80a7d9:	e8 c2 d2 ff ff       	call   807aa0 <pbuf_clen>
  80a7de:	0f b6 c0             	movzbl %al,%eax
  80a7e1:	66 29 c3             	sub    %ax,%bx
  80a7e4:	66 89 1d c4 87 b3 00 	mov    %bx,0xb387c4

    /* Return the pbuf chain */
    return p;
  80a7eb:	eb 1b                	jmp    80a808 <ip_reass+0x537>
  return NULL;

nullreturn:
  LWIP_DEBUGF(IP_REASS_DEBUG,("ip_reass: nullreturn\n"));
  IPFRAG_STATS_INC(ip_frag.drop);
  pbuf_free(p);
  80a7ed:	8b 45 08             	mov    0x8(%ebp),%eax
  80a7f0:	89 04 24             	mov    %eax,(%esp)
  80a7f3:	e8 05 d7 ff ff       	call   807efd <pbuf_free>
  80a7f8:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  return NULL;
  80a7ff:	eb 07                	jmp    80a808 <ip_reass+0x537>
  80a801:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
}
  80a808:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80a80b:	83 c4 3c             	add    $0x3c,%esp
  80a80e:	5b                   	pop    %ebx
  80a80f:	5e                   	pop    %esi
  80a810:	5f                   	pop    %edi
  80a811:	5d                   	pop    %ebp
  80a812:	c3                   	ret    

nullreturn:
  LWIP_DEBUGF(IP_REASS_DEBUG,("ip_reass: nullreturn\n"));
  IPFRAG_STATS_INC(ip_frag.drop);
  pbuf_free(p);
  return NULL;
  80a813:	c7 45 d4 00 00 00 00 	movl   $0x0,-0x2c(%ebp)
  80a81a:	e9 9e fb ff ff       	jmp    80a3bd <ip_reass+0xec>
   * or we find on with a larger offset (insert). */
  for (q = ipr->p; q != NULL;) {
    iprh_tmp = (struct ip_reass_helper*)q->payload;
    if (iprh->start < iprh_tmp->start) {
      /* the new pbuf should be inserted before this */
      iprh->next_pbuf = q;
  80a81f:	8b 55 e0             	mov    -0x20(%ebp),%edx
  80a822:	89 3a                	mov    %edi,(%edx)
  80a824:	c7 45 dc 01 00 00 00 	movl   $0x1,-0x24(%ebp)
  80a82b:	ba 00 00 00 00       	mov    $0x0,%edx
  80a830:	e9 68 fd ff ff       	jmp    80a59d <ip_reass+0x2cc>
  80a835:	c7 45 dc 01 00 00 00 	movl   $0x1,-0x24(%ebp)
  80a83c:	ba 00 00 00 00       	mov    $0x0,%edx
  80a841:	e9 aa fd ff ff       	jmp    80a5f0 <ip_reass+0x31f>
          q = iprh->next_pbuf;
        }
        /* if still valid, all fragments are received
         * (because to the MF==0 already arrived */
        if (valid) {
          LWIP_ASSERT("sanity check", ipr->p != NULL);
  80a846:	85 d2                	test   %edx,%edx
  80a848:	0f 85 a1 fe ff ff    	jne    80a6ef <ip_reass+0x41e>
  80a84e:	66 90                	xchg   %ax,%ax
  80a850:	e9 7e fe ff ff       	jmp    80a6d3 <ip_reass+0x402>
  /* find the right place to insert this pbuf */
  /* @todo: trim pbufs if fragments are overlapping */
  if (ip_reass_chain_frag_into_datagram_and_validate(ipr, p)) {
    /* the totally last fragment (flag more fragments = 0) was received at least
     * once AND all fragments are received */
    ipr->datagram_len += IP_HLEN;
  80a855:	83 c0 14             	add    $0x14,%eax
  80a858:	66 89 46 1c          	mov    %ax,0x1c(%esi)

    /* save the second pbuf before copying the header over the pointer */
    r = ((struct ip_reass_helper*)ipr->p->payload)->next_pbuf;
  80a85c:	8b 46 04             	mov    0x4(%esi),%eax
  80a85f:	8b 58 04             	mov    0x4(%eax),%ebx
  80a862:	8b 3b                	mov    (%ebx),%edi

    /* copy the original ip header back to the first pbuf */
    fraghdr = (struct ip_hdr*)(ipr->p->payload);
    SMEMCPY(fraghdr, &ipr->iphdr, IP_HLEN);
  80a864:	c7 44 24 08 14 00 00 	movl   $0x14,0x8(%esp)
  80a86b:	00 
  80a86c:	8d 46 08             	lea    0x8(%esi),%eax
  80a86f:	89 44 24 04          	mov    %eax,0x4(%esp)
  80a873:	89 1c 24             	mov    %ebx,(%esp)
  80a876:	e8 e6 6a ff ff       	call   801361 <memcpy>
    IPH_LEN_SET(fraghdr, htons(ipr->datagram_len));
  80a87b:	0f b7 46 1c          	movzwl 0x1c(%esi),%eax
  80a87f:	89 04 24             	mov    %eax,(%esp)
  80a882:	e8 6c 04 00 00       	call   80acf3 <htons>
  80a887:	66 89 43 02          	mov    %ax,0x2(%ebx)
    IPH_OFFSET_SET(fraghdr, 0);
  80a88b:	66 c7 43 06 00 00    	movw   $0x0,0x6(%ebx)
    IPH_CHKSUM_SET(fraghdr, 0);
  80a891:	66 c7 43 0a 00 00    	movw   $0x0,0xa(%ebx)
    /* @todo: do we need to set calculate the correct checksum? */
    IPH_CHKSUM_SET(fraghdr, inet_chksum(fraghdr, IP_HLEN));
  80a897:	c7 44 24 04 14 00 00 	movl   $0x14,0x4(%esp)
  80a89e:	00 
  80a89f:	89 1c 24             	mov    %ebx,(%esp)
  80a8a2:	e8 33 01 00 00       	call   80a9da <inet_chksum>
  80a8a7:	66 89 43 0a          	mov    %ax,0xa(%ebx)

    p = ipr->p;
  80a8ab:	8b 4e 04             	mov    0x4(%esi),%ecx
  80a8ae:	89 4d e4             	mov    %ecx,-0x1c(%ebp)

    /* chain together the pbufs contained within the reass_data list. */
    while(r != NULL) {
  80a8b1:	85 ff                	test   %edi,%edi
  80a8b3:	0f 85 db fe ff ff    	jne    80a794 <ip_reass+0x4c3>
  80a8b9:	e9 04 ff ff ff       	jmp    80a7c2 <ip_reass+0x4f1>
	...

0080a8c0 <lwip_standard_chksum>:
 * @note accumulator size limits summable length to 64k
 * @note host endianess is irrelevant (p3 RFC1071)
 */
static u16_t
lwip_standard_chksum(void *dataptr, u16_t len)
{
  80a8c0:	55                   	push   %ebp
  80a8c1:	89 e5                	mov    %esp,%ebp
  80a8c3:	57                   	push   %edi
  80a8c4:	56                   	push   %esi
  80a8c5:	53                   	push   %ebx
  80a8c6:	83 ec 2c             	sub    $0x2c,%esp
  u16_t src;
  u8_t *octetptr;

  acc = 0;
  /* dataptr may be at odd or even addresses */
  octetptr = (u8_t*)dataptr;
  80a8c9:	89 c7                	mov    %eax,%edi
  while (len > 1) {
  80a8cb:	b9 00 00 00 00       	mov    $0x0,%ecx
  80a8d0:	66 83 fa 01          	cmp    $0x1,%dx
  80a8d4:	76 3a                	jbe    80a910 <lwip_standard_chksum+0x50>
 *
 * @note accumulator size limits summable length to 64k
 * @note host endianess is irrelevant (p3 RFC1071)
 */
static u16_t
lwip_standard_chksum(void *dataptr, u16_t len)
  80a8d6:	83 ea 02             	sub    $0x2,%edx
  80a8d9:	66 89 55 e6          	mov    %dx,-0x1a(%ebp)
  80a8dd:	66 d1 ea             	shr    %dx
  80a8e0:	0f b7 d2             	movzwl %dx,%edx
  80a8e3:	89 55 e0             	mov    %edx,-0x20(%ebp)
  80a8e6:	8d 74 50 02          	lea    0x2(%eax,%edx,2),%esi
  /* dataptr may be at odd or even addresses */
  octetptr = (u8_t*)dataptr;
  while (len > 1) {
    /* declare first octet as most significant
       thus assume network order, ignoring host order */
    src = (*octetptr) << 8;
  80a8ea:	0f b6 18             	movzbl (%eax),%ebx
  80a8ed:	c1 e3 08             	shl    $0x8,%ebx
    octetptr++;
    /* declare second octet as least significant */
    src |= (*octetptr);
  80a8f0:	0f b6 50 01          	movzbl 0x1(%eax),%edx
  80a8f4:	09 da                	or     %ebx,%edx
 *
 * @note accumulator size limits summable length to 64k
 * @note host endianess is irrelevant (p3 RFC1071)
 */
static u16_t
lwip_standard_chksum(void *dataptr, u16_t len)
  80a8f6:	83 c0 02             	add    $0x2,%eax
    src = (*octetptr) << 8;
    octetptr++;
    /* declare second octet as least significant */
    src |= (*octetptr);
    octetptr++;
    acc += src;
  80a8f9:	0f b7 d2             	movzwl %dx,%edx
  80a8fc:	01 d1                	add    %edx,%ecx
  u8_t *octetptr;

  acc = 0;
  /* dataptr may be at odd or even addresses */
  octetptr = (u8_t*)dataptr;
  while (len > 1) {
  80a8fe:	39 c6                	cmp    %eax,%esi
  80a900:	75 e8                	jne    80a8ea <lwip_standard_chksum+0x2a>
  80a902:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80a905:	8d 7c 47 02          	lea    0x2(%edi,%eax,2),%edi
  80a909:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
  80a90d:	83 e2 01             	and    $0x1,%edx
    src |= (*octetptr);
    octetptr++;
    acc += src;
    len -= 2;
  }
  if (len > 0) {
  80a910:	66 85 d2             	test   %dx,%dx
  80a913:	74 0b                	je     80a920 <lwip_standard_chksum+0x60>
    /* accumulate remaining octet */
    src = (*octetptr) << 8;
    acc += src;
  80a915:	0f b6 07             	movzbl (%edi),%eax
  80a918:	c1 e0 08             	shl    $0x8,%eax
  80a91b:	0f b7 c0             	movzwl %ax,%eax
  80a91e:	01 c1                	add    %eax,%ecx
  }
  /* add deferred carry bits */
  acc = (acc >> 16) + (acc & 0x0000ffffUL);
  80a920:	89 c8                	mov    %ecx,%eax
  80a922:	c1 e8 10             	shr    $0x10,%eax
  80a925:	81 e1 ff ff 00 00    	and    $0xffff,%ecx
  80a92b:	01 c1                	add    %eax,%ecx
  if ((acc & 0xffff0000) != 0) {
  80a92d:	f7 c1 00 00 ff ff    	test   $0xffff0000,%ecx
  80a933:	74 0d                	je     80a942 <lwip_standard_chksum+0x82>
    acc = (acc >> 16) + (acc & 0x0000ffffUL);
  80a935:	89 c8                	mov    %ecx,%eax
  80a937:	c1 e8 10             	shr    $0x10,%eax
  80a93a:	81 e1 ff ff 00 00    	and    $0xffff,%ecx
  80a940:	01 c1                	add    %eax,%ecx
  }
  /* This maybe a little confusing: reorder sum using htons()
     instead of ntohs() since it has a little less call overhead.
     The caller must invert bits for Internet sum ! */
  return htons((u16_t)acc);
  80a942:	0f b7 c9             	movzwl %cx,%ecx
  80a945:	89 0c 24             	mov    %ecx,(%esp)
  80a948:	e8 a6 03 00 00       	call   80acf3 <htons>
}
  80a94d:	83 c4 2c             	add    $0x2c,%esp
  80a950:	5b                   	pop    %ebx
  80a951:	5e                   	pop    %esi
  80a952:	5f                   	pop    %edi
  80a953:	5d                   	pop    %ebp
  80a954:	c3                   	ret    

0080a955 <inet_chksum_pbuf>:
 * @param p pbuf chain over that the checksum should be calculated
 * @return checksum (as u16_t) to be saved directly in the protocol header
 */
u16_t
inet_chksum_pbuf(struct pbuf *p)
{
  80a955:	55                   	push   %ebp
  80a956:	89 e5                	mov    %esp,%ebp
  80a958:	57                   	push   %edi
  80a959:	56                   	push   %esi
  80a95a:	53                   	push   %ebx
  80a95b:	83 ec 0c             	sub    $0xc,%esp
  80a95e:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct pbuf *q;
  u8_t swapped;

  acc = 0;
  swapped = 0;
  for(q = p; q != NULL; q = q->next) {
  80a961:	be 00 00 00 00       	mov    $0x0,%esi
  80a966:	85 db                	test   %ebx,%ebx
  80a968:	74 64                	je     80a9ce <inet_chksum_pbuf+0x79>
  80a96a:	bf 00 00 00 00       	mov    $0x0,%edi
    acc += LWIP_CHKSUM(q->payload, q->len);
  80a96f:	0f b7 53 0a          	movzwl 0xa(%ebx),%edx
  80a973:	8b 43 04             	mov    0x4(%ebx),%eax
  80a976:	e8 45 ff ff ff       	call   80a8c0 <lwip_standard_chksum>
  80a97b:	0f b7 c0             	movzwl %ax,%eax
  80a97e:	8d 34 30             	lea    (%eax,%esi,1),%esi
    acc = FOLD_U32T(acc);
  80a981:	89 f0                	mov    %esi,%eax
  80a983:	c1 e8 10             	shr    $0x10,%eax
  80a986:	81 e6 ff ff 00 00    	and    $0xffff,%esi
  80a98c:	01 c6                	add    %eax,%esi
    if (q->len % 2 != 0) {
  80a98e:	f6 43 0a 01          	testb  $0x1,0xa(%ebx)
  80a992:	74 1c                	je     80a9b0 <inet_chksum_pbuf+0x5b>
      swapped = 1 - swapped;
  80a994:	b8 01 00 00 00       	mov    $0x1,%eax
  80a999:	89 fa                	mov    %edi,%edx
  80a99b:	28 d0                	sub    %dl,%al
  80a99d:	89 c7                	mov    %eax,%edi
      acc = SWAP_BYTES_IN_WORD(acc);
  80a99f:	89 f0                	mov    %esi,%eax
  80a9a1:	c1 e0 08             	shl    $0x8,%eax
  80a9a4:	25 ff ff 00 00       	and    $0xffff,%eax
  80a9a9:	89 f2                	mov    %esi,%edx
  80a9ab:	0f b6 f6             	movzbl %dh,%esi
  80a9ae:	09 c6                	or     %eax,%esi
  struct pbuf *q;
  u8_t swapped;

  acc = 0;
  swapped = 0;
  for(q = p; q != NULL; q = q->next) {
  80a9b0:	8b 1b                	mov    (%ebx),%ebx
  80a9b2:	85 db                	test   %ebx,%ebx
  80a9b4:	75 b9                	jne    80a96f <inet_chksum_pbuf+0x1a>
  80a9b6:	89 f0                	mov    %esi,%eax
      swapped = 1 - swapped;
      acc = SWAP_BYTES_IN_WORD(acc);
    }
  }

  if (swapped) {
  80a9b8:	89 fa                	mov    %edi,%edx
  80a9ba:	84 d2                	test   %dl,%dl
  80a9bc:	74 10                	je     80a9ce <inet_chksum_pbuf+0x79>
    acc = SWAP_BYTES_IN_WORD(acc);
  80a9be:	89 f2                	mov    %esi,%edx
  80a9c0:	c1 e2 08             	shl    $0x8,%edx
  80a9c3:	81 e2 ff ff 00 00    	and    $0xffff,%edx
  80a9c9:	0f b6 f4             	movzbl %ah,%esi
  80a9cc:	09 d6                	or     %edx,%esi
  80a9ce:	89 f0                	mov    %esi,%eax
  80a9d0:	f7 d0                	not    %eax
  }
  return (u16_t)~(acc & 0xffffUL);
}
  80a9d2:	83 c4 0c             	add    $0xc,%esp
  80a9d5:	5b                   	pop    %ebx
  80a9d6:	5e                   	pop    %esi
  80a9d7:	5f                   	pop    %edi
  80a9d8:	5d                   	pop    %ebp
  80a9d9:	c3                   	ret    

0080a9da <inet_chksum>:
 * @return checksum (as u16_t) to be saved directly in the protocol header
 */

u16_t
inet_chksum(void *dataptr, u16_t len)
{
  80a9da:	55                   	push   %ebp
  80a9db:	89 e5                	mov    %esp,%ebp
  80a9dd:	83 ec 08             	sub    $0x8,%esp
  return ~LWIP_CHKSUM(dataptr, len);
  80a9e0:	0f b7 55 0c          	movzwl 0xc(%ebp),%edx
  80a9e4:	8b 45 08             	mov    0x8(%ebp),%eax
  80a9e7:	e8 d4 fe ff ff       	call   80a8c0 <lwip_standard_chksum>
  80a9ec:	f7 d0                	not    %eax
}
  80a9ee:	c9                   	leave  
  80a9ef:	c3                   	ret    

0080a9f0 <inet_chksum_pseudo>:
 */
u16_t
inet_chksum_pseudo(struct pbuf *p,
       struct ip_addr *src, struct ip_addr *dest,
       u8_t proto, u16_t proto_len)
{
  80a9f0:	55                   	push   %ebp
  80a9f1:	89 e5                	mov    %esp,%ebp
  80a9f3:	57                   	push   %edi
  80a9f4:	56                   	push   %esi
  80a9f5:	53                   	push   %ebx
  80a9f6:	83 ec 2c             	sub    $0x2c,%esp
  80a9f9:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80a9fc:	0f b6 45 14          	movzbl 0x14(%ebp),%eax
  80aa00:	88 45 e7             	mov    %al,-0x19(%ebp)
  80aa03:	0f b7 55 18          	movzwl 0x18(%ebp),%edx
  80aa07:	66 89 55 e4          	mov    %dx,-0x1c(%ebp)
  u8_t swapped;

  acc = 0;
  swapped = 0;
  /* iterate through all pbuf in chain */
  for(q = p; q != NULL; q = q->next) {
  80aa0b:	be 00 00 00 00       	mov    $0x0,%esi
  80aa10:	85 db                	test   %ebx,%ebx
  80aa12:	74 64                	je     80aa78 <inet_chksum_pseudo+0x88>
  80aa14:	bf 00 00 00 00       	mov    $0x0,%edi
    LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): checksumming pbuf %p (has next %p) \n",
      (void *)q, (void *)q->next));
    acc += LWIP_CHKSUM(q->payload, q->len);
  80aa19:	0f b7 53 0a          	movzwl 0xa(%ebx),%edx
  80aa1d:	8b 43 04             	mov    0x4(%ebx),%eax
  80aa20:	e8 9b fe ff ff       	call   80a8c0 <lwip_standard_chksum>
  80aa25:	0f b7 c0             	movzwl %ax,%eax
  80aa28:	8d 34 30             	lea    (%eax,%esi,1),%esi
    /*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): unwrapped lwip_chksum()=%"X32_F" \n", acc));*/
    /* just executing this next line is probably faster that the if statement needed
       to check whether we really need to execute it, and does no harm */
    acc = FOLD_U32T(acc);
  80aa2b:	89 f0                	mov    %esi,%eax
  80aa2d:	c1 e8 10             	shr    $0x10,%eax
  80aa30:	81 e6 ff ff 00 00    	and    $0xffff,%esi
  80aa36:	01 c6                	add    %eax,%esi
    if (q->len % 2 != 0) {
  80aa38:	f6 43 0a 01          	testb  $0x1,0xa(%ebx)
  80aa3c:	74 1c                	je     80aa5a <inet_chksum_pseudo+0x6a>
      swapped = 1 - swapped;
  80aa3e:	b8 01 00 00 00       	mov    $0x1,%eax
  80aa43:	89 fa                	mov    %edi,%edx
  80aa45:	28 d0                	sub    %dl,%al
  80aa47:	89 c7                	mov    %eax,%edi
      acc = SWAP_BYTES_IN_WORD(acc);
  80aa49:	89 f0                	mov    %esi,%eax
  80aa4b:	c1 e0 08             	shl    $0x8,%eax
  80aa4e:	25 ff ff 00 00       	and    $0xffff,%eax
  80aa53:	89 f2                	mov    %esi,%edx
  80aa55:	0f b6 f6             	movzbl %dh,%esi
  80aa58:	09 c6                	or     %eax,%esi
  u8_t swapped;

  acc = 0;
  swapped = 0;
  /* iterate through all pbuf in chain */
  for(q = p; q != NULL; q = q->next) {
  80aa5a:	8b 1b                	mov    (%ebx),%ebx
  80aa5c:	85 db                	test   %ebx,%ebx
  80aa5e:	75 b9                	jne    80aa19 <inet_chksum_pseudo+0x29>
  80aa60:	89 f0                	mov    %esi,%eax
      acc = SWAP_BYTES_IN_WORD(acc);
    }
    /*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): wrapped lwip_chksum()=%"X32_F" \n", acc));*/
  }

  if (swapped) {
  80aa62:	89 fa                	mov    %edi,%edx
  80aa64:	84 d2                	test   %dl,%dl
  80aa66:	74 10                	je     80aa78 <inet_chksum_pseudo+0x88>
    acc = SWAP_BYTES_IN_WORD(acc);
  80aa68:	89 f2                	mov    %esi,%edx
  80aa6a:	c1 e2 08             	shl    $0x8,%edx
  80aa6d:	81 e2 ff ff 00 00    	and    $0xffff,%edx
  80aa73:	0f b6 f4             	movzbl %ah,%esi
  80aa76:	09 d6                	or     %edx,%esi
  }
  acc += (src->addr & 0xffffUL);
  80aa78:	8b 45 0c             	mov    0xc(%ebp),%eax
  80aa7b:	8b 10                	mov    (%eax),%edx
  acc += ((src->addr >> 16) & 0xffffUL);
  acc += (dest->addr & 0xffffUL);
  80aa7d:	8b 45 10             	mov    0x10(%ebp),%eax
  80aa80:	8b 00                	mov    (%eax),%eax
  }

  if (swapped) {
    acc = SWAP_BYTES_IN_WORD(acc);
  }
  acc += (src->addr & 0xffffUL);
  80aa82:	89 d1                	mov    %edx,%ecx
  80aa84:	c1 e9 10             	shr    $0x10,%ecx
  80aa87:	81 e2 ff ff 00 00    	and    $0xffff,%edx
  80aa8d:	8d 14 11             	lea    (%ecx,%edx,1),%edx
  acc += ((src->addr >> 16) & 0xffffUL);
  80aa90:	0f b7 c8             	movzwl %ax,%ecx
  80aa93:	01 ca                	add    %ecx,%edx
  acc += (dest->addr & 0xffffUL);
  80aa95:	c1 e8 10             	shr    $0x10,%eax
  80aa98:	8d 04 02             	lea    (%edx,%eax,1),%eax
  acc += ((dest->addr >> 16) & 0xffffUL);
  80aa9b:	8d 34 30             	lea    (%eax,%esi,1),%esi
  acc += (u32_t)htons((u16_t)proto);
  80aa9e:	0f b6 45 e7          	movzbl -0x19(%ebp),%eax
  80aaa2:	89 04 24             	mov    %eax,(%esp)
  80aaa5:	e8 49 02 00 00       	call   80acf3 <htons>
  80aaaa:	0f b7 c0             	movzwl %ax,%eax
  80aaad:	01 c6                	add    %eax,%esi
  acc += (u32_t)htons(proto_len);
  80aaaf:	0f b7 45 e4          	movzwl -0x1c(%ebp),%eax
  80aab3:	89 04 24             	mov    %eax,(%esp)
  80aab6:	e8 38 02 00 00       	call   80acf3 <htons>
  80aabb:	0f b7 c0             	movzwl %ax,%eax
  80aabe:	01 c6                	add    %eax,%esi

  /* Fold 32-bit sum to 16 bits
     calling this twice is propably faster than if statements... */
  acc = FOLD_U32T(acc);
  80aac0:	89 f0                	mov    %esi,%eax
  80aac2:	c1 e8 10             	shr    $0x10,%eax
  80aac5:	81 e6 ff ff 00 00    	and    $0xffff,%esi
  80aacb:	01 c6                	add    %eax,%esi
  acc = FOLD_U32T(acc);
  80aacd:	89 f0                	mov    %esi,%eax
  80aacf:	c1 e8 10             	shr    $0x10,%eax
  80aad2:	8d 04 06             	lea    (%esi,%eax,1),%eax
  80aad5:	f7 d0                	not    %eax
  LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): pbuf chain lwip_chksum()=%"X32_F"\n", acc));
  return (u16_t)~(acc & 0xffffUL);
}
  80aad7:	83 c4 2c             	add    $0x2c,%esp
  80aada:	5b                   	pop    %ebx
  80aadb:	5e                   	pop    %esi
  80aadc:	5f                   	pop    %edi
  80aadd:	5d                   	pop    %ebp
  80aade:	c3                   	ret    

0080aadf <inet_chksum_pseudo_partial>:
 */
u16_t
inet_chksum_pseudo_partial(struct pbuf *p,
       struct ip_addr *src, struct ip_addr *dest,
       u8_t proto, u16_t proto_len, u16_t chksum_len)
{
  80aadf:	55                   	push   %ebp
  80aae0:	89 e5                	mov    %esp,%ebp
  80aae2:	57                   	push   %edi
  80aae3:	56                   	push   %esi
  80aae4:	53                   	push   %ebx
  80aae5:	83 ec 3c             	sub    $0x3c,%esp
  80aae8:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80aaeb:	0f b6 45 14          	movzbl 0x14(%ebp),%eax
  80aaef:	88 45 d6             	mov    %al,-0x2a(%ebp)
  80aaf2:	0f b7 55 18          	movzwl 0x18(%ebp),%edx
  80aaf6:	66 89 55 d4          	mov    %dx,-0x2c(%ebp)
  80aafa:	0f b7 75 1c          	movzwl 0x1c(%ebp),%esi
  u16_t chklen;

  acc = 0;
  swapped = 0;
  /* iterate through all pbuf in chain */
  for(q = p; (q != NULL) && (chksum_len > 0); q = q->next) {
  80aafe:	85 db                	test   %ebx,%ebx
  80ab00:	74 05                	je     80ab07 <inet_chksum_pseudo_partial+0x28>
  80ab02:	66 85 f6             	test   %si,%si
  80ab05:	75 0a                	jne    80ab11 <inet_chksum_pseudo_partial+0x32>
  80ab07:	bf 00 00 00 00       	mov    $0x0,%edi
  80ab0c:	e9 a7 00 00 00       	jmp    80abb8 <inet_chksum_pseudo_partial+0xd9>
  80ab11:	c6 45 d7 00          	movb   $0x0,-0x29(%ebp)
  80ab15:	bf 00 00 00 00       	mov    $0x0,%edi
    LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): checksumming pbuf %p (has next %p) \n",
      (void *)q, (void *)q->next));
    chklen = q->len;
  80ab1a:	0f b7 43 0a          	movzwl 0xa(%ebx),%eax
  80ab1e:	66 39 c6             	cmp    %ax,%si
  80ab21:	89 c2                	mov    %eax,%edx
  80ab23:	0f 46 d6             	cmovbe %esi,%edx
  80ab26:	66 89 55 d8          	mov    %dx,-0x28(%ebp)
    if (chklen > chksum_len) {
      chklen = chksum_len;
    }
    acc += LWIP_CHKSUM(q->payload, chklen);
  80ab2a:	0f b7 d2             	movzwl %dx,%edx
  80ab2d:	8b 43 04             	mov    0x4(%ebx),%eax
  80ab30:	e8 8b fd ff ff       	call   80a8c0 <lwip_standard_chksum>
    chksum_len -= chklen;
  80ab35:	66 2b 75 d8          	sub    -0x28(%ebp),%si
    LWIP_ASSERT("delete me", chksum_len < 0x7fff);
  80ab39:	66 81 fe fe 7f       	cmp    $0x7ffe,%si
  80ab3e:	76 1c                	jbe    80ab5c <inet_chksum_pseudo_partial+0x7d>
  80ab40:	c7 44 24 08 15 3e 81 	movl   $0x813e15,0x8(%esp)
  80ab47:	00 
  80ab48:	c7 44 24 04 60 01 00 	movl   $0x160,0x4(%esp)
  80ab4f:	00 
  80ab50:	c7 04 24 20 3e 81 00 	movl   $0x813e20,(%esp)
  80ab57:	e8 40 5e ff ff       	call   80099c <_panic>
      (void *)q, (void *)q->next));
    chklen = q->len;
    if (chklen > chksum_len) {
      chklen = chksum_len;
    }
    acc += LWIP_CHKSUM(q->payload, chklen);
  80ab5c:	0f b7 c0             	movzwl %ax,%eax
  80ab5f:	8d 3c 38             	lea    (%eax,%edi,1),%edi
    chksum_len -= chklen;
    LWIP_ASSERT("delete me", chksum_len < 0x7fff);
    /*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): unwrapped lwip_chksum()=%"X32_F" \n", acc));*/
    /* fold the upper bit down */
    acc = FOLD_U32T(acc);
  80ab62:	89 fa                	mov    %edi,%edx
  80ab64:	c1 ea 10             	shr    $0x10,%edx
  80ab67:	81 e7 ff ff 00 00    	and    $0xffff,%edi
  80ab6d:	01 d7                	add    %edx,%edi
    if (q->len % 2 != 0) {
  80ab6f:	f6 43 0a 01          	testb  $0x1,0xa(%ebx)
  80ab73:	74 1c                	je     80ab91 <inet_chksum_pseudo_partial+0xb2>
      swapped = 1 - swapped;
  80ab75:	b8 01 00 00 00       	mov    $0x1,%eax
  80ab7a:	2a 45 d7             	sub    -0x29(%ebp),%al
  80ab7d:	88 45 d7             	mov    %al,-0x29(%ebp)
      acc = SWAP_BYTES_IN_WORD(acc);
  80ab80:	89 f8                	mov    %edi,%eax
  80ab82:	c1 e0 08             	shl    $0x8,%eax
  80ab85:	25 ff ff 00 00       	and    $0xffff,%eax
  80ab8a:	89 fa                	mov    %edi,%edx
  80ab8c:	0f b6 fe             	movzbl %dh,%edi
  80ab8f:	09 c7                	or     %eax,%edi
  u16_t chklen;

  acc = 0;
  swapped = 0;
  /* iterate through all pbuf in chain */
  for(q = p; (q != NULL) && (chksum_len > 0); q = q->next) {
  80ab91:	8b 1b                	mov    (%ebx),%ebx
  80ab93:	85 db                	test   %ebx,%ebx
  80ab95:	74 09                	je     80aba0 <inet_chksum_pseudo_partial+0xc1>
  80ab97:	66 85 f6             	test   %si,%si
  80ab9a:	0f 85 7a ff ff ff    	jne    80ab1a <inet_chksum_pseudo_partial+0x3b>
  80aba0:	89 f8                	mov    %edi,%eax
      acc = SWAP_BYTES_IN_WORD(acc);
    }
    /*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): wrapped lwip_chksum()=%"X32_F" \n", acc));*/
  }

  if (swapped) {
  80aba2:	80 7d d7 00          	cmpb   $0x0,-0x29(%ebp)
  80aba6:	74 10                	je     80abb8 <inet_chksum_pseudo_partial+0xd9>
    acc = SWAP_BYTES_IN_WORD(acc);
  80aba8:	89 fa                	mov    %edi,%edx
  80abaa:	c1 e2 08             	shl    $0x8,%edx
  80abad:	81 e2 ff ff 00 00    	and    $0xffff,%edx
  80abb3:	0f b6 fc             	movzbl %ah,%edi
  80abb6:	09 d7                	or     %edx,%edi
  }
  acc += (src->addr & 0xffffUL);
  80abb8:	8b 45 0c             	mov    0xc(%ebp),%eax
  80abbb:	8b 10                	mov    (%eax),%edx
  acc += ((src->addr >> 16) & 0xffffUL);
  acc += (dest->addr & 0xffffUL);
  80abbd:	8b 45 10             	mov    0x10(%ebp),%eax
  80abc0:	8b 00                	mov    (%eax),%eax
  }

  if (swapped) {
    acc = SWAP_BYTES_IN_WORD(acc);
  }
  acc += (src->addr & 0xffffUL);
  80abc2:	89 d1                	mov    %edx,%ecx
  80abc4:	c1 e9 10             	shr    $0x10,%ecx
  80abc7:	81 e2 ff ff 00 00    	and    $0xffff,%edx
  80abcd:	8d 14 11             	lea    (%ecx,%edx,1),%edx
  acc += ((src->addr >> 16) & 0xffffUL);
  80abd0:	0f b7 c8             	movzwl %ax,%ecx
  80abd3:	01 ca                	add    %ecx,%edx
  acc += (dest->addr & 0xffffUL);
  80abd5:	c1 e8 10             	shr    $0x10,%eax
  80abd8:	8d 04 02             	lea    (%edx,%eax,1),%eax
  acc += ((dest->addr >> 16) & 0xffffUL);
  80abdb:	8d 3c 38             	lea    (%eax,%edi,1),%edi
  acc += (u32_t)htons((u16_t)proto);
  80abde:	0f b6 45 d6          	movzbl -0x2a(%ebp),%eax
  80abe2:	89 04 24             	mov    %eax,(%esp)
  80abe5:	e8 09 01 00 00       	call   80acf3 <htons>
  80abea:	0f b7 c0             	movzwl %ax,%eax
  80abed:	01 c7                	add    %eax,%edi
  acc += (u32_t)htons(proto_len);
  80abef:	0f b7 45 d4          	movzwl -0x2c(%ebp),%eax
  80abf3:	89 04 24             	mov    %eax,(%esp)
  80abf6:	e8 f8 00 00 00       	call   80acf3 <htons>
  80abfb:	0f b7 c0             	movzwl %ax,%eax
  80abfe:	01 c7                	add    %eax,%edi

  /* Fold 32-bit sum to 16 bits
     calling this twice is propably faster than if statements... */
  acc = FOLD_U32T(acc);
  80ac00:	89 f8                	mov    %edi,%eax
  80ac02:	c1 e8 10             	shr    $0x10,%eax
  80ac05:	81 e7 ff ff 00 00    	and    $0xffff,%edi
  80ac0b:	8d 04 07             	lea    (%edi,%eax,1),%eax
  acc = FOLD_U32T(acc);
  80ac0e:	89 c2                	mov    %eax,%edx
  80ac10:	c1 ea 10             	shr    $0x10,%edx
  80ac13:	01 d0                	add    %edx,%eax
  80ac15:	f7 d0                	not    %eax
  LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): pbuf chain lwip_chksum()=%"X32_F"\n", acc));
  return (u16_t)~(acc & 0xffffUL);
}
  80ac17:	83 c4 3c             	add    $0x3c,%esp
  80ac1a:	5b                   	pop    %ebx
  80ac1b:	5e                   	pop    %esi
  80ac1c:	5f                   	pop    %edi
  80ac1d:	5d                   	pop    %ebp
  80ac1e:	c3                   	ret    
	...

0080ac20 <inet_ntoa>:
 * @return pointer to a global static (!) buffer that holds the ASCII
 *         represenation of addr
 */
char *
inet_ntoa(struct in_addr addr)
{
  80ac20:	55                   	push   %ebp
  80ac21:	89 e5                	mov    %esp,%ebp
  80ac23:	57                   	push   %edi
  80ac24:	56                   	push   %esi
  80ac25:	53                   	push   %ebx
  80ac26:	83 ec 20             	sub    $0x20,%esp
  static char str[16];
  u32_t s_addr = addr.s_addr;
  80ac29:	8b 45 08             	mov    0x8(%ebp),%eax
  80ac2c:	89 45 f0             	mov    %eax,-0x10(%ebp)
  u8_t rem;
  u8_t n;
  u8_t i;

  rp = str;
  ap = (u8_t *)&s_addr;
  80ac2f:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80ac32:	89 45 e0             	mov    %eax,-0x20(%ebp)
 * @param addr ip address in network order to convert
 * @return pointer to a global static (!) buffer that holds the ASCII
 *         represenation of addr
 */
char *
inet_ntoa(struct in_addr addr)
  80ac35:	8d 55 f3             	lea    -0xd(%ebp),%edx
  80ac38:	89 55 d8             	mov    %edx,-0x28(%ebp)
  80ac3b:	bb bc 8d b3 00       	mov    $0xb38dbc,%ebx
  rp = str;
  ap = (u8_t *)&s_addr;
  for(n = 0; n < 4; n++) {
    i = 0;
    do {
      rem = *ap % (u8_t)10;
  80ac40:	b9 cd ff ff ff       	mov    $0xffffffcd,%ecx
 * @param addr ip address in network order to convert
 * @return pointer to a global static (!) buffer that holds the ASCII
 *         represenation of addr
 */
char *
inet_ntoa(struct in_addr addr)
  80ac45:	8b 7d e0             	mov    -0x20(%ebp),%edi
  80ac48:	0f b6 37             	movzbl (%edi),%esi
  80ac4b:	ba 00 00 00 00       	mov    $0x0,%edx
  80ac50:	89 d0                	mov    %edx,%eax
  80ac52:	89 f2                	mov    %esi,%edx
  80ac54:	89 de                	mov    %ebx,%esi
  80ac56:	89 c3                	mov    %eax,%ebx
  rp = str;
  ap = (u8_t *)&s_addr;
  for(n = 0; n < 4; n++) {
    i = 0;
    do {
      rem = *ap % (u8_t)10;
  80ac58:	89 d0                	mov    %edx,%eax
  80ac5a:	f6 e1                	mul    %cl
  80ac5c:	66 c1 e8 08          	shr    $0x8,%ax
  80ac60:	c0 e8 03             	shr    $0x3,%al
  80ac63:	89 c7                	mov    %eax,%edi
  80ac65:	8d 04 80             	lea    (%eax,%eax,4),%eax
  80ac68:	01 c0                	add    %eax,%eax
  80ac6a:	28 c2                	sub    %al,%dl
  80ac6c:	89 d0                	mov    %edx,%eax
      *ap /= (u8_t)10;
  80ac6e:	89 fa                	mov    %edi,%edx
      inv[i++] = '0' + rem;
  80ac70:	0f b6 fb             	movzbl %bl,%edi
  80ac73:	83 c0 30             	add    $0x30,%eax
  80ac76:	88 44 3d ed          	mov    %al,-0x13(%ebp,%edi,1)
  80ac7a:	8d 43 01             	lea    0x1(%ebx),%eax
    } while(*ap);
  80ac7d:	84 d2                	test   %dl,%dl
  80ac7f:	74 04                	je     80ac85 <inet_ntoa+0x65>
  80ac81:	89 c3                	mov    %eax,%ebx
  80ac83:	eb d3                	jmp    80ac58 <inet_ntoa+0x38>
  80ac85:	88 45 d7             	mov    %al,-0x29(%ebp)
  80ac88:	89 df                	mov    %ebx,%edi
  80ac8a:	89 f3                	mov    %esi,%ebx
  80ac8c:	89 d6                	mov    %edx,%esi
  80ac8e:	89 fa                	mov    %edi,%edx
  80ac90:	88 55 dc             	mov    %dl,-0x24(%ebp)
  80ac93:	89 f0                	mov    %esi,%eax
  80ac95:	8b 7d e0             	mov    -0x20(%ebp),%edi
  80ac98:	88 07                	mov    %al,(%edi)
    while(i--)
  80ac9a:	80 7d d7 00          	cmpb   $0x0,-0x29(%ebp)
  80ac9e:	74 2a                	je     80acca <inet_ntoa+0xaa>
 * @param addr ip address in network order to convert
 * @return pointer to a global static (!) buffer that holds the ASCII
 *         represenation of addr
 */
char *
inet_ntoa(struct in_addr addr)
  80aca0:	0f b6 45 dc          	movzbl -0x24(%ebp),%eax
  80aca4:	89 45 dc             	mov    %eax,-0x24(%ebp)
  80aca7:	8d 7c 03 01          	lea    0x1(%ebx,%eax,1),%edi
  80acab:	89 d8                	mov    %ebx,%eax
  80acad:	89 de                	mov    %ebx,%esi
      rem = *ap % (u8_t)10;
      *ap /= (u8_t)10;
      inv[i++] = '0' + rem;
    } while(*ap);
    while(i--)
      *rp++ = inv[i];
  80acaf:	0f b6 da             	movzbl %dl,%ebx
  80acb2:	0f b6 5c 1d ed       	movzbl -0x13(%ebp,%ebx,1),%ebx
  80acb7:	88 18                	mov    %bl,(%eax)
  80acb9:	83 c0 01             	add    $0x1,%eax
    do {
      rem = *ap % (u8_t)10;
      *ap /= (u8_t)10;
      inv[i++] = '0' + rem;
    } while(*ap);
    while(i--)
  80acbc:	83 ea 01             	sub    $0x1,%edx
  80acbf:	39 f8                	cmp    %edi,%eax
  80acc1:	75 ec                	jne    80acaf <inet_ntoa+0x8f>
  80acc3:	8b 55 dc             	mov    -0x24(%ebp),%edx
  80acc6:	8d 5c 16 01          	lea    0x1(%esi,%edx,1),%ebx
      *rp++ = inv[i];
    *rp++ = '.';
  80acca:	c6 03 2e             	movb   $0x2e,(%ebx)
  80accd:	8d 43 01             	lea    0x1(%ebx),%eax
  u8_t n;
  u8_t i;

  rp = str;
  ap = (u8_t *)&s_addr;
  for(n = 0; n < 4; n++) {
  80acd0:	8b 7d d8             	mov    -0x28(%ebp),%edi
  80acd3:	39 7d e0             	cmp    %edi,-0x20(%ebp)
  80acd6:	74 0b                	je     80ace3 <inet_ntoa+0xc3>
      inv[i++] = '0' + rem;
    } while(*ap);
    while(i--)
      *rp++ = inv[i];
    *rp++ = '.';
    ap++;
  80acd8:	83 45 e0 01          	addl   $0x1,-0x20(%ebp)
  80acdc:	89 c3                	mov    %eax,%ebx
  80acde:	e9 62 ff ff ff       	jmp    80ac45 <inet_ntoa+0x25>
  }
  *--rp = 0;
  80ace3:	c6 03 00             	movb   $0x0,(%ebx)
  return str;
}
  80ace6:	b8 bc 8d b3 00       	mov    $0xb38dbc,%eax
  80aceb:	83 c4 20             	add    $0x20,%esp
  80acee:	5b                   	pop    %ebx
  80acef:	5e                   	pop    %esi
  80acf0:	5f                   	pop    %edi
  80acf1:	5d                   	pop    %ebp
  80acf2:	c3                   	ret    

0080acf3 <htons>:
 * @param n u16_t in host byte order
 * @return n in network byte order
 */
u16_t
htons(u16_t n)
{
  80acf3:	55                   	push   %ebp
  80acf4:	89 e5                	mov    %esp,%ebp
  80acf6:	0f b7 45 08          	movzwl 0x8(%ebp),%eax
  80acfa:	66 c1 c0 08          	rol    $0x8,%ax
  return ((n & 0xff) << 8) | ((n & 0xff00) >> 8);
}
  80acfe:	5d                   	pop    %ebp
  80acff:	c3                   	ret    

0080ad00 <ntohs>:
 * @param n u16_t in network byte order
 * @return n in host byte order
 */
u16_t
ntohs(u16_t n)
{
  80ad00:	55                   	push   %ebp
  80ad01:	89 e5                	mov    %esp,%ebp
  80ad03:	83 ec 04             	sub    $0x4,%esp
  return htons(n);
  80ad06:	0f b7 45 08          	movzwl 0x8(%ebp),%eax
  80ad0a:	89 04 24             	mov    %eax,(%esp)
  80ad0d:	e8 e1 ff ff ff       	call   80acf3 <htons>
}
  80ad12:	c9                   	leave  
  80ad13:	c3                   	ret    

0080ad14 <htonl>:
 * @param n u32_t in host byte order
 * @return n in network byte order
 */
u32_t
htonl(u32_t n)
{
  80ad14:	55                   	push   %ebp
  80ad15:	89 e5                	mov    %esp,%ebp
  80ad17:	8b 55 08             	mov    0x8(%ebp),%edx
  80ad1a:	89 d1                	mov    %edx,%ecx
  80ad1c:	c1 e9 18             	shr    $0x18,%ecx
  80ad1f:	89 d0                	mov    %edx,%eax
  80ad21:	c1 e0 18             	shl    $0x18,%eax
  80ad24:	09 c8                	or     %ecx,%eax
  80ad26:	89 d1                	mov    %edx,%ecx
  80ad28:	81 e1 00 ff 00 00    	and    $0xff00,%ecx
  80ad2e:	c1 e1 08             	shl    $0x8,%ecx
  80ad31:	09 c8                	or     %ecx,%eax
  80ad33:	81 e2 00 00 ff 00    	and    $0xff0000,%edx
  80ad39:	c1 ea 08             	shr    $0x8,%edx
  80ad3c:	09 d0                	or     %edx,%eax
  return ((n & 0xff) << 24) |
    ((n & 0xff00) << 8) |
    ((n & 0xff0000UL) >> 8) |
    ((n & 0xff000000UL) >> 24);
}
  80ad3e:	5d                   	pop    %ebp
  80ad3f:	c3                   	ret    

0080ad40 <inet_aton>:
 * @param addr pointer to which to save the ip address in network order
 * @return 1 if cp could be converted to addr, 0 on failure
 */
int
inet_aton(const char *cp, struct in_addr *addr)
{
  80ad40:	55                   	push   %ebp
  80ad41:	89 e5                	mov    %esp,%ebp
  80ad43:	57                   	push   %edi
  80ad44:	56                   	push   %esi
  80ad45:	53                   	push   %ebx
  80ad46:	83 ec 28             	sub    $0x28,%esp
  80ad49:	8b 45 08             	mov    0x8(%ebp),%eax
  u32_t val;
  int base, n, c;
  u32_t parts[4];
  u32_t *pp = parts;

  c = *cp;
  80ad4c:	0f be 10             	movsbl (%eax),%edx
    /*
     * Collect number up to ``.''.
     * Values are specified as for C:
     * 0x=hex, 0=octal, 1-9=decimal.
     */
    if (!isdigit(c))
  80ad4f:	8d 4a d0             	lea    -0x30(%edx),%ecx
  80ad52:	80 f9 09             	cmp    $0x9,%cl
  80ad55:	0f 87 a8 01 00 00    	ja     80af03 <inet_aton+0x1c3>
  80ad5b:	8d 4d e4             	lea    -0x1c(%ebp),%ecx
  80ad5e:	89 4d d8             	mov    %ecx,-0x28(%ebp)
       * Internet format:
       *  a.b.c.d
       *  a.b.c   (with c treated as 16 bits)
       *  a.b (with b treated as 24 bits)
       */
      if (pp >= parts + 3)
  80ad61:	8d 5d f0             	lea    -0x10(%ebp),%ebx
  80ad64:	89 5d d4             	mov    %ebx,-0x2c(%ebp)
     */
    if (!isdigit(c))
      return (0);
    val = 0;
    base = 10;
    if (c == '0') {
  80ad67:	c7 45 e0 0a 00 00 00 	movl   $0xa,-0x20(%ebp)
  80ad6e:	83 fa 30             	cmp    $0x30,%edx
  80ad71:	75 24                	jne    80ad97 <inet_aton+0x57>
      c = *++cp;
  80ad73:	83 c0 01             	add    $0x1,%eax
  80ad76:	0f be 10             	movsbl (%eax),%edx
      if (c == 'x' || c == 'X') {
  80ad79:	83 fa 78             	cmp    $0x78,%edx
  80ad7c:	74 0c                	je     80ad8a <inet_aton+0x4a>
  80ad7e:	c7 45 e0 08 00 00 00 	movl   $0x8,-0x20(%ebp)
  80ad85:	83 fa 58             	cmp    $0x58,%edx
  80ad88:	75 0d                	jne    80ad97 <inet_aton+0x57>
        base = 16;
        c = *++cp;
  80ad8a:	83 c0 01             	add    $0x1,%eax
  80ad8d:	0f be 10             	movsbl (%eax),%edx
  80ad90:	c7 45 e0 10 00 00 00 	movl   $0x10,-0x20(%ebp)
  80ad97:	83 c0 01             	add    $0x1,%eax
  80ad9a:	be 00 00 00 00       	mov    $0x0,%esi
  80ad9f:	eb 03                	jmp    80ada4 <inet_aton+0x64>
  80ada1:	83 c0 01             	add    $0x1,%eax
  80ada4:	8d 78 ff             	lea    -0x1(%eax),%edi
      } else
        base = 8;
    }
    for (;;) {
      if (isdigit(c)) {
  80ada7:	89 d1                	mov    %edx,%ecx
  80ada9:	8d 59 d0             	lea    -0x30(%ecx),%ebx
  80adac:	80 fb 09             	cmp    $0x9,%bl
  80adaf:	77 0d                	ja     80adbe <inet_aton+0x7e>
        val = (val * base) + (int)(c - '0');
  80adb1:	0f af 75 e0          	imul   -0x20(%ebp),%esi
  80adb5:	8d 74 32 d0          	lea    -0x30(%edx,%esi,1),%esi
        c = *++cp;
  80adb9:	0f be 10             	movsbl (%eax),%edx
  80adbc:	eb e3                	jmp    80ada1 <inet_aton+0x61>
      } else if (base == 16 && isxdigit(c)) {
  80adbe:	83 7d e0 10          	cmpl   $0x10,-0x20(%ebp)
  80adc2:	75 2b                	jne    80adef <inet_aton+0xaf>
  80adc4:	8d 59 9f             	lea    -0x61(%ecx),%ebx
  80adc7:	88 5d d3             	mov    %bl,-0x2d(%ebp)
  80adca:	80 fb 05             	cmp    $0x5,%bl
  80adcd:	76 08                	jbe    80add7 <inet_aton+0x97>
  80adcf:	8d 59 bf             	lea    -0x41(%ecx),%ebx
  80add2:	80 fb 05             	cmp    $0x5,%bl
  80add5:	77 18                	ja     80adef <inet_aton+0xaf>
        val = (val << 4) | (int)(c + 10 - (islower(c) ? 'a' : 'A'));
  80add7:	80 7d d3 1a          	cmpb   $0x1a,-0x2d(%ebp)
  80addb:	19 c9                	sbb    %ecx,%ecx
  80addd:	83 e1 20             	and    $0x20,%ecx
  80ade0:	c1 e6 04             	shl    $0x4,%esi
  80ade3:	29 ca                	sub    %ecx,%edx
  80ade5:	8d 52 c9             	lea    -0x37(%edx),%edx
  80ade8:	09 d6                	or     %edx,%esi
        c = *++cp;
  80adea:	0f be 10             	movsbl (%eax),%edx
  80aded:	eb b2                	jmp    80ada1 <inet_aton+0x61>
      } else
        break;
    }
    if (c == '.') {
  80adef:	83 fa 2e             	cmp    $0x2e,%edx
  80adf2:	75 29                	jne    80ae1d <inet_aton+0xdd>
       * Internet format:
       *  a.b.c.d
       *  a.b.c   (with c treated as 16 bits)
       *  a.b (with b treated as 24 bits)
       */
      if (pp >= parts + 3)
  80adf4:	8b 55 d8             	mov    -0x28(%ebp),%edx
  80adf7:	39 55 d4             	cmp    %edx,-0x2c(%ebp)
  80adfa:	0f 86 03 01 00 00    	jbe    80af03 <inet_aton+0x1c3>
        return (0);
      *pp++ = val;
  80ae00:	89 32                	mov    %esi,(%edx)
      c = *++cp;
  80ae02:	8d 47 01             	lea    0x1(%edi),%eax
  80ae05:	0f be 10             	movsbl (%eax),%edx
    /*
     * Collect number up to ``.''.
     * Values are specified as for C:
     * 0x=hex, 0=octal, 1-9=decimal.
     */
    if (!isdigit(c))
  80ae08:	8d 4a d0             	lea    -0x30(%edx),%ecx
  80ae0b:	80 f9 09             	cmp    $0x9,%cl
  80ae0e:	0f 87 ef 00 00 00    	ja     80af03 <inet_aton+0x1c3>
       *  a.b.c   (with c treated as 16 bits)
       *  a.b (with b treated as 24 bits)
       */
      if (pp >= parts + 3)
        return (0);
      *pp++ = val;
  80ae14:	83 45 d8 04          	addl   $0x4,-0x28(%ebp)
  80ae18:	e9 4a ff ff ff       	jmp    80ad67 <inet_aton+0x27>
  80ae1d:	89 f3                	mov    %esi,%ebx
  80ae1f:	89 f0                	mov    %esi,%eax
      break;
  }
  /*
   * Check for trailing characters.
   */
  if (c != '\0' && (!isprint(c) || !isspace(c)))
  80ae21:	85 d2                	test   %edx,%edx
  80ae23:	74 36                	je     80ae5b <inet_aton+0x11b>
  80ae25:	80 f9 1f             	cmp    $0x1f,%cl
  80ae28:	0f 86 d5 00 00 00    	jbe    80af03 <inet_aton+0x1c3>
  80ae2e:	84 d2                	test   %dl,%dl
  80ae30:	0f 88 cd 00 00 00    	js     80af03 <inet_aton+0x1c3>
  80ae36:	83 fa 20             	cmp    $0x20,%edx
  80ae39:	74 20                	je     80ae5b <inet_aton+0x11b>
  80ae3b:	83 fa 0c             	cmp    $0xc,%edx
  80ae3e:	66 90                	xchg   %ax,%ax
  80ae40:	74 19                	je     80ae5b <inet_aton+0x11b>
  80ae42:	83 fa 0a             	cmp    $0xa,%edx
  80ae45:	74 14                	je     80ae5b <inet_aton+0x11b>
  80ae47:	83 fa 0d             	cmp    $0xd,%edx
  80ae4a:	74 0f                	je     80ae5b <inet_aton+0x11b>
  80ae4c:	83 fa 09             	cmp    $0x9,%edx
  80ae4f:	90                   	nop
  80ae50:	74 09                	je     80ae5b <inet_aton+0x11b>
  80ae52:	83 fa 0b             	cmp    $0xb,%edx
  80ae55:	0f 85 a8 00 00 00    	jne    80af03 <inet_aton+0x1c3>
  /*
   * Concoct the address according to
   * the number of parts specified.
   */
  n = pp - parts + 1;
  switch (n) {
  80ae5b:	8d 55 e4             	lea    -0x1c(%ebp),%edx
  80ae5e:	8b 4d d8             	mov    -0x28(%ebp),%ecx
  80ae61:	29 d1                	sub    %edx,%ecx
  80ae63:	89 ca                	mov    %ecx,%edx
  80ae65:	c1 fa 02             	sar    $0x2,%edx
  80ae68:	83 c2 01             	add    $0x1,%edx
  80ae6b:	83 fa 02             	cmp    $0x2,%edx
  80ae6e:	74 2a                	je     80ae9a <inet_aton+0x15a>
  80ae70:	83 fa 02             	cmp    $0x2,%edx
  80ae73:	7f 0d                	jg     80ae82 <inet_aton+0x142>
  80ae75:	85 d2                	test   %edx,%edx
  80ae77:	0f 84 86 00 00 00    	je     80af03 <inet_aton+0x1c3>
  80ae7d:	8d 76 00             	lea    0x0(%esi),%esi
  80ae80:	eb 62                	jmp    80aee4 <inet_aton+0x1a4>
  80ae82:	83 fa 03             	cmp    $0x3,%edx
  80ae85:	8d 76 00             	lea    0x0(%esi),%esi
  80ae88:	74 22                	je     80aeac <inet_aton+0x16c>
  80ae8a:	83 fa 04             	cmp    $0x4,%edx
  80ae8d:	8d 76 00             	lea    0x0(%esi),%esi
  80ae90:	75 52                	jne    80aee4 <inet_aton+0x1a4>
  80ae92:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  80ae98:	eb 2b                	jmp    80aec5 <inet_aton+0x185>

  case 1:             /* a -- 32 bits */
    break;

  case 2:             /* a.b -- 8.24 bits */
    if (val > 0xffffffUL)
  80ae9a:	3d ff ff ff 00       	cmp    $0xffffff,%eax
  80ae9f:	90                   	nop
  80aea0:	77 61                	ja     80af03 <inet_aton+0x1c3>
      return (0);
    val |= parts[0] << 24;
  80aea2:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
  80aea5:	c1 e3 18             	shl    $0x18,%ebx
  80aea8:	09 c3                	or     %eax,%ebx
    break;
  80aeaa:	eb 38                	jmp    80aee4 <inet_aton+0x1a4>

  case 3:             /* a.b.c -- 8.8.16 bits */
    if (val > 0xffff)
  80aeac:	3d ff ff 00 00       	cmp    $0xffff,%eax
  80aeb1:	77 50                	ja     80af03 <inet_aton+0x1c3>
      return (0);
    val |= (parts[0] << 24) | (parts[1] << 16);
  80aeb3:	8b 5d e8             	mov    -0x18(%ebp),%ebx
  80aeb6:	c1 e3 10             	shl    $0x10,%ebx
  80aeb9:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80aebc:	c1 e2 18             	shl    $0x18,%edx
  80aebf:	09 d3                	or     %edx,%ebx
  80aec1:	09 c3                	or     %eax,%ebx
    break;
  80aec3:	eb 1f                	jmp    80aee4 <inet_aton+0x1a4>

  case 4:             /* a.b.c.d -- 8.8.8.8 bits */
    if (val > 0xff)
  80aec5:	3d ff 00 00 00       	cmp    $0xff,%eax
  80aeca:	77 37                	ja     80af03 <inet_aton+0x1c3>
      return (0);
    val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
  80aecc:	8b 5d e8             	mov    -0x18(%ebp),%ebx
  80aecf:	c1 e3 10             	shl    $0x10,%ebx
  80aed2:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80aed5:	c1 e2 18             	shl    $0x18,%edx
  80aed8:	09 d3                	or     %edx,%ebx
  80aeda:	8b 55 ec             	mov    -0x14(%ebp),%edx
  80aedd:	c1 e2 08             	shl    $0x8,%edx
  80aee0:	09 d3                	or     %edx,%ebx
  80aee2:	09 c3                	or     %eax,%ebx
    break;
  }
  if (addr)
  80aee4:	b8 01 00 00 00       	mov    $0x1,%eax
  80aee9:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  80aeed:	74 19                	je     80af08 <inet_aton+0x1c8>
    addr->s_addr = htonl(val);
  80aeef:	89 1c 24             	mov    %ebx,(%esp)
  80aef2:	e8 1d fe ff ff       	call   80ad14 <htonl>
  80aef7:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  80aefa:	89 03                	mov    %eax,(%ebx)
  80aefc:	b8 01 00 00 00       	mov    $0x1,%eax
  80af01:	eb 05                	jmp    80af08 <inet_aton+0x1c8>
  80af03:	b8 00 00 00 00       	mov    $0x0,%eax
  return (1);
}
  80af08:	83 c4 28             	add    $0x28,%esp
  80af0b:	5b                   	pop    %ebx
  80af0c:	5e                   	pop    %esi
  80af0d:	5f                   	pop    %edi
  80af0e:	5d                   	pop    %ebp
  80af0f:	c3                   	ret    

0080af10 <inet_addr>:
 * @param cp IP address in ascii represenation (e.g. "127.0.0.1")
 * @return ip address in network order
 */
u32_t
inet_addr(const char *cp)
{
  80af10:	55                   	push   %ebp
  80af11:	89 e5                	mov    %esp,%ebp
  80af13:	83 ec 18             	sub    $0x18,%esp
  struct in_addr val;

  if (inet_aton(cp, &val)) {
  80af16:	8d 45 fc             	lea    -0x4(%ebp),%eax
  80af19:	89 44 24 04          	mov    %eax,0x4(%esp)
  80af1d:	8b 45 08             	mov    0x8(%ebp),%eax
  80af20:	89 04 24             	mov    %eax,(%esp)
  80af23:	e8 18 fe ff ff       	call   80ad40 <inet_aton>
  80af28:	85 c0                	test   %eax,%eax
  80af2a:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  80af2f:	0f 45 45 fc          	cmovne -0x4(%ebp),%eax
    return (val.s_addr);
  }
  return (INADDR_NONE);
}
  80af33:	c9                   	leave  
  80af34:	c3                   	ret    

0080af35 <ntohl>:
 * @param n u32_t in network byte order
 * @return n in host byte order
 */
u32_t
ntohl(u32_t n)
{
  80af35:	55                   	push   %ebp
  80af36:	89 e5                	mov    %esp,%ebp
  80af38:	83 ec 04             	sub    $0x4,%esp
  return htonl(n);
  80af3b:	8b 45 08             	mov    0x8(%ebp),%eax
  80af3e:	89 04 24             	mov    %eax,(%esp)
  80af41:	e8 ce fd ff ff       	call   80ad14 <htonl>
}
  80af46:	c9                   	leave  
  80af47:	c3                   	ret    
	...

0080af50 <tcp_zero_window_probe>:
 *
 * @param pcb the tcp_pcb for which to send a zero-window probe packet
 */
void
tcp_zero_window_probe(struct tcp_pcb *pcb)
{
  80af50:	55                   	push   %ebp
  80af51:	89 e5                	mov    %esp,%ebp
  80af53:	57                   	push   %edi
  80af54:	56                   	push   %esi
  80af55:	53                   	push   %ebx
  80af56:	83 ec 3c             	sub    $0x3c,%esp
  80af59:	8b 75 08             	mov    0x8(%ebp),%esi
  LWIP_DEBUGF(TCP_DEBUG, 
              ("tcp_zero_window_probe: tcp_ticks %"U32_F
               "   pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n", 
               tcp_ticks, pcb->tmr, pcb->keep_cnt_sent));

  seg = pcb->unacked;
  80af5c:	8b 46 78             	mov    0x78(%esi),%eax
  80af5f:	89 45 e4             	mov    %eax,-0x1c(%ebp)

  if(seg == NULL)
  80af62:	85 c0                	test   %eax,%eax
  80af64:	75 0e                	jne    80af74 <tcp_zero_window_probe+0x24>
    seg = pcb->unsent;
  80af66:	8b 56 74             	mov    0x74(%esi),%edx
  80af69:	89 55 e4             	mov    %edx,-0x1c(%ebp)

  if(seg == NULL)
  80af6c:	85 d2                	test   %edx,%edx
  80af6e:	0f 84 4b 01 00 00    	je     80b0bf <tcp_zero_window_probe+0x16f>
    return;

  p = pbuf_alloc(PBUF_IP, TCP_HLEN + 1, PBUF_RAM);
  80af74:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80af7b:	00 
  80af7c:	c7 44 24 04 15 00 00 	movl   $0x15,0x4(%esp)
  80af83:	00 
  80af84:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  80af8b:	e8 29 d2 ff ff       	call   8081b9 <pbuf_alloc>
  80af90:	89 c7                	mov    %eax,%edi
   
  if(p == NULL) {
  80af92:	85 c0                	test   %eax,%eax
  80af94:	0f 84 25 01 00 00    	je     80b0bf <tcp_zero_window_probe+0x16f>
    LWIP_DEBUGF(TCP_DEBUG, ("tcp_zero_window_probe: no memory for pbuf\n"));
    return;
  }
  LWIP_ASSERT("check that first pbuf can hold struct tcp_hdr",
  80af9a:	66 83 78 0a 13       	cmpw   $0x13,0xa(%eax)
  80af9f:	77 1c                	ja     80afbd <tcp_zero_window_probe+0x6d>
  80afa1:	c7 44 24 08 44 3e 81 	movl   $0x813e44,0x8(%esp)
  80afa8:	00 
  80afa9:	c7 44 24 04 8d 03 00 	movl   $0x38d,0x4(%esp)
  80afb0:	00 
  80afb1:	c7 04 24 e8 3f 81 00 	movl   $0x813fe8,(%esp)
  80afb8:	e8 df 59 ff ff       	call   80099c <_panic>
              (p->len >= sizeof(struct tcp_hdr)));

  tcphdr = p->payload;
  80afbd:	8b 58 04             	mov    0x4(%eax),%ebx
  tcphdr->src = htons(pcb->local_port);
  80afc0:	0f b7 46 1c          	movzwl 0x1c(%esi),%eax
  80afc4:	89 04 24             	mov    %eax,(%esp)
  80afc7:	e8 27 fd ff ff       	call   80acf3 <htons>
  80afcc:	66 89 03             	mov    %ax,(%ebx)
  tcphdr->dest = htons(pcb->remote_port);
  80afcf:	0f b7 46 1e          	movzwl 0x1e(%esi),%eax
  80afd3:	89 04 24             	mov    %eax,(%esp)
  80afd6:	e8 18 fd ff ff       	call   80acf3 <htons>
  80afdb:	66 89 43 02          	mov    %ax,0x2(%ebx)
  tcphdr->seqno = seg->tcphdr->seqno;
  80afdf:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  80afe2:	8b 41 10             	mov    0x10(%ecx),%eax
  80afe5:	8b 40 04             	mov    0x4(%eax),%eax
  80afe8:	89 43 04             	mov    %eax,0x4(%ebx)
  tcphdr->ackno = htonl(pcb->rcv_nxt);
  80afeb:	8b 46 24             	mov    0x24(%esi),%eax
  80afee:	89 04 24             	mov    %eax,(%esp)
  80aff1:	e8 1e fd ff ff       	call   80ad14 <htonl>
  80aff6:	89 43 08             	mov    %eax,0x8(%ebx)
  TCPH_FLAGS_SET(tcphdr, 0);
  80aff9:	0f b7 43 0c          	movzwl 0xc(%ebx),%eax
  80affd:	89 04 24             	mov    %eax,(%esp)
  80b000:	e8 fb fc ff ff       	call   80ad00 <ntohs>
  80b005:	25 c0 ff 00 00       	and    $0xffc0,%eax
  80b00a:	89 04 24             	mov    %eax,(%esp)
  80b00d:	e8 e1 fc ff ff       	call   80acf3 <htons>
  80b012:	66 89 43 0c          	mov    %ax,0xc(%ebx)
  tcphdr->wnd = htons(pcb->rcv_ann_wnd);
  80b016:	0f b7 46 2a          	movzwl 0x2a(%esi),%eax
  80b01a:	89 04 24             	mov    %eax,(%esp)
  80b01d:	e8 d1 fc ff ff       	call   80acf3 <htons>
  80b022:	66 89 43 0e          	mov    %ax,0xe(%ebx)
  tcphdr->urgp = 0;
  80b026:	66 c7 43 12 00 00    	movw   $0x0,0x12(%ebx)
  TCPH_HDRLEN_SET(tcphdr, 5);
  80b02c:	0f b7 43 0c          	movzwl 0xc(%ebx),%eax
  80b030:	89 04 24             	mov    %eax,(%esp)
  80b033:	e8 c8 fc ff ff       	call   80ad00 <ntohs>
  80b038:	83 e0 3f             	and    $0x3f,%eax
  80b03b:	80 cc 50             	or     $0x50,%ah
  80b03e:	89 04 24             	mov    %eax,(%esp)
  80b041:	e8 ad fc ff ff       	call   80acf3 <htons>
  80b046:	66 89 43 0c          	mov    %ax,0xc(%ebx)

  /* Copy in one byte from the head of the unacked queue */
  *((char *)p->payload + sizeof(struct tcp_hdr)) = *(char *)seg->dataptr;
  80b04a:	8b 47 04             	mov    0x4(%edi),%eax
  80b04d:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  80b050:	8b 51 08             	mov    0x8(%ecx),%edx
  80b053:	0f b6 12             	movzbl (%edx),%edx
  80b056:	88 50 14             	mov    %dl,0x14(%eax)

  tcphdr->chksum = 0;
  80b059:	66 c7 43 10 00 00    	movw   $0x0,0x10(%ebx)
#if CHECKSUM_GEN_TCP
  tcphdr->chksum = inet_chksum_pseudo(p, &pcb->local_ip, &pcb->remote_ip,
  80b05f:	8d 46 04             	lea    0x4(%esi),%eax
  80b062:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  80b065:	0f b7 47 08          	movzwl 0x8(%edi),%eax
  80b069:	89 44 24 10          	mov    %eax,0x10(%esp)
  80b06d:	c7 44 24 0c 06 00 00 	movl   $0x6,0xc(%esp)
  80b074:	00 
  80b075:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80b078:	89 54 24 08          	mov    %edx,0x8(%esp)
  80b07c:	89 74 24 04          	mov    %esi,0x4(%esp)
  80b080:	89 3c 24             	mov    %edi,(%esp)
  80b083:	e8 68 f9 ff ff       	call   80a9f0 <inet_chksum_pseudo>
  80b088:	66 89 43 10          	mov    %ax,0x10(%ebx)
                   0, IP_PROTO_TCP, netif);
      netif->addr_hint = NULL;
    }
  }
#else /* LWIP_NETIF_HWADDRHINT*/
  ip_output(p, &pcb->local_ip, &pcb->remote_ip, pcb->ttl, 0, IP_PROTO_TCP);
  80b08c:	c7 44 24 14 06 00 00 	movl   $0x6,0x14(%esp)
  80b093:	00 
  80b094:	c7 44 24 10 00 00 00 	movl   $0x0,0x10(%esp)
  80b09b:	00 
  80b09c:	0f b6 46 0b          	movzbl 0xb(%esi),%eax
  80b0a0:	89 44 24 0c          	mov    %eax,0xc(%esp)
  80b0a4:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  80b0a7:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  80b0ab:	89 74 24 04          	mov    %esi,0x4(%esp)
  80b0af:	89 3c 24             	mov    %edi,(%esp)
  80b0b2:	e8 86 ea ff ff       	call   809b3d <ip_output>
#endif /* LWIP_NETIF_HWADDRHINT*/

  pbuf_free(p);
  80b0b7:	89 3c 24             	mov    %edi,(%esp)
  80b0ba:	e8 3e ce ff ff       	call   807efd <pbuf_free>

  LWIP_DEBUGF(TCP_DEBUG, ("tcp_zero_window_probe: seqno %"U32_F
                          " ackno %"U32_F".\n",
                          pcb->snd_nxt - 1, pcb->rcv_nxt));
}
  80b0bf:	83 c4 3c             	add    $0x3c,%esp
  80b0c2:	5b                   	pop    %ebx
  80b0c3:	5e                   	pop    %esi
  80b0c4:	5f                   	pop    %edi
  80b0c5:	5d                   	pop    %ebp
  80b0c6:	c3                   	ret    

0080b0c7 <tcp_keepalive>:
 *
 * @param pcb the tcp_pcb for which to send a keepalive packet
 */
void
tcp_keepalive(struct tcp_pcb *pcb)
{
  80b0c7:	55                   	push   %ebp
  80b0c8:	89 e5                	mov    %esp,%ebp
  80b0ca:	57                   	push   %edi
  80b0cb:	56                   	push   %esi
  80b0cc:	53                   	push   %ebx
  80b0cd:	83 ec 3c             	sub    $0x3c,%esp
  80b0d0:	8b 75 08             	mov    0x8(%ebp),%esi
                          ip4_addr3(&pcb->remote_ip), ip4_addr4(&pcb->remote_ip)));

  LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: tcp_ticks %"U32_F"   pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n", 
                          tcp_ticks, pcb->tmr, pcb->keep_cnt_sent));
   
  p = pbuf_alloc(PBUF_IP, TCP_HLEN, PBUF_RAM);
  80b0d3:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80b0da:	00 
  80b0db:	c7 44 24 04 14 00 00 	movl   $0x14,0x4(%esp)
  80b0e2:	00 
  80b0e3:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  80b0ea:	e8 ca d0 ff ff       	call   8081b9 <pbuf_alloc>
  80b0ef:	89 c7                	mov    %eax,%edi
   
  if(p == NULL) {
  80b0f1:	85 c0                	test   %eax,%eax
  80b0f3:	0f 84 1b 01 00 00    	je     80b214 <tcp_keepalive+0x14d>
    LWIP_DEBUGF(TCP_DEBUG, 
                ("tcp_keepalive: could not allocate memory for pbuf\n"));
    return;
  }
  LWIP_ASSERT("check that first pbuf can hold struct tcp_hdr",
  80b0f9:	66 83 78 0a 13       	cmpw   $0x13,0xa(%eax)
  80b0fe:	77 1c                	ja     80b11c <tcp_keepalive+0x55>
  80b100:	c7 44 24 08 44 3e 81 	movl   $0x813e44,0x8(%esp)
  80b107:	00 
  80b108:	c7 44 24 04 3a 03 00 	movl   $0x33a,0x4(%esp)
  80b10f:	00 
  80b110:	c7 04 24 e8 3f 81 00 	movl   $0x813fe8,(%esp)
  80b117:	e8 80 58 ff ff       	call   80099c <_panic>
              (p->len >= sizeof(struct tcp_hdr)));

  tcphdr = p->payload;
  80b11c:	8b 58 04             	mov    0x4(%eax),%ebx
  tcphdr->src = htons(pcb->local_port);
  80b11f:	0f b7 46 1c          	movzwl 0x1c(%esi),%eax
  80b123:	89 04 24             	mov    %eax,(%esp)
  80b126:	e8 c8 fb ff ff       	call   80acf3 <htons>
  80b12b:	66 89 03             	mov    %ax,(%ebx)
  tcphdr->dest = htons(pcb->remote_port);
  80b12e:	0f b7 46 1e          	movzwl 0x1e(%esi),%eax
  80b132:	89 04 24             	mov    %eax,(%esp)
  80b135:	e8 b9 fb ff ff       	call   80acf3 <htons>
  80b13a:	66 89 43 02          	mov    %ax,0x2(%ebx)
  tcphdr->seqno = htonl(pcb->snd_nxt - 1);
  80b13e:	8b 46 54             	mov    0x54(%esi),%eax
  80b141:	83 e8 01             	sub    $0x1,%eax
  80b144:	89 04 24             	mov    %eax,(%esp)
  80b147:	e8 c8 fb ff ff       	call   80ad14 <htonl>
  80b14c:	89 43 04             	mov    %eax,0x4(%ebx)
  tcphdr->ackno = htonl(pcb->rcv_nxt);
  80b14f:	8b 46 24             	mov    0x24(%esi),%eax
  80b152:	89 04 24             	mov    %eax,(%esp)
  80b155:	e8 ba fb ff ff       	call   80ad14 <htonl>
  80b15a:	89 43 08             	mov    %eax,0x8(%ebx)
  TCPH_FLAGS_SET(tcphdr, 0);
  80b15d:	0f b7 43 0c          	movzwl 0xc(%ebx),%eax
  80b161:	89 04 24             	mov    %eax,(%esp)
  80b164:	e8 97 fb ff ff       	call   80ad00 <ntohs>
  80b169:	25 c0 ff 00 00       	and    $0xffc0,%eax
  80b16e:	89 04 24             	mov    %eax,(%esp)
  80b171:	e8 7d fb ff ff       	call   80acf3 <htons>
  80b176:	66 89 43 0c          	mov    %ax,0xc(%ebx)
  tcphdr->wnd = htons(pcb->rcv_ann_wnd);
  80b17a:	0f b7 46 2a          	movzwl 0x2a(%esi),%eax
  80b17e:	89 04 24             	mov    %eax,(%esp)
  80b181:	e8 6d fb ff ff       	call   80acf3 <htons>
  80b186:	66 89 43 0e          	mov    %ax,0xe(%ebx)
  tcphdr->urgp = 0;
  80b18a:	66 c7 43 12 00 00    	movw   $0x0,0x12(%ebx)
  TCPH_HDRLEN_SET(tcphdr, 5);
  80b190:	0f b7 43 0c          	movzwl 0xc(%ebx),%eax
  80b194:	89 04 24             	mov    %eax,(%esp)
  80b197:	e8 64 fb ff ff       	call   80ad00 <ntohs>
  80b19c:	83 e0 3f             	and    $0x3f,%eax
  80b19f:	80 cc 50             	or     $0x50,%ah
  80b1a2:	89 04 24             	mov    %eax,(%esp)
  80b1a5:	e8 49 fb ff ff       	call   80acf3 <htons>
  80b1aa:	66 89 43 0c          	mov    %ax,0xc(%ebx)

  tcphdr->chksum = 0;
  80b1ae:	66 c7 43 10 00 00    	movw   $0x0,0x10(%ebx)
#if CHECKSUM_GEN_TCP
  tcphdr->chksum = inet_chksum_pseudo(p, &pcb->local_ip, &pcb->remote_ip,
  80b1b4:	8d 46 04             	lea    0x4(%esi),%eax
  80b1b7:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  80b1ba:	0f b7 47 08          	movzwl 0x8(%edi),%eax
  80b1be:	89 44 24 10          	mov    %eax,0x10(%esp)
  80b1c2:	c7 44 24 0c 06 00 00 	movl   $0x6,0xc(%esp)
  80b1c9:	00 
  80b1ca:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80b1cd:	89 44 24 08          	mov    %eax,0x8(%esp)
  80b1d1:	89 74 24 04          	mov    %esi,0x4(%esp)
  80b1d5:	89 3c 24             	mov    %edi,(%esp)
  80b1d8:	e8 13 f8 ff ff       	call   80a9f0 <inet_chksum_pseudo>
  80b1dd:	66 89 43 10          	mov    %ax,0x10(%ebx)
                   0, IP_PROTO_TCP, netif);
      netif->addr_hint = NULL;
    }
  }
#else /* LWIP_NETIF_HWADDRHINT*/
  ip_output(p, &pcb->local_ip, &pcb->remote_ip, pcb->ttl, 0, IP_PROTO_TCP);
  80b1e1:	c7 44 24 14 06 00 00 	movl   $0x6,0x14(%esp)
  80b1e8:	00 
  80b1e9:	c7 44 24 10 00 00 00 	movl   $0x0,0x10(%esp)
  80b1f0:	00 
  80b1f1:	0f b6 46 0b          	movzbl 0xb(%esi),%eax
  80b1f5:	89 44 24 0c          	mov    %eax,0xc(%esp)
  80b1f9:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80b1fc:	89 44 24 08          	mov    %eax,0x8(%esp)
  80b200:	89 74 24 04          	mov    %esi,0x4(%esp)
  80b204:	89 3c 24             	mov    %edi,(%esp)
  80b207:	e8 31 e9 ff ff       	call   809b3d <ip_output>
#endif /* LWIP_NETIF_HWADDRHINT*/

  pbuf_free(p);
  80b20c:	89 3c 24             	mov    %edi,(%esp)
  80b20f:	e8 e9 cc ff ff       	call   807efd <pbuf_free>

  LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: seqno %"U32_F" ackno %"U32_F".\n",
                          pcb->snd_nxt - 1, pcb->rcv_nxt));
}
  80b214:	83 c4 3c             	add    $0x3c,%esp
  80b217:	5b                   	pop    %ebx
  80b218:	5e                   	pop    %esi
  80b219:	5f                   	pop    %edi
  80b21a:	5d                   	pop    %ebp
  80b21b:	c3                   	ret    

0080b21c <tcp_rst>:
 */
void
tcp_rst(u32_t seqno, u32_t ackno,
  struct ip_addr *local_ip, struct ip_addr *remote_ip,
  u16_t local_port, u16_t remote_port)
{
  80b21c:	55                   	push   %ebp
  80b21d:	89 e5                	mov    %esp,%ebp
  80b21f:	57                   	push   %edi
  80b220:	56                   	push   %esi
  80b221:	53                   	push   %ebx
  80b222:	83 ec 3c             	sub    $0x3c,%esp
  80b225:	8b 7d 14             	mov    0x14(%ebp),%edi
  80b228:	0f b7 45 18          	movzwl 0x18(%ebp),%eax
  80b22c:	66 89 45 e6          	mov    %ax,-0x1a(%ebp)
  80b230:	0f b7 45 1c          	movzwl 0x1c(%ebp),%eax
  80b234:	66 89 45 e4          	mov    %ax,-0x1c(%ebp)
  struct pbuf *p;
  struct tcp_hdr *tcphdr;
  p = pbuf_alloc(PBUF_IP, TCP_HLEN, PBUF_RAM);
  80b238:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80b23f:	00 
  80b240:	c7 44 24 04 14 00 00 	movl   $0x14,0x4(%esp)
  80b247:	00 
  80b248:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  80b24f:	e8 65 cf ff ff       	call   8081b9 <pbuf_alloc>
  80b254:	89 c6                	mov    %eax,%esi
  if (p == NULL) {
  80b256:	85 c0                	test   %eax,%eax
  80b258:	0f 84 15 01 00 00    	je     80b373 <tcp_rst+0x157>
      LWIP_DEBUGF(TCP_DEBUG, ("tcp_rst: could not allocate memory for pbuf\n"));
      return;
  }
  LWIP_ASSERT("check that first pbuf can hold struct tcp_hdr",
  80b25e:	66 83 78 0a 13       	cmpw   $0x13,0xa(%eax)
  80b263:	77 1c                	ja     80b281 <tcp_rst+0x65>
  80b265:	c7 44 24 08 44 3e 81 	movl   $0x813e44,0x8(%esp)
  80b26c:	00 
  80b26d:	c7 44 24 04 be 02 00 	movl   $0x2be,0x4(%esp)
  80b274:	00 
  80b275:	c7 04 24 e8 3f 81 00 	movl   $0x813fe8,(%esp)
  80b27c:	e8 1b 57 ff ff       	call   80099c <_panic>
              (p->len >= sizeof(struct tcp_hdr)));

  tcphdr = p->payload;
  80b281:	8b 58 04             	mov    0x4(%eax),%ebx
  tcphdr->src = htons(local_port);
  80b284:	0f b7 45 e6          	movzwl -0x1a(%ebp),%eax
  80b288:	89 04 24             	mov    %eax,(%esp)
  80b28b:	e8 63 fa ff ff       	call   80acf3 <htons>
  80b290:	66 89 03             	mov    %ax,(%ebx)
  tcphdr->dest = htons(remote_port);
  80b293:	0f b7 45 e4          	movzwl -0x1c(%ebp),%eax
  80b297:	89 04 24             	mov    %eax,(%esp)
  80b29a:	e8 54 fa ff ff       	call   80acf3 <htons>
  80b29f:	66 89 43 02          	mov    %ax,0x2(%ebx)
  tcphdr->seqno = htonl(seqno);
  80b2a3:	8b 45 08             	mov    0x8(%ebp),%eax
  80b2a6:	89 04 24             	mov    %eax,(%esp)
  80b2a9:	e8 66 fa ff ff       	call   80ad14 <htonl>
  80b2ae:	89 43 04             	mov    %eax,0x4(%ebx)
  tcphdr->ackno = htonl(ackno);
  80b2b1:	8b 45 0c             	mov    0xc(%ebp),%eax
  80b2b4:	89 04 24             	mov    %eax,(%esp)
  80b2b7:	e8 58 fa ff ff       	call   80ad14 <htonl>
  80b2bc:	89 43 08             	mov    %eax,0x8(%ebx)
  TCPH_FLAGS_SET(tcphdr, TCP_RST | TCP_ACK);
  80b2bf:	0f b7 43 0c          	movzwl 0xc(%ebx),%eax
  80b2c3:	89 04 24             	mov    %eax,(%esp)
  80b2c6:	e8 35 fa ff ff       	call   80ad00 <ntohs>
  80b2cb:	25 c0 ff 00 00       	and    $0xffc0,%eax
  80b2d0:	83 c8 14             	or     $0x14,%eax
  80b2d3:	89 04 24             	mov    %eax,(%esp)
  80b2d6:	e8 18 fa ff ff       	call   80acf3 <htons>
  80b2db:	66 89 43 0c          	mov    %ax,0xc(%ebx)
  tcphdr->wnd = htons(TCP_WND);
  80b2df:	c7 04 24 c0 5d 00 00 	movl   $0x5dc0,(%esp)
  80b2e6:	e8 08 fa ff ff       	call   80acf3 <htons>
  80b2eb:	66 89 43 0e          	mov    %ax,0xe(%ebx)
  tcphdr->urgp = 0;
  80b2ef:	66 c7 43 12 00 00    	movw   $0x0,0x12(%ebx)
  TCPH_HDRLEN_SET(tcphdr, 5);
  80b2f5:	0f b7 43 0c          	movzwl 0xc(%ebx),%eax
  80b2f9:	89 04 24             	mov    %eax,(%esp)
  80b2fc:	e8 ff f9 ff ff       	call   80ad00 <ntohs>
  80b301:	83 e0 3f             	and    $0x3f,%eax
  80b304:	80 cc 50             	or     $0x50,%ah
  80b307:	89 04 24             	mov    %eax,(%esp)
  80b30a:	e8 e4 f9 ff ff       	call   80acf3 <htons>
  80b30f:	66 89 43 0c          	mov    %ax,0xc(%ebx)

  tcphdr->chksum = 0;
  80b313:	66 c7 43 10 00 00    	movw   $0x0,0x10(%ebx)
#if CHECKSUM_GEN_TCP
  tcphdr->chksum = inet_chksum_pseudo(p, local_ip, remote_ip,
  80b319:	0f b7 46 08          	movzwl 0x8(%esi),%eax
  80b31d:	89 44 24 10          	mov    %eax,0x10(%esp)
  80b321:	c7 44 24 0c 06 00 00 	movl   $0x6,0xc(%esp)
  80b328:	00 
  80b329:	89 7c 24 08          	mov    %edi,0x8(%esp)
  80b32d:	8b 45 10             	mov    0x10(%ebp),%eax
  80b330:	89 44 24 04          	mov    %eax,0x4(%esp)
  80b334:	89 34 24             	mov    %esi,(%esp)
  80b337:	e8 b4 f6 ff ff       	call   80a9f0 <inet_chksum_pseudo>
  80b33c:	66 89 43 10          	mov    %ax,0x10(%ebx)
              IP_PROTO_TCP, p->tot_len);
#endif
  TCP_STATS_INC(tcp.xmit);
  snmp_inc_tcpoutrsts();
   /* Send output with hardcoded TTL since we have no access to the pcb */
  ip_output(p, local_ip, remote_ip, TCP_TTL, 0, IP_PROTO_TCP);
  80b340:	c7 44 24 14 06 00 00 	movl   $0x6,0x14(%esp)
  80b347:	00 
  80b348:	c7 44 24 10 00 00 00 	movl   $0x0,0x10(%esp)
  80b34f:	00 
  80b350:	c7 44 24 0c ff 00 00 	movl   $0xff,0xc(%esp)
  80b357:	00 
  80b358:	89 7c 24 08          	mov    %edi,0x8(%esp)
  80b35c:	8b 45 10             	mov    0x10(%ebp),%eax
  80b35f:	89 44 24 04          	mov    %eax,0x4(%esp)
  80b363:	89 34 24             	mov    %esi,(%esp)
  80b366:	e8 d2 e7 ff ff       	call   809b3d <ip_output>
  pbuf_free(p);
  80b36b:	89 34 24             	mov    %esi,(%esp)
  80b36e:	e8 8a cb ff ff       	call   807efd <pbuf_free>
  LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_rst: seqno %"U32_F" ackno %"U32_F".\n", seqno, ackno));
}
  80b373:	83 c4 3c             	add    $0x3c,%esp
  80b376:	5b                   	pop    %ebx
  80b377:	5e                   	pop    %esi
  80b378:	5f                   	pop    %edi
  80b379:	5d                   	pop    %ebp
  80b37a:	c3                   	ret    

0080b37b <tcp_output>:
 * @return ERR_OK if data has been sent or nothing to send
 *         another err_t on error
 */
err_t
tcp_output(struct tcp_pcb *pcb)
{
  80b37b:	55                   	push   %ebp
  80b37c:	89 e5                	mov    %esp,%ebp
  80b37e:	57                   	push   %edi
  80b37f:	56                   	push   %esi
  80b380:	53                   	push   %ebx
  80b381:	83 ec 4c             	sub    $0x4c,%esp
  80b384:	8b 75 08             	mov    0x8(%ebp),%esi

  /* First, check if we are invoked by the TCP input processing
     code. If so, we do not output anything. Instead, we rely on the
     input processing code to call us when input processing is done
     with. */
  if (tcp_input_pcb == pcb) {
  80b387:	b8 00 00 00 00       	mov    $0x0,%eax
  80b38c:	39 35 24 f6 b3 00    	cmp    %esi,0xb3f624
  80b392:	0f 84 7e 04 00 00    	je     80b816 <tcp_output+0x49b>
    return ERR_OK;
  }

  wnd = LWIP_MIN(pcb->snd_wnd, pcb->cwnd);
  80b398:	0f b7 46 4e          	movzwl 0x4e(%esi),%eax
  80b39c:	66 39 46 5c          	cmp    %ax,0x5c(%esi)
  80b3a0:	66 0f 46 46 5c       	cmovbe 0x5c(%esi),%ax
  80b3a5:	0f b7 c0             	movzwl %ax,%eax
  80b3a8:	89 45 d4             	mov    %eax,-0x2c(%ebp)

  seg = pcb->unsent;
  80b3ab:	8b 5e 74             	mov    0x74(%esi),%ebx

  /* useg should point to last segment on unacked queue */
  useg = pcb->unacked;
  80b3ae:	8b 7e 78             	mov    0x78(%esi),%edi
  if (useg != NULL) {
  80b3b1:	85 ff                	test   %edi,%edi
  80b3b3:	74 0a                	je     80b3bf <tcp_output+0x44>
    for (; useg->next != NULL; useg = useg->next);
  80b3b5:	8b 07                	mov    (%edi),%eax
  80b3b7:	85 c0                	test   %eax,%eax
  80b3b9:	74 04                	je     80b3bf <tcp_output+0x44>
  80b3bb:	89 c7                	mov    %eax,%edi
  80b3bd:	eb f6                	jmp    80b3b5 <tcp_output+0x3a>
   * because the ->unsent queue is empty or because the window does
   * not allow it), construct an empty ACK segment and send it.
   *
   * If data is to be sent, we will just piggyback the ACK (see below).
   */
  if (pcb->flags & TF_ACK_NOW &&
  80b3bf:	f6 46 20 02          	testb  $0x2,0x20(%esi)
  80b3c3:	75 10                	jne    80b3d5 <tcp_output+0x5a>
                 ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len,
                 ntohl(seg->tcphdr->seqno), pcb->lastack));
  }
#endif /* TCP_CWND_DEBUG */
  /* data available and window allows it to be sent? */
  while (seg != NULL &&
  80b3c5:	85 db                	test   %ebx,%ebx
  80b3c7:	75 2e                	jne    80b3f7 <tcp_output+0x7c>
  80b3c9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  80b3d0:	e9 38 04 00 00       	jmp    80b80d <tcp_output+0x492>
   * because the ->unsent queue is empty or because the window does
   * not allow it), construct an empty ACK segment and send it.
   *
   * If data is to be sent, we will just piggyback the ACK (see below).
   */
  if (pcb->flags & TF_ACK_NOW &&
  80b3d5:	85 db                	test   %ebx,%ebx
  80b3d7:	90                   	nop
  80b3d8:	74 2e                	je     80b408 <tcp_output+0x8d>
     (seg == NULL ||
      ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len > wnd)) {
  80b3da:	8b 43 10             	mov    0x10(%ebx),%eax
  80b3dd:	8b 40 04             	mov    0x4(%eax),%eax
  80b3e0:	89 04 24             	mov    %eax,(%esp)
  80b3e3:	e8 4d fb ff ff       	call   80af35 <ntohl>
  80b3e8:	0f b7 53 0c          	movzwl 0xc(%ebx),%edx
  80b3ec:	2b 56 48             	sub    0x48(%esi),%edx
  80b3ef:	8d 04 02             	lea    (%edx,%eax,1),%eax
  80b3f2:	39 45 d4             	cmp    %eax,-0x2c(%ebp)
  80b3f5:	72 11                	jb     80b408 <tcp_output+0x8d>
  /* advertise our receive window size in this TCP segment */
  seg->tcphdr->wnd = htons(pcb->rcv_ann_wnd);

  /* If we don't have a local IP address, we get one by
     calling ip_route(). */
  if (ip_addr_isany(&(pcb->local_ip))) {
  80b3f7:	89 75 e4             	mov    %esi,-0x1c(%ebp)
    netif = ip_route(&(pcb->remote_ip));
  80b3fa:	8d 46 04             	lea    0x4(%esi),%eax
  80b3fd:	89 45 e0             	mov    %eax,-0x20(%ebp)
  80b400:	89 7d d8             	mov    %edi,-0x28(%ebp)
  80b403:	e9 a7 03 00 00       	jmp    80b7af <tcp_output+0x434>
   * If data is to be sent, we will just piggyback the ACK (see below).
   */
  if (pcb->flags & TF_ACK_NOW &&
     (seg == NULL ||
      ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len > wnd)) {
    p = pbuf_alloc(PBUF_IP, TCP_HLEN, PBUF_RAM);
  80b408:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80b40f:	00 
  80b410:	c7 44 24 04 14 00 00 	movl   $0x14,0x4(%esp)
  80b417:	00 
  80b418:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  80b41f:	e8 95 cd ff ff       	call   8081b9 <pbuf_alloc>
  80b424:	89 c7                	mov    %eax,%edi
    if (p == NULL) {
  80b426:	b8 fe ff ff ff       	mov    $0xfffffffe,%eax
  80b42b:	85 ff                	test   %edi,%edi
  80b42d:	0f 84 e3 03 00 00    	je     80b816 <tcp_output+0x49b>
      LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_output: (ACK) could not allocate pbuf\n"));
      return ERR_BUF;
    }
    LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_output: sending ACK for %"U32_F"\n", pcb->rcv_nxt));
    /* remove ACK flags from the PCB, as we send an empty ACK now */
    pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
  80b433:	80 66 20 fc          	andb   $0xfc,0x20(%esi)

    tcphdr = p->payload;
  80b437:	8b 5f 04             	mov    0x4(%edi),%ebx
    tcphdr->src = htons(pcb->local_port);
  80b43a:	0f b7 46 1c          	movzwl 0x1c(%esi),%eax
  80b43e:	89 04 24             	mov    %eax,(%esp)
  80b441:	e8 ad f8 ff ff       	call   80acf3 <htons>
  80b446:	66 89 03             	mov    %ax,(%ebx)
    tcphdr->dest = htons(pcb->remote_port);
  80b449:	0f b7 46 1e          	movzwl 0x1e(%esi),%eax
  80b44d:	89 04 24             	mov    %eax,(%esp)
  80b450:	e8 9e f8 ff ff       	call   80acf3 <htons>
  80b455:	66 89 43 02          	mov    %ax,0x2(%ebx)
    tcphdr->seqno = htonl(pcb->snd_nxt);
  80b459:	8b 46 54             	mov    0x54(%esi),%eax
  80b45c:	89 04 24             	mov    %eax,(%esp)
  80b45f:	e8 b0 f8 ff ff       	call   80ad14 <htonl>
  80b464:	89 43 04             	mov    %eax,0x4(%ebx)
    tcphdr->ackno = htonl(pcb->rcv_nxt);
  80b467:	8b 46 24             	mov    0x24(%esi),%eax
  80b46a:	89 04 24             	mov    %eax,(%esp)
  80b46d:	e8 a2 f8 ff ff       	call   80ad14 <htonl>
  80b472:	89 43 08             	mov    %eax,0x8(%ebx)
    TCPH_FLAGS_SET(tcphdr, TCP_ACK);
  80b475:	0f b7 43 0c          	movzwl 0xc(%ebx),%eax
  80b479:	89 04 24             	mov    %eax,(%esp)
  80b47c:	e8 7f f8 ff ff       	call   80ad00 <ntohs>
  80b481:	25 c0 ff 00 00       	and    $0xffc0,%eax
  80b486:	83 c8 10             	or     $0x10,%eax
  80b489:	89 04 24             	mov    %eax,(%esp)
  80b48c:	e8 62 f8 ff ff       	call   80acf3 <htons>
  80b491:	66 89 43 0c          	mov    %ax,0xc(%ebx)
    tcphdr->wnd = htons(pcb->rcv_ann_wnd);
  80b495:	0f b7 46 2a          	movzwl 0x2a(%esi),%eax
  80b499:	89 04 24             	mov    %eax,(%esp)
  80b49c:	e8 52 f8 ff ff       	call   80acf3 <htons>
  80b4a1:	66 89 43 0e          	mov    %ax,0xe(%ebx)
    tcphdr->urgp = 0;
  80b4a5:	66 c7 43 12 00 00    	movw   $0x0,0x12(%ebx)
    TCPH_HDRLEN_SET(tcphdr, 5);
  80b4ab:	0f b7 43 0c          	movzwl 0xc(%ebx),%eax
  80b4af:	89 04 24             	mov    %eax,(%esp)
  80b4b2:	e8 49 f8 ff ff       	call   80ad00 <ntohs>
  80b4b7:	83 e0 3f             	and    $0x3f,%eax
  80b4ba:	80 cc 50             	or     $0x50,%ah
  80b4bd:	89 04 24             	mov    %eax,(%esp)
  80b4c0:	e8 2e f8 ff ff       	call   80acf3 <htons>
  80b4c5:	66 89 43 0c          	mov    %ax,0xc(%ebx)

    tcphdr->chksum = 0;
  80b4c9:	66 c7 43 10 00 00    	movw   $0x0,0x10(%ebx)
#if CHECKSUM_GEN_TCP
    tcphdr->chksum = inet_chksum_pseudo(p, &(pcb->local_ip), &(pcb->remote_ip),
  80b4cf:	8d 56 04             	lea    0x4(%esi),%edx
  80b4d2:	89 55 e4             	mov    %edx,-0x1c(%ebp)
  80b4d5:	0f b7 47 08          	movzwl 0x8(%edi),%eax
  80b4d9:	89 44 24 10          	mov    %eax,0x10(%esp)
  80b4dd:	c7 44 24 0c 06 00 00 	movl   $0x6,0xc(%esp)
  80b4e4:	00 
  80b4e5:	89 54 24 08          	mov    %edx,0x8(%esp)
  80b4e9:	89 74 24 04          	mov    %esi,0x4(%esp)
  80b4ed:	89 3c 24             	mov    %edi,(%esp)
  80b4f0:	e8 fb f4 ff ff       	call   80a9f0 <inet_chksum_pseudo>
  80b4f5:	66 89 43 10          	mov    %ax,0x10(%ebx)
                     pcb->tos, IP_PROTO_TCP, netif);
        netif->addr_hint = NULL;
      }
    }
#else /* LWIP_NETIF_HWADDRHINT*/
    ip_output(p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
  80b4f9:	c7 44 24 14 06 00 00 	movl   $0x6,0x14(%esp)
  80b500:	00 
  80b501:	0f b6 46 0a          	movzbl 0xa(%esi),%eax
  80b505:	89 44 24 10          	mov    %eax,0x10(%esp)
  80b509:	0f b6 46 0b          	movzbl 0xb(%esi),%eax
  80b50d:	89 44 24 0c          	mov    %eax,0xc(%esp)
  80b511:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80b514:	89 44 24 08          	mov    %eax,0x8(%esp)
  80b518:	89 74 24 04          	mov    %esi,0x4(%esp)
  80b51c:	89 3c 24             	mov    %edi,(%esp)
  80b51f:	e8 19 e6 ff ff       	call   809b3d <ip_output>
        IP_PROTO_TCP);
#endif /* LWIP_NETIF_HWADDRHINT*/
    pbuf_free(p);
  80b524:	89 3c 24             	mov    %edi,(%esp)
  80b527:	e8 d1 c9 ff ff       	call   807efd <pbuf_free>
  80b52c:	b8 00 00 00 00       	mov    $0x0,%eax

    return ERR_OK;
  80b531:	e9 e0 02 00 00       	jmp    80b816 <tcp_output+0x49b>
  }
#endif /* TCP_CWND_DEBUG */
  /* data available and window allows it to be sent? */
  while (seg != NULL &&
         ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len <= wnd) {
    LWIP_ASSERT("RST not expected here!", 
  80b536:	8b 43 10             	mov    0x10(%ebx),%eax
  80b539:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  80b53d:	89 04 24             	mov    %eax,(%esp)
  80b540:	e8 bb f7 ff ff       	call   80ad00 <ntohs>
  80b545:	a8 04                	test   $0x4,%al
  80b547:	74 1c                	je     80b565 <tcp_output+0x1ea>
  80b549:	c7 44 24 08 00 40 81 	movl   $0x814000,0x8(%esp)
  80b550:	00 
  80b551:	c7 44 24 04 05 02 00 	movl   $0x205,0x4(%esp)
  80b558:	00 
  80b559:	c7 04 24 e8 3f 81 00 	movl   $0x813fe8,(%esp)
  80b560:	e8 37 54 ff ff       	call   80099c <_panic>
     * - if tcp_enqueue had a memory error before (prevent delayed ACK timeout) or
     * - if FIN was already enqueued for this PCB (SYN is always alone in a segment -
     *   either seg->next != NULL or pcb->unacked == NULL;
     *   RST is no sent using tcp_enqueue/tcp_output.
     */
    if((tcp_do_output_nagle(pcb) == 0) &&
  80b565:	83 7e 78 00          	cmpl   $0x0,0x78(%esi)
  80b569:	74 1c                	je     80b587 <tcp_output+0x20c>
  80b56b:	0f b6 46 20          	movzbl 0x20(%esi),%eax
  80b56f:	a8 40                	test   $0x40,%al
  80b571:	75 14                	jne    80b587 <tcp_output+0x20c>
  80b573:	8b 56 74             	mov    0x74(%esi),%edx
  80b576:	85 d2                	test   %edx,%edx
  80b578:	0f 84 a0 02 00 00    	je     80b81e <tcp_output+0x4a3>
  80b57e:	83 3a 00             	cmpl   $0x0,(%edx)
  80b581:	0f 84 97 02 00 00    	je     80b81e <tcp_output+0x4a3>
                            pcb->lastack,
                            ntohl(seg->tcphdr->seqno), pcb->lastack, i));
    ++i;
#endif /* TCP_CWND_DEBUG */

    pcb->unsent = seg->next;
  80b587:	8b 03                	mov    (%ebx),%eax
  80b589:	89 46 74             	mov    %eax,0x74(%esi)

    if (pcb->state != SYN_SENT) {
  80b58c:	83 7e 10 02          	cmpl   $0x2,0x10(%esi)
  80b590:	74 25                	je     80b5b7 <tcp_output+0x23c>
      TCPH_SET_FLAG(seg->tcphdr, TCP_ACK);
  80b592:	8b 7b 10             	mov    0x10(%ebx),%edi
  80b595:	0f b7 47 0c          	movzwl 0xc(%edi),%eax
  80b599:	89 04 24             	mov    %eax,(%esp)
  80b59c:	e8 5f f7 ff ff       	call   80ad00 <ntohs>
  80b5a1:	83 c8 10             	or     $0x10,%eax
  80b5a4:	0f b7 c0             	movzwl %ax,%eax
  80b5a7:	89 04 24             	mov    %eax,(%esp)
  80b5aa:	e8 44 f7 ff ff       	call   80acf3 <htons>
  80b5af:	66 89 47 0c          	mov    %ax,0xc(%edi)
      pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
  80b5b3:	80 66 20 fc          	andb   $0xfc,0x20(%esi)
  /** @bug Exclude retransmitted segments from this count. */
  snmp_inc_tcpoutsegs();

  /* The TCP header has already been constructed, but the ackno and
   wnd fields remain. */
  seg->tcphdr->ackno = htonl(pcb->rcv_nxt);
  80b5b7:	8b 7b 10             	mov    0x10(%ebx),%edi
  80b5ba:	8b 46 24             	mov    0x24(%esi),%eax
  80b5bd:	89 04 24             	mov    %eax,(%esp)
  80b5c0:	e8 4f f7 ff ff       	call   80ad14 <htonl>
  80b5c5:	89 47 08             	mov    %eax,0x8(%edi)

  /* advertise our receive window size in this TCP segment */
  seg->tcphdr->wnd = htons(pcb->rcv_ann_wnd);
  80b5c8:	8b 7b 10             	mov    0x10(%ebx),%edi
  80b5cb:	0f b7 46 2a          	movzwl 0x2a(%esi),%eax
  80b5cf:	89 04 24             	mov    %eax,(%esp)
  80b5d2:	e8 1c f7 ff ff       	call   80acf3 <htons>
  80b5d7:	66 89 47 0e          	mov    %ax,0xe(%edi)

  /* If we don't have a local IP address, we get one by
     calling ip_route(). */
  if (ip_addr_isany(&(pcb->local_ip))) {
  80b5db:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  80b5df:	74 05                	je     80b5e6 <tcp_output+0x26b>
  80b5e1:	83 3e 00             	cmpl   $0x0,(%esi)
  80b5e4:	75 22                	jne    80b608 <tcp_output+0x28d>
    netif = ip_route(&(pcb->remote_ip));
  80b5e6:	8b 55 e0             	mov    -0x20(%ebp),%edx
  80b5e9:	89 14 24             	mov    %edx,(%esp)
  80b5ec:	e8 f0 e4 ff ff       	call   809ae1 <ip_route>
    if (netif == NULL) {
  80b5f1:	85 c0                	test   %eax,%eax
  80b5f3:	0f 84 c3 00 00 00    	je     80b6bc <tcp_output+0x341>
      return;
    }
    ip_addr_set(&(pcb->local_ip), &(netif->ip_addr));
  80b5f9:	ba 00 00 00 00       	mov    $0x0,%edx
  80b5fe:	83 f8 fc             	cmp    $0xfffffffc,%eax
  80b601:	74 03                	je     80b606 <tcp_output+0x28b>
  80b603:	8b 50 04             	mov    0x4(%eax),%edx
  80b606:	89 16                	mov    %edx,(%esi)
  }

  /* Set retransmission timer running if it is not currently enabled */
  if(pcb->rtime == -1)
  80b608:	66 83 7e 32 ff       	cmpw   $0xffffffff,0x32(%esi)
  80b60d:	75 06                	jne    80b615 <tcp_output+0x29a>
    pcb->rtime = 0;
  80b60f:	66 c7 46 32 00 00    	movw   $0x0,0x32(%esi)

  if (pcb->rttest == 0) {
  80b615:	83 7e 38 00          	cmpl   $0x0,0x38(%esi)
  80b619:	75 19                	jne    80b634 <tcp_output+0x2b9>
    pcb->rttest = tcp_ticks;
  80b61b:	a1 0c f6 b3 00       	mov    0xb3f60c,%eax
  80b620:	89 46 38             	mov    %eax,0x38(%esi)
    pcb->rtseq = ntohl(seg->tcphdr->seqno);
  80b623:	8b 43 10             	mov    0x10(%ebx),%eax
  80b626:	8b 40 04             	mov    0x4(%eax),%eax
  80b629:	89 04 24             	mov    %eax,(%esp)
  80b62c:	e8 04 f9 ff ff       	call   80af35 <ntohl>
  80b631:	89 46 3c             	mov    %eax,0x3c(%esi)
  }
  LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_output_segment: %"U32_F":%"U32_F"\n",
          htonl(seg->tcphdr->seqno), htonl(seg->tcphdr->seqno) +
          seg->len));

  len = (u16_t)((u8_t *)seg->tcphdr - (u8_t *)seg->p->payload);
  80b634:	8b 43 04             	mov    0x4(%ebx),%eax
  80b637:	8b 53 10             	mov    0x10(%ebx),%edx
  80b63a:	66 2b 50 04          	sub    0x4(%eax),%dx

  seg->p->len -= len;
  80b63e:	66 29 50 0a          	sub    %dx,0xa(%eax)
  seg->p->tot_len -= len;
  80b642:	8b 43 04             	mov    0x4(%ebx),%eax
  80b645:	66 29 50 08          	sub    %dx,0x8(%eax)

  seg->p->payload = seg->tcphdr;
  80b649:	8b 43 04             	mov    0x4(%ebx),%eax
  80b64c:	8b 53 10             	mov    0x10(%ebx),%edx
  80b64f:	89 50 04             	mov    %edx,0x4(%eax)

  seg->tcphdr->chksum = 0;
  80b652:	8b 43 10             	mov    0x10(%ebx),%eax
  80b655:	66 c7 40 10 00 00    	movw   $0x0,0x10(%eax)
#if CHECKSUM_GEN_TCP
  seg->tcphdr->chksum = inet_chksum_pseudo(seg->p,
  80b65b:	8b 7b 10             	mov    0x10(%ebx),%edi
             &(pcb->local_ip),
             &(pcb->remote_ip),
             IP_PROTO_TCP, seg->p->tot_len);
  80b65e:	8b 43 04             	mov    0x4(%ebx),%eax

  seg->p->payload = seg->tcphdr;

  seg->tcphdr->chksum = 0;
#if CHECKSUM_GEN_TCP
  seg->tcphdr->chksum = inet_chksum_pseudo(seg->p,
  80b661:	0f b7 50 08          	movzwl 0x8(%eax),%edx
  80b665:	89 54 24 10          	mov    %edx,0x10(%esp)
  80b669:	c7 44 24 0c 06 00 00 	movl   $0x6,0xc(%esp)
  80b670:	00 
  80b671:	8b 55 e0             	mov    -0x20(%ebp),%edx
  80b674:	89 54 24 08          	mov    %edx,0x8(%esp)
  80b678:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80b67b:	89 54 24 04          	mov    %edx,0x4(%esp)
  80b67f:	89 04 24             	mov    %eax,(%esp)
  80b682:	e8 69 f3 ff ff       	call   80a9f0 <inet_chksum_pseudo>
  80b687:	66 89 47 10          	mov    %ax,0x10(%edi)
                   pcb->tos, IP_PROTO_TCP, netif);
      netif->addr_hint = NULL;
    }
  }
#else /* LWIP_NETIF_HWADDRHINT*/
  ip_output(seg->p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
  80b68b:	c7 44 24 14 06 00 00 	movl   $0x6,0x14(%esp)
  80b692:	00 
  80b693:	0f b6 46 0a          	movzbl 0xa(%esi),%eax
  80b697:	89 44 24 10          	mov    %eax,0x10(%esp)
  80b69b:	0f b6 46 0b          	movzbl 0xb(%esi),%eax
  80b69f:	89 44 24 0c          	mov    %eax,0xc(%esp)
  80b6a3:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80b6a6:	89 44 24 08          	mov    %eax,0x8(%esp)
  80b6aa:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80b6ad:	89 54 24 04          	mov    %edx,0x4(%esp)
  80b6b1:	8b 43 04             	mov    0x4(%ebx),%eax
  80b6b4:	89 04 24             	mov    %eax,(%esp)
  80b6b7:	e8 81 e4 ff ff       	call   809b3d <ip_output>
      TCPH_SET_FLAG(seg->tcphdr, TCP_ACK);
      pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
    }

    tcp_output_segment(seg, pcb);
    pcb->snd_nxt = ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg);
  80b6bc:	8b 43 10             	mov    0x10(%ebx),%eax
  80b6bf:	8b 40 04             	mov    0x4(%eax),%eax
  80b6c2:	89 04 24             	mov    %eax,(%esp)
  80b6c5:	e8 6b f8 ff ff       	call   80af35 <ntohl>
  80b6ca:	89 45 dc             	mov    %eax,-0x24(%ebp)
  80b6cd:	0f b7 7b 0c          	movzwl 0xc(%ebx),%edi
  80b6d1:	8b 43 10             	mov    0x10(%ebx),%eax
  80b6d4:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  80b6d8:	89 04 24             	mov    %eax,(%esp)
  80b6db:	e8 20 f6 ff ff       	call   80ad00 <ntohs>
  80b6e0:	a8 01                	test   $0x1,%al
  80b6e2:	75 1b                	jne    80b6ff <tcp_output+0x384>
  80b6e4:	8b 43 10             	mov    0x10(%ebx),%eax
  80b6e7:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  80b6eb:	89 04 24             	mov    %eax,(%esp)
  80b6ee:	e8 0d f6 ff ff       	call   80ad00 <ntohs>
  80b6f3:	89 c2                	mov    %eax,%edx
  80b6f5:	b8 00 00 00 00       	mov    $0x0,%eax
  80b6fa:	f6 c2 02             	test   $0x2,%dl
  80b6fd:	74 05                	je     80b704 <tcp_output+0x389>
  80b6ff:	b8 01 00 00 00       	mov    $0x1,%eax
  80b704:	0f b7 ff             	movzwl %di,%edi
  80b707:	8d 3c 38             	lea    (%eax,%edi,1),%edi
  80b70a:	03 7d dc             	add    -0x24(%ebp),%edi
  80b70d:	89 7e 54             	mov    %edi,0x54(%esi)
    if (TCP_SEQ_LT(pcb->snd_max, pcb->snd_nxt)) {
  80b710:	39 7e 58             	cmp    %edi,0x58(%esi)
  80b713:	79 03                	jns    80b718 <tcp_output+0x39d>
      pcb->snd_max = pcb->snd_nxt;
  80b715:	89 7e 58             	mov    %edi,0x58(%esi)
    }
    /* put segment on unacknowledged list if length > 0 */
    if (TCP_TCPLEN(seg) > 0) {
  80b718:	0f b7 7b 0c          	movzwl 0xc(%ebx),%edi
  80b71c:	8b 43 10             	mov    0x10(%ebx),%eax
  80b71f:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  80b723:	89 04 24             	mov    %eax,(%esp)
  80b726:	e8 d5 f5 ff ff       	call   80ad00 <ntohs>
  80b72b:	a8 01                	test   $0x1,%al
  80b72d:	75 18                	jne    80b747 <tcp_output+0x3cc>
  80b72f:	8b 43 10             	mov    0x10(%ebx),%eax
  80b732:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  80b736:	89 04 24             	mov    %eax,(%esp)
  80b739:	e8 c2 f5 ff ff       	call   80ad00 <ntohs>
  80b73e:	ba 00 00 00 00       	mov    $0x0,%edx
  80b743:	a8 02                	test   $0x2,%al
  80b745:	74 05                	je     80b74c <tcp_output+0x3d1>
  80b747:	ba 01 00 00 00       	mov    $0x1,%edx
  80b74c:	0f b7 ff             	movzwl %di,%edi
  80b74f:	01 fa                	add    %edi,%edx
  80b751:	74 4d                	je     80b7a0 <tcp_output+0x425>
      seg->next = NULL;
  80b753:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
      /* unacked list is empty? */
      if (pcb->unacked == NULL) {
  80b759:	83 7e 78 00          	cmpl   $0x0,0x78(%esi)
  80b75d:	75 08                	jne    80b767 <tcp_output+0x3ec>
        pcb->unacked = seg;
  80b75f:	89 5e 78             	mov    %ebx,0x78(%esi)
  80b762:	89 5d d8             	mov    %ebx,-0x28(%ebp)
  80b765:	eb 41                	jmp    80b7a8 <tcp_output+0x42d>
      /* unacked list is not empty? */
      } else {
        /* In the case of fast retransmit, the packet should not go to the tail
         * of the unacked queue, but rather at the head. We need to check for
         * this case. -STJ Jul 27, 2004 */
        if (TCP_SEQ_LT(ntohl(seg->tcphdr->seqno), ntohl(useg->tcphdr->seqno))){
  80b767:	8b 43 10             	mov    0x10(%ebx),%eax
  80b76a:	8b 40 04             	mov    0x4(%eax),%eax
  80b76d:	89 04 24             	mov    %eax,(%esp)
  80b770:	e8 c0 f7 ff ff       	call   80af35 <ntohl>
  80b775:	89 c7                	mov    %eax,%edi
  80b777:	8b 55 d8             	mov    -0x28(%ebp),%edx
  80b77a:	8b 42 10             	mov    0x10(%edx),%eax
  80b77d:	8b 40 04             	mov    0x4(%eax),%eax
  80b780:	89 04 24             	mov    %eax,(%esp)
  80b783:	e8 ad f7 ff ff       	call   80af35 <ntohl>
  80b788:	39 c7                	cmp    %eax,%edi
  80b78a:	79 0a                	jns    80b796 <tcp_output+0x41b>
          /* add segment to head of unacked list */
          seg->next = pcb->unacked;
  80b78c:	8b 46 78             	mov    0x78(%esi),%eax
  80b78f:	89 03                	mov    %eax,(%ebx)
          pcb->unacked = seg;
  80b791:	89 5e 78             	mov    %ebx,0x78(%esi)
  80b794:	eb 12                	jmp    80b7a8 <tcp_output+0x42d>
        } else {
          /* add segment to tail of unacked list */
          useg->next = seg;
  80b796:	8b 45 d8             	mov    -0x28(%ebp),%eax
  80b799:	89 18                	mov    %ebx,(%eax)
  80b79b:	89 5d d8             	mov    %ebx,-0x28(%ebp)
  80b79e:	eb 08                	jmp    80b7a8 <tcp_output+0x42d>
          useg = useg->next;
        }
      }
    /* do not queue empty segments on the unacked list */
    } else {
      tcp_seg_free(seg);
  80b7a0:	89 1c 24             	mov    %ebx,(%esp)
  80b7a3:	e8 c9 d2 ff ff       	call   808a71 <tcp_seg_free>
    }
    seg = pcb->unsent;
  80b7a8:	8b 5e 74             	mov    0x74(%esi),%ebx
                 ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len,
                 ntohl(seg->tcphdr->seqno), pcb->lastack));
  }
#endif /* TCP_CWND_DEBUG */
  /* data available and window allows it to be sent? */
  while (seg != NULL &&
  80b7ab:	85 db                	test   %ebx,%ebx
  80b7ad:	74 5e                	je     80b80d <tcp_output+0x492>
         ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len <= wnd) {
  80b7af:	8b 43 10             	mov    0x10(%ebx),%eax
  80b7b2:	8b 40 04             	mov    0x4(%eax),%eax
  80b7b5:	89 04 24             	mov    %eax,(%esp)
  80b7b8:	e8 78 f7 ff ff       	call   80af35 <ntohl>
  80b7bd:	0f b7 53 0c          	movzwl 0xc(%ebx),%edx
  80b7c1:	2b 56 48             	sub    0x48(%esi),%edx
  80b7c4:	8d 04 02             	lea    (%edx,%eax,1),%eax
  80b7c7:	39 45 d4             	cmp    %eax,-0x2c(%ebp)
  80b7ca:	0f 83 66 fd ff ff    	jae    80b536 <tcp_output+0x1bb>
      tcp_seg_free(seg);
    }
    seg = pcb->unsent;
  }

  if (seg != NULL && pcb->persist_backoff == 0 && 
  80b7d0:	85 db                	test   %ebx,%ebx
  80b7d2:	74 39                	je     80b80d <tcp_output+0x492>
  80b7d4:	80 be a4 00 00 00 00 	cmpb   $0x0,0xa4(%esi)
  80b7db:	75 30                	jne    80b80d <tcp_output+0x492>
      ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len > pcb->snd_wnd) {
  80b7dd:	8b 43 10             	mov    0x10(%ebx),%eax
  80b7e0:	8b 40 04             	mov    0x4(%eax),%eax
  80b7e3:	89 04 24             	mov    %eax,(%esp)
  80b7e6:	e8 4a f7 ff ff       	call   80af35 <ntohl>
  80b7eb:	0f b7 53 0c          	movzwl 0xc(%ebx),%edx
  80b7ef:	2b 56 48             	sub    0x48(%esi),%edx
  80b7f2:	01 c2                	add    %eax,%edx
  80b7f4:	0f b7 46 5c          	movzwl 0x5c(%esi),%eax
  80b7f8:	39 c2                	cmp    %eax,%edx
  80b7fa:	76 11                	jbe    80b80d <tcp_output+0x492>
    /* prepare for persist timer */
    pcb->persist_cnt = 0;
  80b7fc:	c7 86 a0 00 00 00 00 	movl   $0x0,0xa0(%esi)
  80b803:	00 00 00 
    pcb->persist_backoff = 1;
  80b806:	c6 86 a4 00 00 00 01 	movb   $0x1,0xa4(%esi)
  }

  pcb->flags &= ~TF_NAGLEMEMERR;
  80b80d:	80 66 20 7f          	andb   $0x7f,0x20(%esi)
  80b811:	b8 00 00 00 00       	mov    $0x0,%eax
  return ERR_OK;
}
  80b816:	83 c4 4c             	add    $0x4c,%esp
  80b819:	5b                   	pop    %ebx
  80b81a:	5e                   	pop    %esi
  80b81b:	5f                   	pop    %edi
  80b81c:	5d                   	pop    %ebp
  80b81d:	c3                   	ret    
     * - if tcp_enqueue had a memory error before (prevent delayed ACK timeout) or
     * - if FIN was already enqueued for this PCB (SYN is always alone in a segment -
     *   either seg->next != NULL or pcb->unacked == NULL;
     *   RST is no sent using tcp_enqueue/tcp_output.
     */
    if((tcp_do_output_nagle(pcb) == 0) &&
  80b81e:	a8 a0                	test   $0xa0,%al
  80b820:	0f 85 61 fd ff ff    	jne    80b587 <tcp_output+0x20c>
  80b826:	eb a8                	jmp    80b7d0 <tcp_output+0x455>

0080b828 <tcp_rexmit>:
 *
 * @param pcb the tcp_pcb for which to retransmit the first unacked segment
 */
void
tcp_rexmit(struct tcp_pcb *pcb)
{
  80b828:	55                   	push   %ebp
  80b829:	89 e5                	mov    %esp,%ebp
  80b82b:	53                   	push   %ebx
  80b82c:	83 ec 14             	sub    $0x14,%esp
  80b82f:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct tcp_seg *seg;

  if (pcb->unacked == NULL) {
  80b832:	8b 43 78             	mov    0x78(%ebx),%eax
  80b835:	85 c0                	test   %eax,%eax
  80b837:	74 34                	je     80b86d <tcp_rexmit+0x45>
    return;
  }

  /* Move the first unacked segment to the unsent queue */
  seg = pcb->unacked->next;
  80b839:	8b 10                	mov    (%eax),%edx
  pcb->unacked->next = pcb->unsent;
  80b83b:	8b 4b 74             	mov    0x74(%ebx),%ecx
  80b83e:	89 08                	mov    %ecx,(%eax)
  pcb->unsent = pcb->unacked;
  80b840:	8b 43 78             	mov    0x78(%ebx),%eax
  80b843:	89 43 74             	mov    %eax,0x74(%ebx)
  pcb->unacked = seg;
  80b846:	89 53 78             	mov    %edx,0x78(%ebx)

  pcb->snd_nxt = ntohl(pcb->unsent->tcphdr->seqno);
  80b849:	8b 40 10             	mov    0x10(%eax),%eax
  80b84c:	8b 40 04             	mov    0x4(%eax),%eax
  80b84f:	89 04 24             	mov    %eax,(%esp)
  80b852:	e8 de f6 ff ff       	call   80af35 <ntohl>
  80b857:	89 43 54             	mov    %eax,0x54(%ebx)

  ++pcb->nrtx;
  80b85a:	80 43 46 01          	addb   $0x1,0x46(%ebx)

  /* Don't take any rtt measurements after retransmitting. */
  pcb->rttest = 0;
  80b85e:	c7 43 38 00 00 00 00 	movl   $0x0,0x38(%ebx)

  /* Do the actual retransmission. */
  snmp_inc_tcpretranssegs();
  tcp_output(pcb);
  80b865:	89 1c 24             	mov    %ebx,(%esp)
  80b868:	e8 0e fb ff ff       	call   80b37b <tcp_output>
}
  80b86d:	83 c4 14             	add    $0x14,%esp
  80b870:	5b                   	pop    %ebx
  80b871:	5d                   	pop    %ebp
  80b872:	c3                   	ret    

0080b873 <tcp_rexmit_rto>:
 *
 * @param pcb the tcp_pcb for which to re-enqueue all unacked segments
 */
void
tcp_rexmit_rto(struct tcp_pcb *pcb)
{
  80b873:	55                   	push   %ebp
  80b874:	89 e5                	mov    %esp,%ebp
  80b876:	53                   	push   %ebx
  80b877:	83 ec 14             	sub    $0x14,%esp
  80b87a:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct tcp_seg *seg;

  if (pcb->unacked == NULL) {
  80b87d:	8b 43 78             	mov    0x78(%ebx),%eax
  80b880:	85 c0                	test   %eax,%eax
  80b882:	74 3e                	je     80b8c2 <tcp_rexmit_rto+0x4f>
    return;
  }

  /* Move all unacked segments to the head of the unsent queue */
  for (seg = pcb->unacked; seg->next != NULL; seg = seg->next);
  80b884:	89 c2                	mov    %eax,%edx
  80b886:	8b 00                	mov    (%eax),%eax
  80b888:	85 c0                	test   %eax,%eax
  80b88a:	75 f8                	jne    80b884 <tcp_rexmit_rto+0x11>
  /* concatenate unsent queue after unacked queue */
  seg->next = pcb->unsent;
  80b88c:	8b 43 74             	mov    0x74(%ebx),%eax
  80b88f:	89 02                	mov    %eax,(%edx)
  /* unsent queue is the concatenated queue (of unacked, unsent) */
  pcb->unsent = pcb->unacked;
  80b891:	8b 43 78             	mov    0x78(%ebx),%eax
  80b894:	89 43 74             	mov    %eax,0x74(%ebx)
  /* unacked queue is now empty */
  pcb->unacked = NULL;
  80b897:	c7 43 78 00 00 00 00 	movl   $0x0,0x78(%ebx)

  pcb->snd_nxt = ntohl(pcb->unsent->tcphdr->seqno);
  80b89e:	8b 40 10             	mov    0x10(%eax),%eax
  80b8a1:	8b 40 04             	mov    0x4(%eax),%eax
  80b8a4:	89 04 24             	mov    %eax,(%esp)
  80b8a7:	e8 89 f6 ff ff       	call   80af35 <ntohl>
  80b8ac:	89 43 54             	mov    %eax,0x54(%ebx)
  /* increment number of retransmissions */
  ++pcb->nrtx;
  80b8af:	80 43 46 01          	addb   $0x1,0x46(%ebx)

  /* Don't take any RTT measurements after retransmitting. */
  pcb->rttest = 0;
  80b8b3:	c7 43 38 00 00 00 00 	movl   $0x0,0x38(%ebx)

  /* Do the actual retransmission */
  tcp_output(pcb);
  80b8ba:	89 1c 24             	mov    %ebx,(%esp)
  80b8bd:	e8 b9 fa ff ff       	call   80b37b <tcp_output>
}
  80b8c2:	83 c4 14             	add    $0x14,%esp
  80b8c5:	5b                   	pop    %ebx
  80b8c6:	5d                   	pop    %ebp
  80b8c7:	c3                   	ret    

0080b8c8 <tcp_enqueue>:
 */
err_t
tcp_enqueue(struct tcp_pcb *pcb, void *arg, u16_t len,
  u8_t flags, u8_t apiflags,
  u8_t *optdata, u8_t optlen)
{
  80b8c8:	55                   	push   %ebp
  80b8c9:	89 e5                	mov    %esp,%ebp
  80b8cb:	57                   	push   %edi
  80b8cc:	56                   	push   %esi
  80b8cd:	53                   	push   %ebx
  80b8ce:	83 ec 6c             	sub    $0x6c,%esp
  80b8d1:	8b 7d 08             	mov    0x8(%ebp),%edi
  80b8d4:	8b 55 0c             	mov    0xc(%ebp),%edx
  80b8d7:	0f b7 45 10          	movzwl 0x10(%ebp),%eax
  80b8db:	66 89 45 b6          	mov    %ax,-0x4a(%ebp)
  80b8df:	0f b6 4d 14          	movzbl 0x14(%ebp),%ecx
  80b8e3:	88 4d af             	mov    %cl,-0x51(%ebp)
  80b8e6:	0f b6 45 18          	movzbl 0x18(%ebp),%eax
  80b8ea:	88 45 98             	mov    %al,-0x68(%ebp)
  80b8ed:	0f b6 45 20          	movzbl 0x20(%ebp),%eax
  void *ptr;
  u16_t queuelen;

  LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_enqueue(pcb=%p, arg=%p, len=%"U16_F", flags=%"X16_F", apiflags=%"U16_F")\n",
    (void *)pcb, arg, len, (u16_t)flags, (u16_t)apiflags));
  LWIP_ERROR("tcp_enqueue: len == 0 || optlen == 0 (programmer violates API)",
  80b8f1:	66 83 7d b6 00       	cmpw   $0x0,-0x4a(%ebp)
  80b8f6:	74 20                	je     80b918 <tcp_enqueue+0x50>
  80b8f8:	84 c0                	test   %al,%al
  80b8fa:	74 1c                	je     80b918 <tcp_enqueue+0x50>
  80b8fc:	c7 44 24 08 74 3e 81 	movl   $0x813e74,0x8(%esp)
  80b903:	00 
  80b904:	c7 44 24 04 90 00 00 	movl   $0x90,0x4(%esp)
  80b90b:	00 
  80b90c:	c7 04 24 e8 3f 81 00 	movl   $0x813fe8,(%esp)
  80b913:	e8 84 50 ff ff       	call   80099c <_panic>
      ((len == 0) || (optlen == 0)), return ERR_ARG;);
  LWIP_ERROR("tcp_enqueue: arg == NULL || optdata == NULL (programmer violates API)",
  80b918:	85 d2                	test   %edx,%edx
  80b91a:	0f 95 45 b5          	setne  -0x4b(%ebp)
  80b91e:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
  80b922:	0f 95 45 bf          	setne  -0x41(%ebp)
  80b926:	80 7d b5 00          	cmpb   $0x0,-0x4b(%ebp)
  80b92a:	74 22                	je     80b94e <tcp_enqueue+0x86>
  80b92c:	80 7d bf 00          	cmpb   $0x0,-0x41(%ebp)
  80b930:	74 1c                	je     80b94e <tcp_enqueue+0x86>
  80b932:	c7 44 24 08 b4 3e 81 	movl   $0x813eb4,0x8(%esp)
  80b939:	00 
  80b93a:	c7 44 24 04 92 00 00 	movl   $0x92,0x4(%esp)
  80b941:	00 
  80b942:	c7 04 24 e8 3f 81 00 	movl   $0x813fe8,(%esp)
  80b949:	e8 4e 50 ff ff       	call   80099c <_panic>
      ((arg == NULL) || (optdata == NULL)), return ERR_ARG;);
  /* fail on too much data */
  if (len > pcb->snd_buf) {
  80b94e:	0f b7 4d b6          	movzwl -0x4a(%ebp),%ecx
  80b952:	66 3b 4f 6e          	cmp    0x6e(%edi),%cx
  80b956:	76 0e                	jbe    80b966 <tcp_enqueue+0x9e>
    LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 3, ("tcp_enqueue: too much data (len=%"U16_F" > snd_buf=%"U16_F")\n", len, pcb->snd_buf));
    pcb->flags |= TF_NAGLEMEMERR;
  80b958:	80 4f 20 80          	orb    $0x80,0x20(%edi)
  80b95c:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
    return ERR_MEM;
  80b961:	e9 34 06 00 00       	jmp    80bf9a <tcp_enqueue+0x6d2>
  left = len;
  ptr = arg;

  /* seqno will be the sequence number of the first segment enqueued
   * by the call to this function. */
  seqno = pcb->snd_lbb;
  80b966:	8b 4f 68             	mov    0x68(%edi),%ecx
  80b969:	89 4d cc             	mov    %ecx,-0x34(%ebp)

  LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_enqueue: queuelen: %"U16_F"\n", (u16_t)pcb->snd_queuelen));

  /* If total number of pbufs on the unsent/unacked queues exceeds the
   * configured maximum, return an error */
  queuelen = pcb->snd_queuelen;
  80b96c:	0f b7 4f 70          	movzwl 0x70(%edi),%ecx
  80b970:	66 89 4d d6          	mov    %cx,-0x2a(%ebp)
  /* check for configured max queuelen and possible overflow */
  if ((queuelen >= TCP_SND_QUEUELEN) || (queuelen > TCP_SNDQUEUELEN_OVERFLOW)) {
  80b974:	66 83 f9 1f          	cmp    $0x1f,%cx
  80b978:	76 0e                	jbe    80b988 <tcp_enqueue+0xc0>
    LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 3, ("tcp_enqueue: too long queue %"U16_F" (max %"U16_F")\n", queuelen, TCP_SND_QUEUELEN));
    TCP_STATS_INC(tcp.memerr);
    pcb->flags |= TF_NAGLEMEMERR;
  80b97a:	80 4f 20 80          	orb    $0x80,0x20(%edi)
  80b97e:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
    return ERR_MEM;
  80b983:	e9 12 06 00 00       	jmp    80bf9a <tcp_enqueue+0x6d2>
  }
  if (queuelen != 0) {
  80b988:	66 83 7d d6 00       	cmpw   $0x0,-0x2a(%ebp)
  80b98d:	74 76                	je     80ba05 <tcp_enqueue+0x13d>
    LWIP_ASSERT("tcp_enqueue: pbufs on queue => at least one queue non-empty",
  80b98f:	83 7f 78 00          	cmpl   $0x0,0x78(%edi)
  80b993:	74 4e                	je     80b9e3 <tcp_enqueue+0x11b>
    /* Copy the options into the header, if they are present. */
    if (optdata == NULL) {
      TCPH_HDRLEN_SET(seg->tcphdr, 5);
    }
    else {
      TCPH_HDRLEN_SET(seg->tcphdr, (5 + optlen / 4));
  80b995:	89 c1                	mov    %eax,%ecx
  80b997:	c0 e9 02             	shr    $0x2,%cl
  80b99a:	c1 e1 0c             	shl    $0xc,%ecx
  80b99d:	66 81 c1 00 50       	add    $0x5000,%cx
  80b9a2:	66 89 4d ba          	mov    %cx,-0x46(%ebp)
  80b9a6:	89 55 c4             	mov    %edx,-0x3c(%ebp)
  80b9a9:	0f b7 55 b6          	movzwl -0x4a(%ebp),%edx
  80b9ad:	66 89 55 d8          	mov    %dx,-0x28(%ebp)
  80b9b1:	c7 45 c8 00 00 00 00 	movl   $0x0,-0x38(%ebp)
  80b9b8:	bb 00 00 00 00       	mov    $0x0,%ebx
                  (seg->p->len >= optlen));
      queuelen += pbuf_clen(seg->p);
      seg->dataptr = seg->p->payload;
    }
    /* copy from volatile memory? */
    else if (apiflags & TCP_WRITE_FLAG_COPY) {
  80b9bd:	0f b6 4d 98          	movzbl -0x68(%ebp),%ecx
  80b9c1:	83 e1 01             	and    $0x1,%ecx
  80b9c4:	89 4d b0             	mov    %ecx,-0x50(%ebp)
     * ROM or other static memory, and need not be copied. If
     * optdata is != NULL, we have options instead of data. */
     
    /* options? */
    if (optdata != NULL) {
      if ((seg->p = pbuf_alloc(PBUF_TRANSPORT, optlen, PBUF_RAM)) == NULL) {
  80b9c7:	0f b6 d0             	movzbl %al,%edx
  80b9ca:	89 55 c0             	mov    %edx,-0x40(%ebp)
        goto memerr;
      }
      LWIP_ASSERT("check that first pbuf can hold optlen",
  80b9cd:	0f b6 c0             	movzbl %al,%eax
  80b9d0:	66 89 45 b8          	mov    %ax,-0x48(%ebp)
    seg->tcphdr = seg->p->payload;
    seg->tcphdr->src = htons(pcb->local_port);
    seg->tcphdr->dest = htons(pcb->remote_port);
    seg->tcphdr->seqno = htonl(seqno);
    seg->tcphdr->urgp = 0;
    TCPH_FLAGS_SET(seg->tcphdr, flags);
  80b9d4:	0f b6 4d af          	movzbl -0x51(%ebp),%ecx
  80b9d8:	66 89 4d bc          	mov    %cx,-0x44(%ebp)
  80b9dc:	89 7d d0             	mov    %edi,-0x30(%ebp)
  80b9df:	89 df                	mov    %ebx,%edi
  80b9e1:	eb 55                	jmp    80ba38 <tcp_enqueue+0x170>
    TCP_STATS_INC(tcp.memerr);
    pcb->flags |= TF_NAGLEMEMERR;
    return ERR_MEM;
  }
  if (queuelen != 0) {
    LWIP_ASSERT("tcp_enqueue: pbufs on queue => at least one queue non-empty",
  80b9e3:	83 7f 74 00          	cmpl   $0x0,0x74(%edi)
  80b9e7:	75 ac                	jne    80b995 <tcp_enqueue+0xcd>
  80b9e9:	c7 44 24 08 fc 3e 81 	movl   $0x813efc,0x8(%esp)
  80b9f0:	00 
  80b9f1:	c7 44 24 04 ae 00 00 	movl   $0xae,0x4(%esp)
  80b9f8:	00 
  80b9f9:	c7 04 24 e8 3f 81 00 	movl   $0x813fe8,(%esp)
  80ba00:	e8 97 4f ff ff       	call   80099c <_panic>
      pcb->unacked != NULL || pcb->unsent != NULL);
  } else {
    LWIP_ASSERT("tcp_enqueue: no pbufs on queue => both queues empty",
  80ba05:	83 7f 78 00          	cmpl   $0x0,0x78(%edi)
  80ba09:	75 06                	jne    80ba11 <tcp_enqueue+0x149>
  80ba0b:	83 7f 74 00          	cmpl   $0x0,0x74(%edi)
  80ba0f:	74 84                	je     80b995 <tcp_enqueue+0xcd>
  80ba11:	c7 44 24 08 38 3f 81 	movl   $0x813f38,0x8(%esp)
  80ba18:	00 
  80ba19:	c7 44 24 04 b1 00 00 	movl   $0xb1,0x4(%esp)
  80ba20:	00 
  80ba21:	c7 04 24 e8 3f 81 00 	movl   $0x813fe8,(%esp)
  80ba28:	e8 6f 4f ff ff       	call   80099c <_panic>
      ntohl(seg->tcphdr->seqno),
      ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg),
      (u16_t)flags));

    left -= seglen;
    seqno += seglen;
  80ba2d:	0f b7 f6             	movzwl %si,%esi
  80ba30:	01 75 cc             	add    %esi,-0x34(%ebp)
    ptr = (void *)((u8_t *)ptr + seglen);
  80ba33:	01 75 c4             	add    %esi,-0x3c(%ebp)
  80ba36:	89 df                	mov    %ebx,%edi
  seglen = 0;
  while (queue == NULL || left > 0) {

    /* The segment length should be the MSS if the data to be enqueued
     * is larger than the MSS. */
    seglen = left > pcb->mss? pcb->mss: left;
  80ba38:	8b 45 d0             	mov    -0x30(%ebp),%eax
  80ba3b:	0f b7 70 34          	movzwl 0x34(%eax),%esi

    /* Allocate memory for tcp_seg, and fill in fields. */
    seg = memp_malloc(MEMP_TCP_SEG);
  80ba3f:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
  80ba46:	e8 6d bd ff ff       	call   8077b8 <memp_malloc>
  80ba4b:	89 c3                	mov    %eax,%ebx
    if (seg == NULL) {
  80ba4d:	85 c0                	test   %eax,%eax
  80ba4f:	0f 84 d2 04 00 00    	je     80bf27 <tcp_enqueue+0x65f>
      LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_enqueue: could not allocate memory for tcp_seg\n"));
      goto memerr;
    }
    seg->next = NULL;
  80ba55:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
    seg->p = NULL;
  80ba5b:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)

    /* first segment of to-be-queued data? */
    if (queue == NULL) {
  80ba62:	83 7d c8 00          	cmpl   $0x0,-0x38(%ebp)
  80ba66:	75 05                	jne    80ba6d <tcp_enqueue+0x1a5>
  80ba68:	89 45 c8             	mov    %eax,-0x38(%ebp)
  80ba6b:	eb 22                	jmp    80ba8f <tcp_enqueue+0x1c7>
      queue = seg;
    }
    /* subsequent segments of to-be-queued data */
    else {
      /* Attach the segment to the end of the queued segments */
      LWIP_ASSERT("useg != NULL", useg != NULL);
  80ba6d:	85 ff                	test   %edi,%edi
  80ba6f:	75 1c                	jne    80ba8d <tcp_enqueue+0x1c5>
  80ba71:	c7 44 24 08 17 40 81 	movl   $0x814017,0x8(%esp)
  80ba78:	00 
  80ba79:	c7 44 24 04 ce 00 00 	movl   $0xce,0x4(%esp)
  80ba80:	00 
  80ba81:	c7 04 24 e8 3f 81 00 	movl   $0x813fe8,(%esp)
  80ba88:	e8 0f 4f ff ff       	call   80099c <_panic>
      useg->next = seg;
  80ba8d:	89 07                	mov    %eax,(%edi)
  seglen = 0;
  while (queue == NULL || left > 0) {

    /* The segment length should be the MSS if the data to be enqueued
     * is larger than the MSS. */
    seglen = left > pcb->mss? pcb->mss: left;
  80ba8f:	66 39 75 d8          	cmp    %si,-0x28(%ebp)
  80ba93:	0f b7 55 d8          	movzwl -0x28(%ebp),%edx
  80ba97:	0f 46 f2             	cmovbe %edx,%esi
     * and data copied into pbuf, otherwise data comes from
     * ROM or other static memory, and need not be copied. If
     * optdata is != NULL, we have options instead of data. */
     
    /* options? */
    if (optdata != NULL) {
  80ba9a:	80 7d bf 00          	cmpb   $0x0,-0x41(%ebp)
  80ba9e:	74 69                	je     80bb09 <tcp_enqueue+0x241>
      if ((seg->p = pbuf_alloc(PBUF_TRANSPORT, optlen, PBUF_RAM)) == NULL) {
  80baa0:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80baa7:	00 
  80baa8:	8b 4d c0             	mov    -0x40(%ebp),%ecx
  80baab:	89 4c 24 04          	mov    %ecx,0x4(%esp)
  80baaf:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80bab6:	e8 fe c6 ff ff       	call   8081b9 <pbuf_alloc>
  80babb:	89 43 04             	mov    %eax,0x4(%ebx)
  80babe:	85 c0                	test   %eax,%eax
  80bac0:	0f 84 66 04 00 00    	je     80bf2c <tcp_enqueue+0x664>
        goto memerr;
      }
      LWIP_ASSERT("check that first pbuf can hold optlen",
  80bac6:	0f b7 55 b8          	movzwl -0x48(%ebp),%edx
  80baca:	66 39 50 0a          	cmp    %dx,0xa(%eax)
  80bace:	73 1c                	jae    80baec <tcp_enqueue+0x224>
  80bad0:	c7 44 24 08 6c 3f 81 	movl   $0x813f6c,0x8(%esp)
  80bad7:	00 
  80bad8:	c7 44 24 04 df 00 00 	movl   $0xdf,0x4(%esp)
  80badf:	00 
  80bae0:	c7 04 24 e8 3f 81 00 	movl   $0x813fe8,(%esp)
  80bae7:	e8 b0 4e ff ff       	call   80099c <_panic>
                  (seg->p->len >= optlen));
      queuelen += pbuf_clen(seg->p);
  80baec:	89 04 24             	mov    %eax,(%esp)
  80baef:	e8 ac bf ff ff       	call   807aa0 <pbuf_clen>
  80baf4:	0f b6 c0             	movzbl %al,%eax
  80baf7:	66 01 45 d6          	add    %ax,-0x2a(%ebp)
      seg->dataptr = seg->p->payload;
  80bafb:	8b 43 04             	mov    0x4(%ebx),%eax
  80bafe:	8b 40 04             	mov    0x4(%eax),%eax
  80bb01:	89 43 08             	mov    %eax,0x8(%ebx)
  80bb04:	e9 1e 01 00 00       	jmp    80bc27 <tcp_enqueue+0x35f>
    }
    /* copy from volatile memory? */
    else if (apiflags & TCP_WRITE_FLAG_COPY) {
  80bb09:	83 7d b0 00          	cmpl   $0x0,-0x50(%ebp)
  80bb0d:	0f 84 8b 00 00 00    	je     80bb9e <tcp_enqueue+0x2d6>
      if ((seg->p = pbuf_alloc(PBUF_TRANSPORT, seglen, PBUF_RAM)) == NULL) {
  80bb13:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80bb1a:	00 
  80bb1b:	0f b7 c6             	movzwl %si,%eax
  80bb1e:	89 44 24 04          	mov    %eax,0x4(%esp)
  80bb22:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80bb29:	e8 8b c6 ff ff       	call   8081b9 <pbuf_alloc>
  80bb2e:	89 43 04             	mov    %eax,0x4(%ebx)
  80bb31:	85 c0                	test   %eax,%eax
  80bb33:	0f 84 f9 03 00 00    	je     80bf32 <tcp_enqueue+0x66a>
        LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_enqueue : could not allocate memory for pbuf copy size %"U16_F"\n", seglen));
        goto memerr;
      }
      LWIP_ASSERT("check that first pbuf can hold the complete seglen",
  80bb39:	66 3b 70 0a          	cmp    0xa(%eax),%si
  80bb3d:	76 1c                	jbe    80bb5b <tcp_enqueue+0x293>
  80bb3f:	c7 44 24 08 94 3f 81 	movl   $0x813f94,0x8(%esp)
  80bb46:	00 
  80bb47:	c7 44 24 04 ea 00 00 	movl   $0xea,0x4(%esp)
  80bb4e:	00 
  80bb4f:	c7 04 24 e8 3f 81 00 	movl   $0x813fe8,(%esp)
  80bb56:	e8 41 4e ff ff       	call   80099c <_panic>
                  (seg->p->len >= seglen));
      queuelen += pbuf_clen(seg->p);
  80bb5b:	89 04 24             	mov    %eax,(%esp)
  80bb5e:	e8 3d bf ff ff       	call   807aa0 <pbuf_clen>
  80bb63:	89 c7                	mov    %eax,%edi
      if (arg != NULL) {
  80bb65:	80 7d b5 00          	cmpb   $0x0,-0x4b(%ebp)
  80bb69:	74 1c                	je     80bb87 <tcp_enqueue+0x2bf>
        MEMCPY(seg->p->payload, ptr, seglen);
  80bb6b:	0f b7 c6             	movzwl %si,%eax
  80bb6e:	89 44 24 08          	mov    %eax,0x8(%esp)
  80bb72:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  80bb75:	89 4c 24 04          	mov    %ecx,0x4(%esp)
  80bb79:	8b 43 04             	mov    0x4(%ebx),%eax
  80bb7c:	8b 40 04             	mov    0x4(%eax),%eax
  80bb7f:	89 04 24             	mov    %eax,(%esp)
  80bb82:	e8 da 57 ff ff       	call   801361 <memcpy>
        LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_enqueue : could not allocate memory for pbuf copy size %"U16_F"\n", seglen));
        goto memerr;
      }
      LWIP_ASSERT("check that first pbuf can hold the complete seglen",
                  (seg->p->len >= seglen));
      queuelen += pbuf_clen(seg->p);
  80bb87:	89 fa                	mov    %edi,%edx
  80bb89:	0f b6 c2             	movzbl %dl,%eax
  80bb8c:	66 01 45 d6          	add    %ax,-0x2a(%ebp)
      if (arg != NULL) {
        MEMCPY(seg->p->payload, ptr, seglen);
      }
      seg->dataptr = seg->p->payload;
  80bb90:	8b 43 04             	mov    0x4(%ebx),%eax
  80bb93:	8b 40 04             	mov    0x4(%eax),%eax
  80bb96:	89 43 08             	mov    %eax,0x8(%ebx)
  80bb99:	e9 89 00 00 00       	jmp    80bc27 <tcp_enqueue+0x35f>
      /* First, allocate a pbuf for holding the data.
       * since the referenced data is available at least until it is sent out on the
       * link (as it has to be ACKed by the remote party) we can safely use PBUF_ROM
       * instead of PBUF_REF here.
       */
      if ((p = pbuf_alloc(PBUF_TRANSPORT, seglen, PBUF_ROM)) == NULL) {
  80bb9e:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
  80bba5:	00 
  80bba6:	0f b7 c6             	movzwl %si,%eax
  80bba9:	89 44 24 04          	mov    %eax,0x4(%esp)
  80bbad:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80bbb4:	e8 00 c6 ff ff       	call   8081b9 <pbuf_alloc>
  80bbb9:	89 c7                	mov    %eax,%edi
  80bbbb:	85 c0                	test   %eax,%eax
  80bbbd:	0f 84 74 03 00 00    	je     80bf37 <tcp_enqueue+0x66f>
        LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_enqueue: could not allocate memory for zero-copy pbuf\n"));
        goto memerr;
      }
      ++queuelen;
      /* reference the non-volatile payload data */
      p->payload = ptr;
  80bbc3:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  80bbc6:	89 48 04             	mov    %ecx,0x4(%eax)
      seg->dataptr = ptr;
  80bbc9:	89 4b 08             	mov    %ecx,0x8(%ebx)

      /* Second, allocate a pbuf for the headers. */
      if ((seg->p = pbuf_alloc(PBUF_TRANSPORT, 0, PBUF_RAM)) == NULL) {
  80bbcc:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80bbd3:	00 
  80bbd4:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80bbdb:	00 
  80bbdc:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80bbe3:	e8 d1 c5 ff ff       	call   8081b9 <pbuf_alloc>
  80bbe8:	89 43 04             	mov    %eax,0x4(%ebx)
  80bbeb:	85 c0                	test   %eax,%eax
  80bbed:	75 12                	jne    80bc01 <tcp_enqueue+0x339>
  80bbef:	89 fb                	mov    %edi,%ebx
  80bbf1:	8b 7d d0             	mov    -0x30(%ebp),%edi
        /* If allocation fails, we have to deallocate the data pbuf as
         * well. */
        pbuf_free(p);
  80bbf4:	89 1c 24             	mov    %ebx,(%esp)
  80bbf7:	e8 01 c3 ff ff       	call   807efd <pbuf_free>
        LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_enqueue: could not allocate memory for header pbuf\n"));
        goto memerr;
  80bbfc:	e9 44 03 00 00       	jmp    80bf45 <tcp_enqueue+0x67d>
      }
      queuelen += pbuf_clen(seg->p);
  80bc01:	89 04 24             	mov    %eax,(%esp)
  80bc04:	e8 97 be ff ff       	call   807aa0 <pbuf_clen>
  80bc09:	0f b6 c0             	movzbl %al,%eax
  80bc0c:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
  80bc10:	8d 44 02 01          	lea    0x1(%edx,%eax,1),%eax
  80bc14:	66 89 45 d6          	mov    %ax,-0x2a(%ebp)

      /* Concatenate the headers and data pbufs together. */
      pbuf_cat(seg->p/*header*/, p/*data*/);
  80bc18:	89 7c 24 04          	mov    %edi,0x4(%esp)
  80bc1c:	8b 43 04             	mov    0x4(%ebx),%eax
  80bc1f:	89 04 24             	mov    %eax,(%esp)
  80bc22:	e8 a4 be ff ff       	call   807acb <pbuf_cat>
      p = NULL;
    }

    /* Now that there are more segments queued, we check again if the
    length of the queue exceeds the configured maximum or overflows. */
    if ((queuelen > TCP_SND_QUEUELEN) || (queuelen > TCP_SNDQUEUELEN_OVERFLOW)) {
  80bc27:	66 83 7d d6 20       	cmpw   $0x20,-0x2a(%ebp)
  80bc2c:	0f 87 0a 03 00 00    	ja     80bf3c <tcp_enqueue+0x674>
      LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_enqueue: queue too long %"U16_F" (%"U16_F")\n", queuelen, TCP_SND_QUEUELEN));
      goto memerr;
    }

    seg->len = seglen;
  80bc32:	66 89 73 0c          	mov    %si,0xc(%ebx)

    /* build TCP header */
    if (pbuf_header(seg->p, TCP_HLEN)) {
  80bc36:	c7 44 24 04 14 00 00 	movl   $0x14,0x4(%esp)
  80bc3d:	00 
  80bc3e:	8b 43 04             	mov    0x4(%ebx),%eax
  80bc41:	89 04 24             	mov    %eax,(%esp)
  80bc44:	e8 4a bf ff ff       	call   807b93 <pbuf_header>
  80bc49:	84 c0                	test   %al,%al
  80bc4b:	0f 85 f1 02 00 00    	jne    80bf42 <tcp_enqueue+0x67a>
      LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_enqueue: no room for TCP header in pbuf.\n"));
      TCP_STATS_INC(tcp.err);
      goto memerr;
    }
    seg->tcphdr = seg->p->payload;
  80bc51:	8b 43 04             	mov    0x4(%ebx),%eax
  80bc54:	8b 78 04             	mov    0x4(%eax),%edi
  80bc57:	89 7b 10             	mov    %edi,0x10(%ebx)
    seg->tcphdr->src = htons(pcb->local_port);
  80bc5a:	8b 4d d0             	mov    -0x30(%ebp),%ecx
  80bc5d:	0f b7 41 1c          	movzwl 0x1c(%ecx),%eax
  80bc61:	89 04 24             	mov    %eax,(%esp)
  80bc64:	e8 8a f0 ff ff       	call   80acf3 <htons>
  80bc69:	66 89 07             	mov    %ax,(%edi)
    seg->tcphdr->dest = htons(pcb->remote_port);
  80bc6c:	8b 7b 10             	mov    0x10(%ebx),%edi
  80bc6f:	8b 55 d0             	mov    -0x30(%ebp),%edx
  80bc72:	0f b7 42 1e          	movzwl 0x1e(%edx),%eax
  80bc76:	89 04 24             	mov    %eax,(%esp)
  80bc79:	e8 75 f0 ff ff       	call   80acf3 <htons>
  80bc7e:	66 89 47 02          	mov    %ax,0x2(%edi)
    seg->tcphdr->seqno = htonl(seqno);
  80bc82:	8b 7b 10             	mov    0x10(%ebx),%edi
  80bc85:	8b 4d cc             	mov    -0x34(%ebp),%ecx
  80bc88:	89 0c 24             	mov    %ecx,(%esp)
  80bc8b:	e8 84 f0 ff ff       	call   80ad14 <htonl>
  80bc90:	89 47 04             	mov    %eax,0x4(%edi)
    seg->tcphdr->urgp = 0;
  80bc93:	8b 43 10             	mov    0x10(%ebx),%eax
  80bc96:	66 c7 40 12 00 00    	movw   $0x0,0x12(%eax)
    TCPH_FLAGS_SET(seg->tcphdr, flags);
  80bc9c:	8b 7b 10             	mov    0x10(%ebx),%edi
  80bc9f:	0f b7 47 0c          	movzwl 0xc(%edi),%eax
  80bca3:	89 04 24             	mov    %eax,(%esp)
  80bca6:	e8 55 f0 ff ff       	call   80ad00 <ntohs>
  80bcab:	83 e0 c0             	and    $0xffffffc0,%eax
  80bcae:	66 0b 45 bc          	or     -0x44(%ebp),%ax
  80bcb2:	0f b7 c0             	movzwl %ax,%eax
  80bcb5:	89 04 24             	mov    %eax,(%esp)
  80bcb8:	e8 36 f0 ff ff       	call   80acf3 <htons>
  80bcbd:	66 89 47 0c          	mov    %ax,0xc(%edi)
    /* don't fill in tcphdr->ackno and tcphdr->wnd until later */

    /* Copy the options into the header, if they are present. */
    if (optdata == NULL) {
  80bcc1:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
  80bcc5:	75 23                	jne    80bcea <tcp_enqueue+0x422>
      TCPH_HDRLEN_SET(seg->tcphdr, 5);
  80bcc7:	8b 7b 10             	mov    0x10(%ebx),%edi
  80bcca:	0f b7 47 0c          	movzwl 0xc(%edi),%eax
  80bcce:	89 04 24             	mov    %eax,(%esp)
  80bcd1:	e8 2a f0 ff ff       	call   80ad00 <ntohs>
  80bcd6:	83 e0 3f             	and    $0x3f,%eax
  80bcd9:	80 cc 50             	or     $0x50,%ah
  80bcdc:	89 04 24             	mov    %eax,(%esp)
  80bcdf:	e8 0f f0 ff ff       	call   80acf3 <htons>
  80bce4:	66 89 47 0c          	mov    %ax,0xc(%edi)
  80bce8:	eb 3e                	jmp    80bd28 <tcp_enqueue+0x460>
    }
    else {
      TCPH_HDRLEN_SET(seg->tcphdr, (5 + optlen / 4));
  80bcea:	8b 7b 10             	mov    0x10(%ebx),%edi
  80bced:	0f b7 47 0c          	movzwl 0xc(%edi),%eax
  80bcf1:	89 04 24             	mov    %eax,(%esp)
  80bcf4:	e8 07 f0 ff ff       	call   80ad00 <ntohs>
  80bcf9:	83 e0 3f             	and    $0x3f,%eax
  80bcfc:	66 0b 45 ba          	or     -0x46(%ebp),%ax
  80bd00:	0f b7 c0             	movzwl %ax,%eax
  80bd03:	89 04 24             	mov    %eax,(%esp)
  80bd06:	e8 e8 ef ff ff       	call   80acf3 <htons>
  80bd0b:	66 89 47 0c          	mov    %ax,0xc(%edi)
      /* Copy options into data portion of segment.
       Options can thus only be sent in non data carrying
       segments such as SYN|ACK. */
      SMEMCPY(seg->dataptr, optdata, optlen);
  80bd0f:	8b 45 c0             	mov    -0x40(%ebp),%eax
  80bd12:	89 44 24 08          	mov    %eax,0x8(%esp)
  80bd16:	8b 55 1c             	mov    0x1c(%ebp),%edx
  80bd19:	89 54 24 04          	mov    %edx,0x4(%esp)
  80bd1d:	8b 43 08             	mov    0x8(%ebx),%eax
  80bd20:	89 04 24             	mov    %eax,(%esp)
  80bd23:	e8 39 56 ff ff       	call   801361 <memcpy>
    LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_TRACE, ("tcp_enqueue: queueing %"U32_F":%"U32_F" (0x%"X16_F")\n",
      ntohl(seg->tcphdr->seqno),
      ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg),
      (u16_t)flags));

    left -= seglen;
  80bd28:	66 29 75 d8          	sub    %si,-0x28(%ebp)

  /* First, break up the data into segments and tuck them together in
   * the local "queue" variable. */
  useg = queue = seg = NULL;
  seglen = 0;
  while (queue == NULL || left > 0) {
  80bd2c:	83 7d c8 00          	cmpl   $0x0,-0x38(%ebp)
  80bd30:	0f 84 f7 fc ff ff    	je     80ba2d <tcp_enqueue+0x165>
  80bd36:	66 83 7d d8 00       	cmpw   $0x0,-0x28(%ebp)
  80bd3b:	0f 85 ec fc ff ff    	jne    80ba2d <tcp_enqueue+0x165>
  80bd41:	8b 7d d0             	mov    -0x30(%ebp),%edi
  80bd44:	89 5d cc             	mov    %ebx,-0x34(%ebp)
  }

  /* Now that the data to be enqueued has been broken up into TCP
  segments in the queue variable, we add them to the end of the
  pcb->unsent queue. */
  if (pcb->unsent == NULL) {
  80bd47:	8b 4f 74             	mov    0x74(%edi),%ecx
  80bd4a:	89 4d d8             	mov    %ecx,-0x28(%ebp)
  80bd4d:	85 c9                	test   %ecx,%ecx
  80bd4f:	0f 84 1c 01 00 00    	je     80be71 <tcp_enqueue+0x5a9>
  80bd55:	89 ca                	mov    %ecx,%edx
    useg = NULL;
  }
  else {
    for (useg = pcb->unsent; useg->next != NULL; useg = useg->next);
  80bd57:	89 d0                	mov    %edx,%eax
  80bd59:	8b 12                	mov    (%edx),%edx
  80bd5b:	85 d2                	test   %edx,%edx
  80bd5d:	75 f8                	jne    80bd57 <tcp_enqueue+0x48f>
  80bd5f:	89 45 d8             	mov    %eax,-0x28(%ebp)
  }
  /* { useg is last segment on the unsent queue, NULL if list is empty } */

  /* If there is room in the last pbuf on the unsent queue,
  chain the first pbuf on the queue together with that. */
  if (useg != NULL &&
  80bd62:	85 c0                	test   %eax,%eax
  80bd64:	0f 84 07 01 00 00    	je     80be71 <tcp_enqueue+0x5a9>
    TCP_TCPLEN(useg) != 0 &&
  80bd6a:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  80bd6e:	66 89 45 d0          	mov    %ax,-0x30(%ebp)
  80bd72:	8b 55 d8             	mov    -0x28(%ebp),%edx
  80bd75:	8b 42 10             	mov    0x10(%edx),%eax
  80bd78:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  80bd7c:	89 04 24             	mov    %eax,(%esp)
  80bd7f:	e8 7c ef ff ff       	call   80ad00 <ntohs>
  80bd84:	a8 01                	test   $0x1,%al
  80bd86:	75 1b                	jne    80bda3 <tcp_enqueue+0x4db>
  80bd88:	8b 4d d8             	mov    -0x28(%ebp),%ecx
  80bd8b:	8b 41 10             	mov    0x10(%ecx),%eax
  80bd8e:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  80bd92:	89 04 24             	mov    %eax,(%esp)
  80bd95:	e8 66 ef ff ff       	call   80ad00 <ntohs>
  80bd9a:	ba 00 00 00 00       	mov    $0x0,%edx
  80bd9f:	a8 02                	test   $0x2,%al
  80bda1:	74 05                	je     80bda8 <tcp_enqueue+0x4e0>
  80bda3:	ba 01 00 00 00       	mov    $0x1,%edx
  }
  /* { useg is last segment on the unsent queue, NULL if list is empty } */

  /* If there is room in the last pbuf on the unsent queue,
  chain the first pbuf on the queue together with that. */
  if (useg != NULL &&
  80bda8:	0f b7 45 d0          	movzwl -0x30(%ebp),%eax
  80bdac:	01 c2                	add    %eax,%edx
  80bdae:	0f 84 ee 01 00 00    	je     80bfa2 <tcp_enqueue+0x6da>
    TCP_TCPLEN(useg) != 0 &&
    !(TCPH_FLAGS(useg->tcphdr) & (TCP_SYN | TCP_FIN)) &&
  80bdb4:	8b 55 d8             	mov    -0x28(%ebp),%edx
  80bdb7:	8b 42 10             	mov    0x10(%edx),%eax
  80bdba:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  80bdbe:	89 04 24             	mov    %eax,(%esp)
  80bdc1:	e8 3a ef ff ff       	call   80ad00 <ntohs>
  }
  /* { useg is last segment on the unsent queue, NULL if list is empty } */

  /* If there is room in the last pbuf on the unsent queue,
  chain the first pbuf on the queue together with that. */
  if (useg != NULL &&
  80bdc6:	a8 03                	test   $0x3,%al
  80bdc8:	0f 85 d4 01 00 00    	jne    80bfa2 <tcp_enqueue+0x6da>
  80bdce:	f6 45 af 03          	testb  $0x3,-0x51(%ebp)
  80bdd2:	0f 85 ca 01 00 00    	jne    80bfa2 <tcp_enqueue+0x6da>
    TCP_TCPLEN(useg) != 0 &&
    !(TCPH_FLAGS(useg->tcphdr) & (TCP_SYN | TCP_FIN)) &&
    !(flags & (TCP_SYN | TCP_FIN)) &&
    /* fit within max seg size */
    useg->len + queue->len <= pcb->mss) {
  80bdd8:	8b 4d c8             	mov    -0x38(%ebp),%ecx
  80bddb:	0f b7 51 0c          	movzwl 0xc(%ecx),%edx
  80bddf:	8b 4d d8             	mov    -0x28(%ebp),%ecx
  80bde2:	0f b7 41 0c          	movzwl 0xc(%ecx),%eax
  80bde6:	01 c2                	add    %eax,%edx
  80bde8:	0f b7 47 34          	movzwl 0x34(%edi),%eax
  80bdec:	39 c2                	cmp    %eax,%edx
  80bdee:	0f 8f ae 01 00 00    	jg     80bfa2 <tcp_enqueue+0x6da>
    /* Remove TCP header from first segment of our to-be-queued list */
    if(pbuf_header(queue->p, -TCP_HLEN)) {
  80bdf4:	c7 44 24 04 ec ff ff 	movl   $0xffffffec,0x4(%esp)
  80bdfb:	ff 
  80bdfc:	8b 55 c8             	mov    -0x38(%ebp),%edx
  80bdff:	8b 42 04             	mov    0x4(%edx),%eax
  80be02:	89 04 24             	mov    %eax,(%esp)
  80be05:	e8 89 bd ff ff       	call   807b93 <pbuf_header>
  80be0a:	84 c0                	test   %al,%al
  80be0c:	74 1c                	je     80be2a <tcp_enqueue+0x562>
      /* Can we cope with this failing?  Just assert for now */
      LWIP_ASSERT("pbuf_header failed\n", 0);
  80be0e:	c7 44 24 08 24 40 81 	movl   $0x814024,0x8(%esp)
  80be15:	00 
  80be16:	c7 44 24 04 52 01 00 	movl   $0x152,0x4(%esp)
  80be1d:	00 
  80be1e:	c7 04 24 e8 3f 81 00 	movl   $0x813fe8,(%esp)
  80be25:	e8 72 4b ff ff       	call   80099c <_panic>
      TCP_STATS_INC(tcp.err);
      goto memerr;
    }
    pbuf_cat(useg->p, queue->p);
  80be2a:	8b 4d c8             	mov    -0x38(%ebp),%ecx
  80be2d:	8b 41 04             	mov    0x4(%ecx),%eax
  80be30:	89 44 24 04          	mov    %eax,0x4(%esp)
  80be34:	8b 55 d8             	mov    -0x28(%ebp),%edx
  80be37:	8b 42 04             	mov    0x4(%edx),%eax
  80be3a:	89 04 24             	mov    %eax,(%esp)
  80be3d:	e8 89 bc ff ff       	call   807acb <pbuf_cat>
    useg->len += queue->len;
  80be42:	8b 4d c8             	mov    -0x38(%ebp),%ecx
  80be45:	0f b7 41 0c          	movzwl 0xc(%ecx),%eax
  80be49:	8b 55 d8             	mov    -0x28(%ebp),%edx
  80be4c:	66 01 42 0c          	add    %ax,0xc(%edx)
    useg->next = queue->next;
  80be50:	8b 01                	mov    (%ecx),%eax
  80be52:	89 02                	mov    %eax,(%edx)

    LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("tcp_enqueue: chaining segments, new len %"U16_F"\n", useg->len));
    if (seg == queue) {
  80be54:	39 4d cc             	cmp    %ecx,-0x34(%ebp)
  80be57:	b8 00 00 00 00       	mov    $0x0,%eax
  80be5c:	0f 44 d8             	cmove  %eax,%ebx
      seg = NULL;
    }
    memp_free(MEMP_TCP_SEG, queue);
  80be5f:	89 4c 24 04          	mov    %ecx,0x4(%esp)
  80be63:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
  80be6a:	e8 05 b9 ff ff       	call   807774 <memp_free>
  }
  /* { useg is last segment on the unsent queue, NULL if list is empty } */

  /* If there is room in the last pbuf on the unsent queue,
  chain the first pbuf on the queue together with that. */
  if (useg != NULL &&
  80be6f:	eb 06                	jmp    80be77 <tcp_enqueue+0x5af>
  }
  else {
    /* empty list */
    if (useg == NULL) {
      /* initialize list with this segment */
      pcb->unsent = queue;
  80be71:	8b 4d c8             	mov    -0x38(%ebp),%ecx
  80be74:	89 4f 74             	mov    %ecx,0x74(%edi)
    /* enqueue segment */
    else {
      useg->next = queue;
    }
  }
  if ((flags & TCP_SYN) || (flags & TCP_FIN)) {
  80be77:	f6 45 af 02          	testb  $0x2,-0x51(%ebp)
  80be7b:	75 0c                	jne    80be89 <tcp_enqueue+0x5c1>
  80be7d:	f6 45 af 01          	testb  $0x1,-0x51(%ebp)
  80be81:	0f 85 28 01 00 00    	jne    80bfaf <tcp_enqueue+0x6e7>
  80be87:	eb 0f                	jmp    80be98 <tcp_enqueue+0x5d0>
    ++len;
  80be89:	66 83 45 b6 01       	addw   $0x1,-0x4a(%ebp)
  }
  if (flags & TCP_FIN) {
  80be8e:	f6 45 af 01          	testb  $0x1,-0x51(%ebp)
  80be92:	74 04                	je     80be98 <tcp_enqueue+0x5d0>
    pcb->flags |= TF_FIN;
  80be94:	80 4f 20 20          	orb    $0x20,0x20(%edi)
  }
  pcb->snd_lbb += len;
  80be98:	0f b7 45 b6          	movzwl -0x4a(%ebp),%eax
  80be9c:	01 47 68             	add    %eax,0x68(%edi)

  pcb->snd_buf -= len;
  80be9f:	0f b7 45 b6          	movzwl -0x4a(%ebp),%eax
  80bea3:	66 29 47 6e          	sub    %ax,0x6e(%edi)

  /* update number of segments on the queues */
  pcb->snd_queuelen = queuelen;
  80bea7:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
  80beab:	66 89 57 70          	mov    %dx,0x70(%edi)
  LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_enqueue: %"S16_F" (after enqueued)\n", pcb->snd_queuelen));
  if (pcb->snd_queuelen != 0) {
  80beaf:	66 85 d2             	test   %dx,%dx
  80beb2:	74 28                	je     80bedc <tcp_enqueue+0x614>
    LWIP_ASSERT("tcp_enqueue: valid queue length",
  80beb4:	83 7f 78 00          	cmpl   $0x0,0x78(%edi)
  80beb8:	75 22                	jne    80bedc <tcp_enqueue+0x614>
  80beba:	83 7f 74 00          	cmpl   $0x0,0x74(%edi)
  80bebe:	75 1c                	jne    80bedc <tcp_enqueue+0x614>
  80bec0:	c7 44 24 08 c8 3f 81 	movl   $0x813fc8,0x8(%esp)
  80bec7:	00 
  80bec8:	c7 44 24 04 7a 01 00 	movl   $0x17a,0x4(%esp)
  80becf:	00 
  80bed0:	c7 04 24 e8 3f 81 00 	movl   $0x813fe8,(%esp)
  80bed7:	e8 c0 4a ff ff       	call   80099c <_panic>
      pcb->unacked != NULL || pcb->unsent != NULL);
  }

  /* Set the PSH flag in the last segment that we enqueued, but only
  if the segment has data (indicated by seglen > 0). */
  if (seg != NULL && seglen > 0 && seg->tcphdr != NULL && ((apiflags & TCP_WRITE_FLAG_MORE)==0)) {
  80bedc:	85 db                	test   %ebx,%ebx
  80bede:	0f 84 b1 00 00 00    	je     80bf95 <tcp_enqueue+0x6cd>
  80bee4:	66 85 f6             	test   %si,%si
  80bee7:	0f 84 a8 00 00 00    	je     80bf95 <tcp_enqueue+0x6cd>
  80beed:	8b 5b 10             	mov    0x10(%ebx),%ebx
  80bef0:	85 db                	test   %ebx,%ebx
  80bef2:	0f 84 9d 00 00 00    	je     80bf95 <tcp_enqueue+0x6cd>
  80bef8:	f6 45 98 02          	testb  $0x2,-0x68(%ebp)
  80befc:	0f 85 93 00 00 00    	jne    80bf95 <tcp_enqueue+0x6cd>
    TCPH_SET_FLAG(seg->tcphdr, TCP_PSH);
  80bf02:	0f b7 43 0c          	movzwl 0xc(%ebx),%eax
  80bf06:	89 04 24             	mov    %eax,(%esp)
  80bf09:	e8 f2 ed ff ff       	call   80ad00 <ntohs>
  80bf0e:	83 c8 08             	or     $0x8,%eax
  80bf11:	0f b7 c0             	movzwl %ax,%eax
  80bf14:	89 04 24             	mov    %eax,(%esp)
  80bf17:	e8 d7 ed ff ff       	call   80acf3 <htons>
  80bf1c:	66 89 43 0c          	mov    %ax,0xc(%ebx)
  80bf20:	b8 00 00 00 00       	mov    $0x0,%eax
  80bf25:	eb 73                	jmp    80bf9a <tcp_enqueue+0x6d2>
  80bf27:	8b 7d d0             	mov    -0x30(%ebp),%edi
  80bf2a:	eb 19                	jmp    80bf45 <tcp_enqueue+0x67d>
  80bf2c:	8b 7d d0             	mov    -0x30(%ebp),%edi
  80bf2f:	90                   	nop
  80bf30:	eb 13                	jmp    80bf45 <tcp_enqueue+0x67d>
  80bf32:	8b 7d d0             	mov    -0x30(%ebp),%edi
  80bf35:	eb 0e                	jmp    80bf45 <tcp_enqueue+0x67d>
  80bf37:	8b 7d d0             	mov    -0x30(%ebp),%edi
  80bf3a:	eb 09                	jmp    80bf45 <tcp_enqueue+0x67d>
  80bf3c:	8b 7d d0             	mov    -0x30(%ebp),%edi
  80bf3f:	90                   	nop
  80bf40:	eb 03                	jmp    80bf45 <tcp_enqueue+0x67d>
  80bf42:	8b 7d d0             	mov    -0x30(%ebp),%edi
  }

  return ERR_OK;
memerr:
  pcb->flags |= TF_NAGLEMEMERR;
  80bf45:	80 4f 20 80          	orb    $0x80,0x20(%edi)
  TCP_STATS_INC(tcp.memerr);

  if (queue != NULL) {
  80bf49:	83 7d c8 00          	cmpl   $0x0,-0x38(%ebp)
  80bf4d:	74 0b                	je     80bf5a <tcp_enqueue+0x692>
    tcp_segs_free(queue);
  80bf4f:	8b 4d c8             	mov    -0x38(%ebp),%ecx
  80bf52:	89 0c 24             	mov    %ecx,(%esp)
  80bf55:	e8 5c cb ff ff       	call   808ab6 <tcp_segs_free>
  }
  if (pcb->snd_queuelen != 0) {
  80bf5a:	66 83 7f 70 00       	cmpw   $0x0,0x70(%edi)
  80bf5f:	74 2d                	je     80bf8e <tcp_enqueue+0x6c6>
    LWIP_ASSERT("tcp_enqueue: valid queue length", pcb->unacked != NULL ||
  80bf61:	83 7f 78 00          	cmpl   $0x0,0x78(%edi)
  80bf65:	75 27                	jne    80bf8e <tcp_enqueue+0x6c6>
  80bf67:	83 7f 74 00          	cmpl   $0x0,0x74(%edi)
  80bf6b:	90                   	nop
  80bf6c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  80bf70:	75 1c                	jne    80bf8e <tcp_enqueue+0x6c6>
  80bf72:	c7 44 24 08 c8 3f 81 	movl   $0x813fc8,0x8(%esp)
  80bf79:	00 
  80bf7a:	c7 44 24 04 8d 01 00 	movl   $0x18d,0x4(%esp)
  80bf81:	00 
  80bf82:	c7 04 24 e8 3f 81 00 	movl   $0x813fe8,(%esp)
  80bf89:	e8 0e 4a ff ff       	call   80099c <_panic>
  80bf8e:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  80bf93:	eb 05                	jmp    80bf9a <tcp_enqueue+0x6d2>
  80bf95:	b8 00 00 00 00       	mov    $0x0,%eax
      pcb->unsent != NULL);
  }
  LWIP_DEBUGF(TCP_QLEN_DEBUG | LWIP_DBG_STATE, ("tcp_enqueue: %"S16_F" (with mem err)\n", pcb->snd_queuelen));
  return ERR_MEM;
}
  80bf9a:	83 c4 6c             	add    $0x6c,%esp
  80bf9d:	5b                   	pop    %ebx
  80bf9e:	5e                   	pop    %esi
  80bf9f:	5f                   	pop    %edi
  80bfa0:	5d                   	pop    %ebp
  80bfa1:	c3                   	ret    
      /* initialize list with this segment */
      pcb->unsent = queue;
    }
    /* enqueue segment */
    else {
      useg->next = queue;
  80bfa2:	8b 55 c8             	mov    -0x38(%ebp),%edx
  80bfa5:	8b 45 d8             	mov    -0x28(%ebp),%eax
  80bfa8:	89 10                	mov    %edx,(%eax)
  80bfaa:	e9 c8 fe ff ff       	jmp    80be77 <tcp_enqueue+0x5af>
    }
  }
  if ((flags & TCP_SYN) || (flags & TCP_FIN)) {
    ++len;
  80bfaf:	66 83 45 b6 01       	addw   $0x1,-0x4a(%ebp)
  80bfb4:	e9 db fe ff ff       	jmp    80be94 <tcp_enqueue+0x5cc>

0080bfb9 <tcp_write>:
 * 
 * @see tcp_write()
 */
err_t
tcp_write(struct tcp_pcb *pcb, const void *data, u16_t len, u8_t apiflags)
{
  80bfb9:	55                   	push   %ebp
  80bfba:	89 e5                	mov    %esp,%ebp
  80bfbc:	83 ec 28             	sub    $0x28,%esp
  80bfbf:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  80bfc2:	89 75 fc             	mov    %esi,-0x4(%ebp)
  80bfc5:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80bfc8:	0f b7 5d 10          	movzwl 0x10(%ebp),%ebx
  80bfcc:	0f b6 75 14          	movzbl 0x14(%ebp),%esi
  LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_write(pcb=%p, data=%p, len=%"U16_F", apiflags=%"U16_F")\n", (void *)pcb,
    data, len, (u16_t)apiflags));
  /* connection is in valid state for data transmission? */
  if (pcb->state == ESTABLISHED ||
     pcb->state == CLOSE_WAIT ||
  80bfd0:	8b 51 10             	mov    0x10(%ecx),%edx
tcp_write(struct tcp_pcb *pcb, const void *data, u16_t len, u8_t apiflags)
{
  LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_write(pcb=%p, data=%p, len=%"U16_F", apiflags=%"U16_F")\n", (void *)pcb,
    data, len, (u16_t)apiflags));
  /* connection is in valid state for data transmission? */
  if (pcb->state == ESTABLISHED ||
  80bfd3:	83 fa 04             	cmp    $0x4,%edx
  80bfd6:	74 14                	je     80bfec <tcp_write+0x33>
  80bfd8:	83 fa 07             	cmp    $0x7,%edx
  80bfdb:	74 0f                	je     80bfec <tcp_write+0x33>
  80bfdd:	83 fa 02             	cmp    $0x2,%edx
  80bfe0:	74 0a                	je     80bfec <tcp_write+0x33>
  80bfe2:	b8 f8 ff ff ff       	mov    $0xfffffff8,%eax
  80bfe7:	83 fa 03             	cmp    $0x3,%edx
  80bfea:	75 42                	jne    80c02e <tcp_write+0x75>
     pcb->state == CLOSE_WAIT ||
     pcb->state == SYN_SENT ||
     pcb->state == SYN_RCVD) {
    if (len > 0) {
  80bfec:	b8 00 00 00 00       	mov    $0x0,%eax
  80bff1:	66 85 db             	test   %bx,%bx
  80bff4:	74 38                	je     80c02e <tcp_write+0x75>
      return tcp_enqueue(pcb, (void *)data, len, 0, apiflags, NULL, 0);
  80bff6:	c7 44 24 18 00 00 00 	movl   $0x0,0x18(%esp)
  80bffd:	00 
  80bffe:	c7 44 24 14 00 00 00 	movl   $0x0,0x14(%esp)
  80c005:	00 
  80c006:	81 e6 ff 00 00 00    	and    $0xff,%esi
  80c00c:	89 74 24 10          	mov    %esi,0x10(%esp)
  80c010:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  80c017:	00 
  80c018:	0f b7 db             	movzwl %bx,%ebx
  80c01b:	89 5c 24 08          	mov    %ebx,0x8(%esp)
  80c01f:	8b 45 0c             	mov    0xc(%ebp),%eax
  80c022:	89 44 24 04          	mov    %eax,0x4(%esp)
  80c026:	89 0c 24             	mov    %ecx,(%esp)
  80c029:	e8 9a f8 ff ff       	call   80b8c8 <tcp_enqueue>
    return ERR_OK;
  } else {
    LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_STATE | 3, ("tcp_write() called in invalid state\n"));
    return ERR_CONN;
  }
}
  80c02e:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  80c031:	8b 75 fc             	mov    -0x4(%ebp),%esi
  80c034:	89 ec                	mov    %ebp,%esp
  80c036:	5d                   	pop    %ebp
  80c037:	c3                   	ret    

0080c038 <tcp_send_ctrl>:
 * @param flags the flags to set in the segment header
 * @return ERR_OK if sent, another err_t otherwise
 */
err_t
tcp_send_ctrl(struct tcp_pcb *pcb, u8_t flags)
{
  80c038:	55                   	push   %ebp
  80c039:	89 e5                	mov    %esp,%ebp
  80c03b:	83 ec 28             	sub    $0x28,%esp
  /* no data, no length, flags, copy=1, no optdata, no optdatalen */
  return tcp_enqueue(pcb, NULL, 0, flags, TCP_WRITE_FLAG_COPY, NULL, 0);
  80c03e:	c7 44 24 18 00 00 00 	movl   $0x0,0x18(%esp)
  80c045:	00 
  80c046:	c7 44 24 14 00 00 00 	movl   $0x0,0x14(%esp)
  80c04d:	00 
  80c04e:	c7 44 24 10 01 00 00 	movl   $0x1,0x10(%esp)
  80c055:	00 
  80c056:	0f b6 45 0c          	movzbl 0xc(%ebp),%eax
  80c05a:	89 44 24 0c          	mov    %eax,0xc(%esp)
  80c05e:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80c065:	00 
  80c066:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80c06d:	00 
  80c06e:	8b 45 08             	mov    0x8(%ebp),%eax
  80c071:	89 04 24             	mov    %eax,(%esp)
  80c074:	e8 4f f8 ff ff       	call   80b8c8 <tcp_enqueue>
}
  80c079:	c9                   	leave  
  80c07a:	c3                   	ret    
  80c07b:	00 00                	add    %al,(%eax)
  80c07d:	00 00                	add    %al,(%eax)
	...

0080c080 <udp_disconnect>:
 *
 * @param pcb the udp pcb to disconnect.
 */
void
udp_disconnect(struct udp_pcb *pcb)
{
  80c080:	55                   	push   %ebp
  80c081:	89 e5                	mov    %esp,%ebp
  80c083:	8b 45 08             	mov    0x8(%ebp),%eax
  /* reset remote address association */
  ip_addr_set(&pcb->remote_ip, IP_ADDR_ANY);
  80c086:	8b 15 a4 3c 81 00    	mov    0x813ca4,%edx
  80c08c:	89 50 04             	mov    %edx,0x4(%eax)
  pcb->remote_port = 0;
  80c08f:	66 c7 40 14 00 00    	movw   $0x0,0x14(%eax)
  /* mark PCB as unconnected */
  pcb->flags &= ~UDP_FLAGS_CONNECTED;
  80c095:	80 60 10 fb          	andb   $0xfb,0x10(%eax)
}
  80c099:	5d                   	pop    %ebp
  80c09a:	c3                   	ret    

0080c09b <udp_recv>:
void
udp_recv(struct udp_pcb *pcb,
         void (* recv)(void *arg, struct udp_pcb *upcb, struct pbuf *p,
                       struct ip_addr *addr, u16_t port),
         void *recv_arg)
{
  80c09b:	55                   	push   %ebp
  80c09c:	89 e5                	mov    %esp,%ebp
  80c09e:	8b 45 08             	mov    0x8(%ebp),%eax
  /* remember recv() callback and user data */
  pcb->recv = recv;
  80c0a1:	8b 55 0c             	mov    0xc(%ebp),%edx
  80c0a4:	89 50 18             	mov    %edx,0x18(%eax)
  pcb->recv_arg = recv_arg;
  80c0a7:	8b 55 10             	mov    0x10(%ebp),%edx
  80c0aa:	89 50 1c             	mov    %edx,0x1c(%eax)
}
  80c0ad:	5d                   	pop    %ebp
  80c0ae:	c3                   	ret    

0080c0af <udp_new>:
 *
 * @see udp_remove()
 */
struct udp_pcb *
udp_new(void)
{
  80c0af:	55                   	push   %ebp
  80c0b0:	89 e5                	mov    %esp,%ebp
  80c0b2:	53                   	push   %ebx
  80c0b3:	83 ec 14             	sub    $0x14,%esp
  struct udp_pcb *pcb;
  pcb = memp_malloc(MEMP_UDP_PCB);
  80c0b6:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  80c0bd:	e8 f6 b6 ff ff       	call   8077b8 <memp_malloc>
  80c0c2:	89 c3                	mov    %eax,%ebx
  /* could allocate UDP PCB? */
  if (pcb != NULL) {
  80c0c4:	85 c0                	test   %eax,%eax
  80c0c6:	74 1c                	je     80c0e4 <udp_new+0x35>
    /* UDP Lite: by initializing to all zeroes, chksum_len is set to 0
     * which means checksum is generated over the whole datagram per default
     * (recommended as default by RFC 3828). */
    /* initialize PCB to all zeroes */
    memset(pcb, 0, sizeof(struct udp_pcb));
  80c0c8:	c7 44 24 08 20 00 00 	movl   $0x20,0x8(%esp)
  80c0cf:	00 
  80c0d0:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80c0d7:	00 
  80c0d8:	89 04 24             	mov    %eax,(%esp)
  80c0db:	e8 a6 51 ff ff       	call   801286 <memset>
    pcb->ttl = UDP_TTL;
  80c0e0:	c6 43 0b ff          	movb   $0xff,0xb(%ebx)
  }
  return pcb;
}
  80c0e4:	89 d8                	mov    %ebx,%eax
  80c0e6:	83 c4 14             	add    $0x14,%esp
  80c0e9:	5b                   	pop    %ebx
  80c0ea:	5d                   	pop    %ebp
  80c0eb:	c3                   	ret    

0080c0ec <udp_remove>:
 *
 * @see udp_new()
 */
void
udp_remove(struct udp_pcb *pcb)
{
  80c0ec:	55                   	push   %ebp
  80c0ed:	89 e5                	mov    %esp,%ebp
  80c0ef:	83 ec 18             	sub    $0x18,%esp
  80c0f2:	8b 4d 08             	mov    0x8(%ebp),%ecx
  struct udp_pcb *pcb2;

  snmp_delete_udpidx_tree(pcb);
  /* pcb to be removed is first in list? */
  if (udp_pcbs == pcb) {
  80c0f5:	8b 15 20 f6 b3 00    	mov    0xb3f620,%edx
  80c0fb:	39 ca                	cmp    %ecx,%edx
  80c0fd:	74 06                	je     80c105 <udp_remove+0x19>
    /* make list start at 2nd pcb */
    udp_pcbs = udp_pcbs->next;
    /* pcb not 1st in list */
  } else
    for (pcb2 = udp_pcbs; pcb2 != NULL; pcb2 = pcb2->next) {
  80c0ff:	85 d2                	test   %edx,%edx
  80c101:	75 0e                	jne    80c111 <udp_remove+0x25>
  80c103:	eb 21                	jmp    80c126 <udp_remove+0x3a>

  snmp_delete_udpidx_tree(pcb);
  /* pcb to be removed is first in list? */
  if (udp_pcbs == pcb) {
    /* make list start at 2nd pcb */
    udp_pcbs = udp_pcbs->next;
  80c105:	8b 42 0c             	mov    0xc(%edx),%eax
  80c108:	a3 20 f6 b3 00       	mov    %eax,0xb3f620
  80c10d:	eb 17                	jmp    80c126 <udp_remove+0x3a>
  80c10f:	89 c2                	mov    %eax,%edx
    /* pcb not 1st in list */
  } else
    for (pcb2 = udp_pcbs; pcb2 != NULL; pcb2 = pcb2->next) {
      /* find pcb in udp_pcbs list */
      if (pcb2->next != NULL && pcb2->next == pcb) {
  80c111:	8b 42 0c             	mov    0xc(%edx),%eax
  80c114:	85 c0                	test   %eax,%eax
  80c116:	74 0e                	je     80c126 <udp_remove+0x3a>
  80c118:	39 c1                	cmp    %eax,%ecx
  80c11a:	75 f3                	jne    80c10f <udp_remove+0x23>
        /* remove pcb from list */
        pcb2->next = pcb->next;
  80c11c:	8b 41 0c             	mov    0xc(%ecx),%eax
  80c11f:	89 42 0c             	mov    %eax,0xc(%edx)
  if (udp_pcbs == pcb) {
    /* make list start at 2nd pcb */
    udp_pcbs = udp_pcbs->next;
    /* pcb not 1st in list */
  } else
    for (pcb2 = udp_pcbs; pcb2 != NULL; pcb2 = pcb2->next) {
  80c122:	85 c0                	test   %eax,%eax
  80c124:	75 e9                	jne    80c10f <udp_remove+0x23>
      if (pcb2->next != NULL && pcb2->next == pcb) {
        /* remove pcb from list */
        pcb2->next = pcb->next;
      }
    }
  memp_free(MEMP_UDP_PCB, pcb);
  80c126:	89 4c 24 04          	mov    %ecx,0x4(%esp)
  80c12a:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  80c131:	e8 3e b6 ff ff       	call   807774 <memp_free>
}
  80c136:	c9                   	leave  
  80c137:	c3                   	ret    

0080c138 <udp_bind>:
 *
 * @see udp_disconnect()
 */
err_t
udp_bind(struct udp_pcb *pcb, struct ip_addr *ipaddr, u16_t port)
{
  80c138:	55                   	push   %ebp
  80c139:	89 e5                	mov    %esp,%ebp
  80c13b:	57                   	push   %edi
  80c13c:	56                   	push   %esi
  80c13d:	53                   	push   %ebx
  80c13e:	83 ec 1c             	sub    $0x1c,%esp
  80c141:	8b 55 08             	mov    0x8(%ebp),%edx
  80c144:	8b 7d 0c             	mov    0xc(%ebp),%edi
  80c147:	0f b7 75 10          	movzwl 0x10(%ebp),%esi
  ip_addr_debug_print(UDP_DEBUG, ipaddr);
  LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | 3, (", port = %"U16_F")\n", port));

  rebind = 0;
  /* Check for double bind and rebind of the same pcb */
  for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
  80c14b:	a1 20 f6 b3 00       	mov    0xb3f620,%eax
  80c150:	b9 00 00 00 00       	mov    $0x0,%ecx
    /* is this UDP PCB already on active list? */
    if (pcb == ipcb) {
      /* pcb may occur at most once in active list */
      LWIP_ASSERT("rebind == 0", rebind == 0);
  80c155:	bb 01 00 00 00       	mov    $0x1,%ebx
  ip_addr_debug_print(UDP_DEBUG, ipaddr);
  LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | 3, (", port = %"U16_F")\n", port));

  rebind = 0;
  /* Check for double bind and rebind of the same pcb */
  for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
  80c15a:	85 c0                	test   %eax,%eax
  80c15c:	74 2d                	je     80c18b <udp_bind+0x53>
    /* is this UDP PCB already on active list? */
    if (pcb == ipcb) {
  80c15e:	39 c2                	cmp    %eax,%edx
  80c160:	75 22                	jne    80c184 <udp_bind+0x4c>
      /* pcb may occur at most once in active list */
      LWIP_ASSERT("rebind == 0", rebind == 0);
  80c162:	84 c9                	test   %cl,%cl
  80c164:	74 1c                	je     80c182 <udp_bind+0x4a>
  80c166:	c7 44 24 08 38 40 81 	movl   $0x814038,0x8(%esp)
  80c16d:	00 
  80c16e:	c7 44 24 04 41 02 00 	movl   $0x241,0x4(%esp)
  80c175:	00 
  80c176:	c7 04 24 44 40 81 00 	movl   $0x814044,(%esp)
  80c17d:	e8 1a 48 ff ff       	call   80099c <_panic>
  80c182:	89 d9                	mov    %ebx,%ecx
  ip_addr_debug_print(UDP_DEBUG, ipaddr);
  LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | 3, (", port = %"U16_F")\n", port));

  rebind = 0;
  /* Check for double bind and rebind of the same pcb */
  for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
  80c184:	8b 40 0c             	mov    0xc(%eax),%eax
  80c187:	85 c0                	test   %eax,%eax
  80c189:	75 d3                	jne    80c15e <udp_bind+0x26>
        return ERR_USE;
      }
#endif
  }

  ip_addr_set(&pcb->local_ip, ipaddr);
  80c18b:	b8 00 00 00 00       	mov    $0x0,%eax
  80c190:	85 ff                	test   %edi,%edi
  80c192:	74 02                	je     80c196 <udp_bind+0x5e>
  80c194:	8b 07                	mov    (%edi),%eax
  80c196:	89 02                	mov    %eax,(%edx)

  /* no port specified? */
  if (port == 0) {
  80c198:	66 85 f6             	test   %si,%si
  80c19b:	75 39                	jne    80c1d6 <udp_bind+0x9e>
#ifndef UDP_LOCAL_PORT_RANGE_START
#define UDP_LOCAL_PORT_RANGE_START 4096
#define UDP_LOCAL_PORT_RANGE_END   0x7fff
#endif
    port = UDP_LOCAL_PORT_RANGE_START;
    ipcb = udp_pcbs;
  80c19d:	8b 3d 20 f6 b3 00    	mov    0xb3f620,%edi
  80c1a3:	89 f8                	mov    %edi,%eax
  80c1a5:	be 00 10 00 00       	mov    $0x1000,%esi
    while ((ipcb != NULL) && (port != UDP_LOCAL_PORT_RANGE_END)) {
  80c1aa:	eb 13                	jmp    80c1bf <udp_bind+0x87>
      if (ipcb->local_port == port) {
  80c1ac:	0f b7 58 12          	movzwl 0x12(%eax),%ebx
  80c1b0:	66 39 f3             	cmp    %si,%bx
  80c1b3:	75 07                	jne    80c1bc <udp_bind+0x84>
        /* port is already used by another udp_pcb */
        port++;
  80c1b5:	8d 73 01             	lea    0x1(%ebx),%esi
  80c1b8:	89 f8                	mov    %edi,%eax
  80c1ba:	eb 03                	jmp    80c1bf <udp_bind+0x87>
        /* restart scanning all udp pcbs */
        ipcb = udp_pcbs;
      } else
        /* go on with next udp pcb */
        ipcb = ipcb->next;
  80c1bc:	8b 40 0c             	mov    0xc(%eax),%eax
#define UDP_LOCAL_PORT_RANGE_START 4096
#define UDP_LOCAL_PORT_RANGE_END   0x7fff
#endif
    port = UDP_LOCAL_PORT_RANGE_START;
    ipcb = udp_pcbs;
    while ((ipcb != NULL) && (port != UDP_LOCAL_PORT_RANGE_END)) {
  80c1bf:	85 c0                	test   %eax,%eax
  80c1c1:	0f 95 c3             	setne  %bl
  80c1c4:	74 07                	je     80c1cd <udp_bind+0x95>
  80c1c6:	66 81 fe ff 7f       	cmp    $0x7fff,%si
  80c1cb:	75 df                	jne    80c1ac <udp_bind+0x74>
        ipcb = udp_pcbs;
      } else
        /* go on with next udp pcb */
        ipcb = ipcb->next;
    }
    if (ipcb != NULL) {
  80c1cd:	b8 f5 ff ff ff       	mov    $0xfffffff5,%eax
  80c1d2:	84 db                	test   %bl,%bl
  80c1d4:	75 20                	jne    80c1f6 <udp_bind+0xbe>
      /* no more ports available in local range */
      LWIP_DEBUGF(UDP_DEBUG, ("udp_bind: out of free UDP ports\n"));
      return ERR_USE;
    }
  }
  pcb->local_port = port;
  80c1d6:	66 89 72 12          	mov    %si,0x12(%edx)
  snmp_insert_udpidx_tree(pcb);
  /* pcb not active yet? */
  if (rebind == 0) {
  80c1da:	b8 00 00 00 00       	mov    $0x0,%eax
  80c1df:	84 c9                	test   %cl,%cl
  80c1e1:	75 13                	jne    80c1f6 <udp_bind+0xbe>
    /* place the PCB on the active list if not already there */
    pcb->next = udp_pcbs;
  80c1e3:	a1 20 f6 b3 00       	mov    0xb3f620,%eax
  80c1e8:	89 42 0c             	mov    %eax,0xc(%edx)
    udp_pcbs = pcb;
  80c1eb:	89 15 20 f6 b3 00    	mov    %edx,0xb3f620
  80c1f1:	b8 00 00 00 00       	mov    $0x0,%eax
               (u16_t)(ntohl(pcb->local_ip.addr) >> 24 & 0xff),
               (u16_t)(ntohl(pcb->local_ip.addr) >> 16 & 0xff),
               (u16_t)(ntohl(pcb->local_ip.addr) >> 8 & 0xff),
               (u16_t)(ntohl(pcb->local_ip.addr) & 0xff), pcb->local_port));
  return ERR_OK;
}
  80c1f6:	83 c4 1c             	add    $0x1c,%esp
  80c1f9:	5b                   	pop    %ebx
  80c1fa:	5e                   	pop    %esi
  80c1fb:	5f                   	pop    %edi
  80c1fc:	5d                   	pop    %ebp
  80c1fd:	c3                   	ret    

0080c1fe <udp_connect>:
 *
 * @see udp_disconnect()
 */
err_t
udp_connect(struct udp_pcb *pcb, struct ip_addr *ipaddr, u16_t port)
{
  80c1fe:	55                   	push   %ebp
  80c1ff:	89 e5                	mov    %esp,%ebp
  80c201:	57                   	push   %edi
  80c202:	56                   	push   %esi
  80c203:	53                   	push   %ebx
  80c204:	83 ec 1c             	sub    $0x1c,%esp
  80c207:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80c20a:	8b 7d 0c             	mov    0xc(%ebp),%edi
  80c20d:	0f b7 75 10          	movzwl 0x10(%ebp),%esi
  struct udp_pcb *ipcb;

  if (pcb->local_port == 0) {
  80c211:	66 83 7b 12 00       	cmpw   $0x0,0x12(%ebx)
  80c216:	75 18                	jne    80c230 <udp_connect+0x32>
    err_t err = udp_bind(pcb, &pcb->local_ip, pcb->local_port);
  80c218:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80c21f:	00 
  80c220:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  80c224:	89 1c 24             	mov    %ebx,(%esp)
  80c227:	e8 0c ff ff ff       	call   80c138 <udp_bind>
    if (err != ERR_OK)
  80c22c:	84 c0                	test   %al,%al
  80c22e:	75 48                	jne    80c278 <udp_connect+0x7a>
      return err;
  }

  ip_addr_set(&pcb->remote_ip, ipaddr);
  80c230:	b8 00 00 00 00       	mov    $0x0,%eax
  80c235:	85 ff                	test   %edi,%edi
  80c237:	74 02                	je     80c23b <udp_connect+0x3d>
  80c239:	8b 07                	mov    (%edi),%eax
  80c23b:	89 43 04             	mov    %eax,0x4(%ebx)
  pcb->remote_port = port;
  80c23e:	66 89 73 14          	mov    %si,0x14(%ebx)
  pcb->flags |= UDP_FLAGS_CONNECTED;
  80c242:	80 4b 10 04          	orb    $0x4,0x10(%ebx)
               (u16_t)(ntohl(pcb->remote_ip.addr) >> 16 & 0xff),
               (u16_t)(ntohl(pcb->remote_ip.addr) >> 8 & 0xff),
               (u16_t)(ntohl(pcb->remote_ip.addr) & 0xff), pcb->remote_port));

  /* Insert UDP PCB into the list of active UDP PCBs. */
  for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
  80c246:	8b 15 20 f6 b3 00    	mov    0xb3f620,%edx
  80c24c:	85 d2                	test   %edx,%edx
  80c24e:	74 13                	je     80c263 <udp_connect+0x65>
    if (pcb == ipcb) {
  80c250:	89 d0                	mov    %edx,%eax
  80c252:	39 d3                	cmp    %edx,%ebx
  80c254:	75 06                	jne    80c25c <udp_connect+0x5e>
  80c256:	eb 1b                	jmp    80c273 <udp_connect+0x75>
  80c258:	39 c3                	cmp    %eax,%ebx
  80c25a:	74 17                	je     80c273 <udp_connect+0x75>
               (u16_t)(ntohl(pcb->remote_ip.addr) >> 16 & 0xff),
               (u16_t)(ntohl(pcb->remote_ip.addr) >> 8 & 0xff),
               (u16_t)(ntohl(pcb->remote_ip.addr) & 0xff), pcb->remote_port));

  /* Insert UDP PCB into the list of active UDP PCBs. */
  for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
  80c25c:	8b 40 0c             	mov    0xc(%eax),%eax
  80c25f:	85 c0                	test   %eax,%eax
  80c261:	75 f5                	jne    80c258 <udp_connect+0x5a>
      /* already on the list, just return */
      return ERR_OK;
    }
  }
  /* PCB not yet on the list, add PCB now */
  pcb->next = udp_pcbs;
  80c263:	89 53 0c             	mov    %edx,0xc(%ebx)
  udp_pcbs = pcb;
  80c266:	89 1d 20 f6 b3 00    	mov    %ebx,0xb3f620
  80c26c:	b8 00 00 00 00       	mov    $0x0,%eax
  return ERR_OK;
  80c271:	eb 05                	jmp    80c278 <udp_connect+0x7a>
  80c273:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80c278:	83 c4 1c             	add    $0x1c,%esp
  80c27b:	5b                   	pop    %ebx
  80c27c:	5e                   	pop    %esi
  80c27d:	5f                   	pop    %edi
  80c27e:	5d                   	pop    %ebp
  80c27f:	c3                   	ret    

0080c280 <udp_sendto_if>:
 * @see udp_disconnect() udp_send()
 */
err_t
udp_sendto_if(struct udp_pcb *pcb, struct pbuf *p,
  struct ip_addr *dst_ip, u16_t dst_port, struct netif *netif)
{
  80c280:	55                   	push   %ebp
  80c281:	89 e5                	mov    %esp,%ebp
  80c283:	57                   	push   %edi
  80c284:	56                   	push   %esi
  80c285:	53                   	push   %ebx
  80c286:	83 ec 3c             	sub    $0x3c,%esp
  80c289:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80c28c:	0f b7 45 14          	movzwl 0x14(%ebp),%eax
  80c290:	66 89 45 e4          	mov    %ax,-0x1c(%ebp)
  struct ip_addr *src_ip;
  err_t err;
  struct pbuf *q; /* q will be sent down the stack */

  /* if the PCB is not yet bound to a port, bind it here */
  if (pcb->local_port == 0) {
  80c294:	66 83 7b 12 00       	cmpw   $0x0,0x12(%ebx)
  80c299:	75 1e                	jne    80c2b9 <udp_sendto_if+0x39>
    LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | 2, ("udp_send: not yet bound to a port, binding now\n"));
    err = udp_bind(pcb, &pcb->local_ip, pcb->local_port);
  80c29b:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80c2a2:	00 
  80c2a3:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  80c2a7:	89 1c 24             	mov    %ebx,(%esp)
  80c2aa:	e8 89 fe ff ff       	call   80c138 <udp_bind>
  80c2af:	89 c7                	mov    %eax,%edi
    if (err != ERR_OK) {
  80c2b1:	84 c0                	test   %al,%al
  80c2b3:	0f 85 6b 01 00 00    	jne    80c424 <udp_sendto_if+0x1a4>
      return err;
    }
  }

  /* not enough space to add an UDP header to first pbuf in given p chain? */
  if (pbuf_header(p, UDP_HLEN)) {
  80c2b9:	c7 44 24 04 08 00 00 	movl   $0x8,0x4(%esp)
  80c2c0:	00 
  80c2c1:	8b 55 0c             	mov    0xc(%ebp),%edx
  80c2c4:	89 14 24             	mov    %edx,(%esp)
  80c2c7:	e8 c7 b8 ff ff       	call   807b93 <pbuf_header>
  80c2cc:	84 c0                	test   %al,%al
  80c2ce:	75 05                	jne    80c2d5 <udp_sendto_if+0x55>
  80c2d0:	8b 75 0c             	mov    0xc(%ebp),%esi
  80c2d3:	eb 3a                	jmp    80c30f <udp_sendto_if+0x8f>
    /* allocate header in a separate new pbuf */
    q = pbuf_alloc(PBUF_IP, UDP_HLEN, PBUF_RAM);
  80c2d5:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80c2dc:	00 
  80c2dd:	c7 44 24 04 08 00 00 	movl   $0x8,0x4(%esp)
  80c2e4:	00 
  80c2e5:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  80c2ec:	e8 c8 be ff ff       	call   8081b9 <pbuf_alloc>
  80c2f1:	89 c6                	mov    %eax,%esi
    /* new header pbuf could not be allocated? */
    if (q == NULL) {
  80c2f3:	bf ff ff ff ff       	mov    $0xffffffff,%edi
  80c2f8:	85 c0                	test   %eax,%eax
  80c2fa:	0f 84 24 01 00 00    	je     80c424 <udp_sendto_if+0x1a4>
      LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | 2, ("udp_send: could not allocate header\n"));
      return ERR_MEM;
    }
    /* chain header q in front of given pbuf p */
    pbuf_chain(q, p);
  80c300:	8b 45 0c             	mov    0xc(%ebp),%eax
  80c303:	89 44 24 04          	mov    %eax,0x4(%esp)
  80c307:	89 34 24             	mov    %esi,(%esp)
  80c30a:	e8 5d b8 ff ff       	call   807b6c <pbuf_chain>
    /* adding space for header within p succeeded */
    /* first pbuf q equals given pbuf */
    q = p;
    LWIP_DEBUGF(UDP_DEBUG, ("udp_send: added header in given pbuf %p\n", (void *)p));
  }
  LWIP_ASSERT("check that first pbuf can hold struct udp_hdr",
  80c30f:	66 83 7e 0a 07       	cmpw   $0x7,0xa(%esi)
  80c314:	77 1c                	ja     80c332 <udp_sendto_if+0xb2>
  80c316:	c7 44 24 08 6c 40 81 	movl   $0x81406c,0x8(%esp)
  80c31d:	00 
  80c31e:	c7 44 24 04 b2 01 00 	movl   $0x1b2,0x4(%esp)
  80c325:	00 
  80c326:	c7 04 24 44 40 81 00 	movl   $0x814044,(%esp)
  80c32d:	e8 6a 46 ff ff       	call   80099c <_panic>
              (q->len >= sizeof(struct udp_hdr)));
  /* q now represents the packet to be sent */
  udphdr = q->payload;
  80c332:	8b 7e 04             	mov    0x4(%esi),%edi
  udphdr->src = htons(pcb->local_port);
  80c335:	0f b7 43 12          	movzwl 0x12(%ebx),%eax
  80c339:	89 04 24             	mov    %eax,(%esp)
  80c33c:	e8 b2 e9 ff ff       	call   80acf3 <htons>
  80c341:	66 89 07             	mov    %ax,(%edi)
  udphdr->dest = htons(dst_port);
  80c344:	0f b7 45 e4          	movzwl -0x1c(%ebp),%eax
  80c348:	89 04 24             	mov    %eax,(%esp)
  80c34b:	e8 a3 e9 ff ff       	call   80acf3 <htons>
  80c350:	66 89 47 02          	mov    %ax,0x2(%edi)
  /* in UDP, 0 checksum means 'no checksum' */
  udphdr->chksum = 0x0000; 
  80c354:	66 c7 47 06 00 00    	movw   $0x0,0x6(%edi)

  /* PCB local address is IP_ANY_ADDR? */
  if (ip_addr_isany(&pcb->local_ip)) {
  80c35a:	89 5d e4             	mov    %ebx,-0x1c(%ebp)
  80c35d:	85 db                	test   %ebx,%ebx
  80c35f:	74 06                	je     80c367 <udp_sendto_if+0xe7>
  80c361:	8b 03                	mov    (%ebx),%eax
  80c363:	85 c0                	test   %eax,%eax
  80c365:	75 0b                	jne    80c372 <udp_sendto_if+0xf2>
    /* use outgoing network interface IP address as source address */
    src_ip = &(netif->ip_addr);
  80c367:	8b 55 18             	mov    0x18(%ebp),%edx
  80c36a:	83 c2 04             	add    $0x4,%edx
  80c36d:	89 55 e4             	mov    %edx,-0x1c(%ebp)
  udphdr->dest = htons(dst_port);
  /* in UDP, 0 checksum means 'no checksum' */
  udphdr->chksum = 0x0000; 

  /* PCB local address is IP_ANY_ADDR? */
  if (ip_addr_isany(&pcb->local_ip)) {
  80c370:	eb 23                	jmp    80c395 <udp_sendto_if+0x115>
    /* use outgoing network interface IP address as source address */
    src_ip = &(netif->ip_addr);
  } else {
    /* check if UDP PCB local IP address is correct
     * this could be an old address if netif->ip_addr has changed */
    if (!ip_addr_cmp(&(pcb->local_ip), &(netif->ip_addr))) {
  80c372:	8b 55 18             	mov    0x18(%ebp),%edx
  80c375:	3b 42 04             	cmp    0x4(%edx),%eax
  80c378:	74 1b                	je     80c395 <udp_sendto_if+0x115>
      /* local_ip doesn't match, drop the packet */
      if (q != p) {
  80c37a:	bf f7 ff ff ff       	mov    $0xfffffff7,%edi
  80c37f:	3b 75 0c             	cmp    0xc(%ebp),%esi
  80c382:	0f 84 9c 00 00 00    	je     80c424 <udp_sendto_if+0x1a4>
        /* free the header pbuf */
        pbuf_free(q);
  80c388:	89 34 24             	mov    %esi,(%esp)
  80c38b:	e8 6d bb ff ff       	call   807efd <pbuf_free>
  80c390:	e9 8f 00 00 00       	jmp    80c424 <udp_sendto_if+0x1a4>
#endif /* LWIP_NETIF_HWADDRHINT*/
  } else
#endif /* LWIP_UDPLITE */
  {      /* UDP */
    LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP packet length %"U16_F"\n", q->tot_len));
    udphdr->len = htons(q->tot_len);
  80c395:	0f b7 46 08          	movzwl 0x8(%esi),%eax
  80c399:	89 04 24             	mov    %eax,(%esp)
  80c39c:	e8 52 e9 ff ff       	call   80acf3 <htons>
  80c3a1:	66 89 47 04          	mov    %ax,0x4(%edi)
    /* calculate checksum */
#if CHECKSUM_GEN_UDP
    if ((pcb->flags & UDP_FLAGS_NOCHKSUM) == 0) {
  80c3a5:	f6 43 10 01          	testb  $0x1,0x10(%ebx)
  80c3a9:	75 35                	jne    80c3e0 <udp_sendto_if+0x160>
      udphdr->chksum = inet_chksum_pseudo(q, src_ip, dst_ip, IP_PROTO_UDP, q->tot_len);
  80c3ab:	0f b7 46 08          	movzwl 0x8(%esi),%eax
  80c3af:	89 44 24 10          	mov    %eax,0x10(%esp)
  80c3b3:	c7 44 24 0c 11 00 00 	movl   $0x11,0xc(%esp)
  80c3ba:	00 
  80c3bb:	8b 45 10             	mov    0x10(%ebp),%eax
  80c3be:	89 44 24 08          	mov    %eax,0x8(%esp)
  80c3c2:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80c3c5:	89 54 24 04          	mov    %edx,0x4(%esp)
  80c3c9:	89 34 24             	mov    %esi,(%esp)
  80c3cc:	e8 1f e6 ff ff       	call   80a9f0 <inet_chksum_pseudo>
      /* chksum zero must become 0xffff, as zero means 'no checksum' */
      if (udphdr->chksum == 0x0000) udphdr->chksum = 0xffff;
  80c3d1:	66 85 c0             	test   %ax,%ax
  80c3d4:	ba ff ff ff ff       	mov    $0xffffffff,%edx
  80c3d9:	0f 44 c2             	cmove  %edx,%eax
  80c3dc:	66 89 47 06          	mov    %ax,0x6(%edi)
    LWIP_DEBUGF(UDP_DEBUG, ("udp_send: ip_output_if (,,,,IP_PROTO_UDP,)\n"));
    /* output to IP */
#if LWIP_NETIF_HWADDRHINT
    netif->addr_hint = &(pcb->addr_hint);
#endif /* LWIP_NETIF_HWADDRHINT*/
    err = ip_output_if(q, src_ip, dst_ip, pcb->ttl, pcb->tos, IP_PROTO_UDP, netif);    
  80c3e0:	8b 45 18             	mov    0x18(%ebp),%eax
  80c3e3:	89 44 24 18          	mov    %eax,0x18(%esp)
  80c3e7:	c7 44 24 14 11 00 00 	movl   $0x11,0x14(%esp)
  80c3ee:	00 
  80c3ef:	0f b6 43 0a          	movzbl 0xa(%ebx),%eax
  80c3f3:	89 44 24 10          	mov    %eax,0x10(%esp)
  80c3f7:	0f b6 43 0b          	movzbl 0xb(%ebx),%eax
  80c3fb:	89 44 24 0c          	mov    %eax,0xc(%esp)
  80c3ff:	8b 55 10             	mov    0x10(%ebp),%edx
  80c402:	89 54 24 08          	mov    %edx,0x8(%esp)
  80c406:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80c409:	89 44 24 04          	mov    %eax,0x4(%esp)
  80c40d:	89 34 24             	mov    %esi,(%esp)
  80c410:	e8 1b d5 ff ff       	call   809930 <ip_output_if>
  80c415:	89 c7                	mov    %eax,%edi
  }
  /* TODO: must this be increased even if error occured? */
  snmp_inc_udpoutdatagrams();

  /* did we chain a separate header pbuf earlier? */
  if (q != p) {
  80c417:	3b 75 0c             	cmp    0xc(%ebp),%esi
  80c41a:	74 08                	je     80c424 <udp_sendto_if+0x1a4>
    /* free the header pbuf */
    pbuf_free(q);
  80c41c:	89 34 24             	mov    %esi,(%esp)
  80c41f:	e8 d9 ba ff ff       	call   807efd <pbuf_free>
    /* p is still referenced by the caller, and will live on */
  }

  UDP_STATS_INC(udp.xmit);
  return err;
}
  80c424:	89 f8                	mov    %edi,%eax
  80c426:	83 c4 3c             	add    $0x3c,%esp
  80c429:	5b                   	pop    %ebx
  80c42a:	5e                   	pop    %esi
  80c42b:	5f                   	pop    %edi
  80c42c:	5d                   	pop    %ebp
  80c42d:	c3                   	ret    

0080c42e <udp_sendto>:
 * @see udp_disconnect() udp_send()
 */
err_t
udp_sendto(struct udp_pcb *pcb, struct pbuf *p,
  struct ip_addr *dst_ip, u16_t dst_port)
{
  80c42e:	55                   	push   %ebp
  80c42f:	89 e5                	mov    %esp,%ebp
  80c431:	83 ec 28             	sub    $0x28,%esp
  80c434:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  80c437:	89 75 fc             	mov    %esi,-0x4(%ebp)
  80c43a:	8b 5d 10             	mov    0x10(%ebp),%ebx
  80c43d:	0f b7 75 14          	movzwl 0x14(%ebp),%esi

  /* find the outgoing network interface for this packet */
#if LWIP_IGMP
  netif = ip_route((ip_addr_ismulticast(dst_ip))?(&(pcb->multicast_ip)):(dst_ip));
#else
  netif = ip_route(dst_ip);
  80c441:	89 1c 24             	mov    %ebx,(%esp)
  80c444:	e8 98 d6 ff ff       	call   809ae1 <ip_route>
  80c449:	89 c2                	mov    %eax,%edx
#endif /* LWIP_IGMP */

  /* no outgoing network interface could be found? */
  if (netif == NULL) {
  80c44b:	b8 fc ff ff ff       	mov    $0xfffffffc,%eax
  80c450:	85 d2                	test   %edx,%edx
  80c452:	74 21                	je     80c475 <udp_sendto+0x47>
    LWIP_DEBUGF(UDP_DEBUG | 1, ("udp_send: No route to 0x%"X32_F"\n", dst_ip->addr));
    UDP_STATS_INC(udp.rterr);
    return ERR_RTE;
  }
  return udp_sendto_if(pcb, p, dst_ip, dst_port, netif);
  80c454:	89 54 24 10          	mov    %edx,0x10(%esp)
  80c458:	0f b7 f6             	movzwl %si,%esi
  80c45b:	89 74 24 0c          	mov    %esi,0xc(%esp)
  80c45f:	89 5c 24 08          	mov    %ebx,0x8(%esp)
  80c463:	8b 45 0c             	mov    0xc(%ebp),%eax
  80c466:	89 44 24 04          	mov    %eax,0x4(%esp)
  80c46a:	8b 45 08             	mov    0x8(%ebp),%eax
  80c46d:	89 04 24             	mov    %eax,(%esp)
  80c470:	e8 0b fe ff ff       	call   80c280 <udp_sendto_if>
}
  80c475:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  80c478:	8b 75 fc             	mov    -0x4(%ebp),%esi
  80c47b:	89 ec                	mov    %ebp,%esp
  80c47d:	5d                   	pop    %ebp
  80c47e:	c3                   	ret    

0080c47f <udp_send>:
 *
 * @see udp_disconnect() udp_sendto()
 */
err_t
udp_send(struct udp_pcb *pcb, struct pbuf *p)
{
  80c47f:	55                   	push   %ebp
  80c480:	89 e5                	mov    %esp,%ebp
  80c482:	83 ec 18             	sub    $0x18,%esp
  80c485:	8b 45 08             	mov    0x8(%ebp),%eax
  /* send to the packet using remote ip and port stored in the pcb */
  return udp_sendto(pcb, p, &pcb->remote_ip, pcb->remote_port);
  80c488:	0f b7 50 14          	movzwl 0x14(%eax),%edx
  80c48c:	89 54 24 0c          	mov    %edx,0xc(%esp)
  80c490:	8d 50 04             	lea    0x4(%eax),%edx
  80c493:	89 54 24 08          	mov    %edx,0x8(%esp)
  80c497:	8b 55 0c             	mov    0xc(%ebp),%edx
  80c49a:	89 54 24 04          	mov    %edx,0x4(%esp)
  80c49e:	89 04 24             	mov    %eax,(%esp)
  80c4a1:	e8 88 ff ff ff       	call   80c42e <udp_sendto>
}
  80c4a6:	c9                   	leave  
  80c4a7:	c3                   	ret    

0080c4a8 <udp_input>:
 * @param inp network interface on which the datagram was received.
 *
 */
void
udp_input(struct pbuf *p, struct netif *inp)
{
  80c4a8:	55                   	push   %ebp
  80c4a9:	89 e5                	mov    %esp,%ebp
  80c4ab:	57                   	push   %edi
  80c4ac:	56                   	push   %esi
  80c4ad:	53                   	push   %ebx
  80c4ae:	83 ec 4c             	sub    $0x4c,%esp

  PERF_START;

  UDP_STATS_INC(udp.recv);

  iphdr = p->payload;
  80c4b1:	8b 45 08             	mov    0x8(%ebp),%eax
  80c4b4:	8b 40 04             	mov    0x4(%eax),%eax
  80c4b7:	89 45 e4             	mov    %eax,-0x1c(%ebp)

  /* Check minimum length (IP header + UDP header)
   * and move payload pointer to UDP header */
  if (p->tot_len < (IPH_HL(iphdr) * 4 + UDP_HLEN) || pbuf_header(p, -(s16_t)(IPH_HL(iphdr) * 4))) {
  80c4ba:	8b 55 08             	mov    0x8(%ebp),%edx
  80c4bd:	0f b7 5a 08          	movzwl 0x8(%edx),%ebx
  80c4c1:	0f b7 00             	movzwl (%eax),%eax
  80c4c4:	89 04 24             	mov    %eax,(%esp)
  80c4c7:	e8 34 e8 ff ff       	call   80ad00 <ntohs>
  80c4cc:	0f b6 c4             	movzbl %ah,%eax
  80c4cf:	83 e0 0f             	and    $0xf,%eax
  80c4d2:	8d 04 85 08 00 00 00 	lea    0x8(,%eax,4),%eax
  80c4d9:	39 c3                	cmp    %eax,%ebx
  80c4db:	7c 2b                	jl     80c508 <udp_input+0x60>
  80c4dd:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80c4e0:	0f b7 02             	movzwl (%edx),%eax
  80c4e3:	89 04 24             	mov    %eax,(%esp)
  80c4e6:	e8 15 e8 ff ff       	call   80ad00 <ntohs>
  80c4eb:	66 c1 e8 06          	shr    $0x6,%ax
  80c4ef:	83 e0 3c             	and    $0x3c,%eax
  80c4f2:	f7 d8                	neg    %eax
  80c4f4:	98                   	cwtl   
  80c4f5:	89 44 24 04          	mov    %eax,0x4(%esp)
  80c4f9:	8b 45 08             	mov    0x8(%ebp),%eax
  80c4fc:	89 04 24             	mov    %eax,(%esp)
  80c4ff:	e8 8f b6 ff ff       	call   807b93 <pbuf_header>
  80c504:	84 c0                	test   %al,%al
  80c506:	74 10                	je     80c518 <udp_input+0x70>
    LWIP_DEBUGF(UDP_DEBUG,
                ("udp_input: short UDP datagram (%"U16_F" bytes) discarded\n", p->tot_len));
    UDP_STATS_INC(udp.lenerr);
    UDP_STATS_INC(udp.drop);
    snmp_inc_udpinerrors();
    pbuf_free(p);
  80c508:	8b 55 08             	mov    0x8(%ebp),%edx
  80c50b:	89 14 24             	mov    %edx,(%esp)
  80c50e:	e8 ea b9 ff ff       	call   807efd <pbuf_free>
    goto end;
  80c513:	e9 f1 02 00 00       	jmp    80c809 <udp_input+0x361>
  }

  udphdr = (struct udp_hdr *)p->payload;
  80c518:	8b 45 08             	mov    0x8(%ebp),%eax
  80c51b:	8b 40 04             	mov    0x4(%eax),%eax
  80c51e:	89 45 d8             	mov    %eax,-0x28(%ebp)

  LWIP_DEBUGF(UDP_DEBUG, ("udp_input: received datagram of length %"U16_F"\n", p->tot_len));

  /* convert src and dest ports to host byte order */
  src = ntohs(udphdr->src);
  80c521:	0f b7 00             	movzwl (%eax),%eax
  80c524:	89 04 24             	mov    %eax,(%esp)
  80c527:	e8 d4 e7 ff ff       	call   80ad00 <ntohs>
  80c52c:	66 89 45 de          	mov    %ax,-0x22(%ebp)
  dest = ntohs(udphdr->dest);
  80c530:	8b 55 d8             	mov    -0x28(%ebp),%edx
  80c533:	0f b7 42 02          	movzwl 0x2(%edx),%eax
  80c537:	89 04 24             	mov    %eax,(%esp)
  80c53a:	e8 c1 e7 ff ff       	call   80ad00 <ntohs>
  80c53f:	89 c6                	mov    %eax,%esi

#if LWIP_DHCP
  pcb = NULL;
  /* when LWIP_DHCP is active, packets to DHCP_CLIENT_PORT may only be processed by
     the dhcp module, no other UDP pcb may use the local UDP port DHCP_CLIENT_PORT */
  if (dest == DHCP_CLIENT_PORT) {
  80c541:	66 83 f8 44          	cmp    $0x44,%ax
  80c545:	75 49                	jne    80c590 <udp_input+0xe8>
    /* all packets for DHCP_CLIENT_PORT not coming from DHCP_SERVER_PORT are dropped! */
    if (src == DHCP_SERVER_PORT) {
  80c547:	66 83 7d de 43       	cmpw   $0x43,-0x22(%ebp)
  80c54c:	0f 85 f9 00 00 00    	jne    80c64b <udp_input+0x1a3>
      if ((inp->dhcp != NULL) && (inp->dhcp->pcb != NULL)) {
  80c552:	8b 55 0c             	mov    0xc(%ebp),%edx
  80c555:	8b 42 20             	mov    0x20(%edx),%eax
  80c558:	85 c0                	test   %eax,%eax
  80c55a:	0f 84 eb 00 00 00    	je     80c64b <udp_input+0x1a3>
  80c560:	8b 58 08             	mov    0x8(%eax),%ebx
  80c563:	85 db                	test   %ebx,%ebx
  80c565:	0f 84 e5 00 00 00    	je     80c650 <udp_input+0x1a8>
        /* accept the packe if 
           (- broadcast or directed to us) -> DHCP is link-layer-addressed, local ip is always ANY!
           - inp->dhcp->pcb->remote == ANY or iphdr->src */
        if ((ip_addr_isany(&inp->dhcp->pcb->remote_ip) ||
  80c56b:	83 fb fc             	cmp    $0xfffffffc,%ebx
  80c56e:	0f 84 ee 00 00 00    	je     80c662 <udp_input+0x1ba>
  80c574:	8b 43 04             	mov    0x4(%ebx),%eax
  80c577:	85 c0                	test   %eax,%eax
  80c579:	0f 84 e3 00 00 00    	je     80c662 <udp_input+0x1ba>
           ip_addr_cmp(&(inp->dhcp->pcb->remote_ip), &(iphdr->src)))) {
  80c57f:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80c582:	3b 42 0c             	cmp    0xc(%edx),%eax
  80c585:	0f 85 c0 00 00 00    	jne    80c64b <udp_input+0x1a3>
  80c58b:	e9 d2 00 00 00       	jmp    80c662 <udp_input+0x1ba>
    uncon_pcb = NULL;
    /* Iterate through the UDP pcb list for a matching pcb.
     * 'Perfect match' pcbs (connected to the remote port & ip address) are
     * preferred. If no perfect match is found, the first unconnected pcb that
     * matches the local port and ip address gets the datagram. */
    for (pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) {
  80c590:	8b 1d 20 f6 b3 00    	mov    0xb3f620,%ebx
  80c596:	85 db                	test   %ebx,%ebx
  80c598:	0f 84 5f 02 00 00    	je     80c7fd <udp_input+0x355>
          (ip_addr_isany(&pcb->local_ip) ||
           ip_addr_cmp(&(pcb->local_ip), &(iphdr->dest)) || 
#if LWIP_IGMP
           ip_addr_ismulticast(&(iphdr->dest)) ||
#endif /* LWIP_IGMP */
           ip_addr_isbroadcast(&(iphdr->dest), inp))) {
  80c59e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80c5a1:	83 c0 10             	add    $0x10,%eax
  80c5a4:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  80c5a7:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
  80c5ae:	bf 00 00 00 00       	mov    $0x0,%edi
                   ip4_addr3(&pcb->local_ip), ip4_addr4(&pcb->local_ip), pcb->local_port,
                   ip4_addr1(&pcb->remote_ip), ip4_addr2(&pcb->remote_ip),
                   ip4_addr3(&pcb->remote_ip), ip4_addr4(&pcb->remote_ip), pcb->remote_port));

      /* compare PCB local addr+port to UDP destination addr+port */
      if ((pcb->local_port == dest) &&
  80c5b3:	66 3b 73 12          	cmp    0x12(%ebx),%si
  80c5b7:	75 75                	jne    80c62e <udp_input+0x186>
          (ip_addr_isany(&pcb->local_ip) ||
  80c5b9:	85 db                	test   %ebx,%ebx
  80c5bb:	74 24                	je     80c5e1 <udp_input+0x139>
  80c5bd:	8b 03                	mov    (%ebx),%eax
                   ip4_addr3(&pcb->local_ip), ip4_addr4(&pcb->local_ip), pcb->local_port,
                   ip4_addr1(&pcb->remote_ip), ip4_addr2(&pcb->remote_ip),
                   ip4_addr3(&pcb->remote_ip), ip4_addr4(&pcb->remote_ip), pcb->remote_port));

      /* compare PCB local addr+port to UDP destination addr+port */
      if ((pcb->local_port == dest) &&
  80c5bf:	85 c0                	test   %eax,%eax
  80c5c1:	74 1e                	je     80c5e1 <udp_input+0x139>
          (ip_addr_isany(&pcb->local_ip) ||
           ip_addr_cmp(&(pcb->local_ip), &(iphdr->dest)) || 
  80c5c3:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80c5c6:	3b 42 10             	cmp    0x10(%edx),%eax
  80c5c9:	74 16                	je     80c5e1 <udp_input+0x139>
#if LWIP_IGMP
           ip_addr_ismulticast(&(iphdr->dest)) ||
#endif /* LWIP_IGMP */
           ip_addr_isbroadcast(&(iphdr->dest), inp))) {
  80c5cb:	8b 45 0c             	mov    0xc(%ebp),%eax
  80c5ce:	89 44 24 04          	mov    %eax,0x4(%esp)
  80c5d2:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  80c5d5:	89 14 24             	mov    %edx,(%esp)
  80c5d8:	e8 0b d3 ff ff       	call   8098e8 <ip_addr_isbroadcast>
                   ip4_addr3(&pcb->local_ip), ip4_addr4(&pcb->local_ip), pcb->local_port,
                   ip4_addr1(&pcb->remote_ip), ip4_addr2(&pcb->remote_ip),
                   ip4_addr3(&pcb->remote_ip), ip4_addr4(&pcb->remote_ip), pcb->remote_port));

      /* compare PCB local addr+port to UDP destination addr+port */
      if ((pcb->local_port == dest) &&
  80c5dd:	84 c0                	test   %al,%al
  80c5df:	74 4d                	je     80c62e <udp_input+0x186>
#if LWIP_IGMP
           ip_addr_ismulticast(&(iphdr->dest)) ||
#endif /* LWIP_IGMP */
           ip_addr_isbroadcast(&(iphdr->dest), inp))) {
        local_match = 1;
        if ((uncon_pcb == NULL) && 
  80c5e1:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  80c5e5:	0f 85 fe 01 00 00    	jne    80c7e9 <udp_input+0x341>
  } else {
    pbuf_free(p);
  }
end:
  PERF_STOP("udp_input");
}
  80c5eb:	f6 43 10 04          	testb  $0x4,0x10(%ebx)
  80c5ef:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80c5f2:	0f 44 c3             	cmove  %ebx,%eax
  80c5f5:	89 45 e0             	mov    %eax,-0x20(%ebp)
  80c5f8:	e9 ec 01 00 00       	jmp    80c7e9 <udp_input+0x341>
        }
      }
      /* compare PCB remote addr+port to UDP source addr+port */
      if ((local_match != 0) &&
          (pcb->remote_port == src) &&
          (ip_addr_isany(&pcb->remote_ip) ||
  80c5fd:	83 fb fc             	cmp    $0xfffffffc,%ebx
  80c600:	74 0f                	je     80c611 <udp_input+0x169>
  80c602:	8b 43 04             	mov    0x4(%ebx),%eax
          /* the first unconnected matching PCB */     
          uncon_pcb = pcb;
        }
      }
      /* compare PCB remote addr+port to UDP source addr+port */
      if ((local_match != 0) &&
  80c605:	85 c0                	test   %eax,%eax
  80c607:	74 08                	je     80c611 <udp_input+0x169>
          (pcb->remote_port == src) &&
          (ip_addr_isany(&pcb->remote_ip) ||
           ip_addr_cmp(&(pcb->remote_ip), &(iphdr->src)))) {
  80c609:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80c60c:	3b 42 0c             	cmp    0xc(%edx),%eax
  80c60f:	75 1d                	jne    80c62e <udp_input+0x186>
  80c611:	89 d8                	mov    %ebx,%eax
        /* the first fully matching PCB */
        if (prev != NULL) {
  80c613:	85 ff                	test   %edi,%edi
  80c615:	74 27                	je     80c63e <udp_input+0x196>
          /* move the pcb to the front of udp_pcbs so that is
             found faster next time */
          prev->next = pcb->next;
  80c617:	8b 53 0c             	mov    0xc(%ebx),%edx
  80c61a:	89 57 0c             	mov    %edx,0xc(%edi)
          pcb->next = udp_pcbs;
  80c61d:	8b 15 20 f6 b3 00    	mov    0xb3f620,%edx
  80c623:	89 53 0c             	mov    %edx,0xc(%ebx)
          udp_pcbs = pcb;
  80c626:	89 1d 20 f6 b3 00    	mov    %ebx,0xb3f620
  80c62c:	eb 10                	jmp    80c63e <udp_input+0x196>
    uncon_pcb = NULL;
    /* Iterate through the UDP pcb list for a matching pcb.
     * 'Perfect match' pcbs (connected to the remote port & ip address) are
     * preferred. If no perfect match is found, the first unconnected pcb that
     * matches the local port and ip address gets the datagram. */
    for (pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) {
  80c62e:	8b 43 0c             	mov    0xc(%ebx),%eax
  80c631:	85 c0                	test   %eax,%eax
  80c633:	74 0d                	je     80c642 <udp_input+0x19a>
  80c635:	89 df                	mov    %ebx,%edi
  80c637:	89 c3                	mov    %eax,%ebx
  80c639:	e9 75 ff ff ff       	jmp    80c5b3 <udp_input+0x10b>
        break;
      }
      prev = pcb;
    }
    /* no fully matching pcb found? then look for an unconnected pcb */
    if (pcb == NULL) {
  80c63e:	85 c0                	test   %eax,%eax
  80c640:	75 20                	jne    80c662 <udp_input+0x1ba>
  80c642:	8b 5d e0             	mov    -0x20(%ebp),%ebx
      pcb = uncon_pcb;
    }
  }

  /* Check checksum if this is a match or if it was directed at us. */
  if (pcb != NULL || ip_addr_cmp(&inp->ip_addr, &iphdr->dest)) {
  80c645:	85 db                	test   %ebx,%ebx
  80c647:	75 19                	jne    80c662 <udp_input+0x1ba>
  80c649:	eb 05                	jmp    80c650 <udp_input+0x1a8>
  80c64b:	bb 00 00 00 00       	mov    $0x0,%ebx
  80c650:	8b 55 0c             	mov    0xc(%ebp),%edx
  80c653:	8b 42 04             	mov    0x4(%edx),%eax
  80c656:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80c659:	3b 42 10             	cmp    0x10(%edx),%eax
  80c65c:	0f 85 7a 01 00 00    	jne    80c7dc <udp_input+0x334>
#endif /* CHECKSUM_CHECK_UDP */
    } else
#endif /* LWIP_UDPLITE */
    {
#if CHECKSUM_CHECK_UDP
      if (udphdr->chksum != 0) {
  80c662:	8b 45 d8             	mov    -0x28(%ebp),%eax
  80c665:	66 83 78 06 00       	cmpw   $0x0,0x6(%eax)
  80c66a:	74 44                	je     80c6b0 <udp_input+0x208>
        if (inet_chksum_pseudo(p, (struct ip_addr *)&(iphdr->src),
  80c66c:	8b 55 08             	mov    0x8(%ebp),%edx
  80c66f:	0f b7 42 08          	movzwl 0x8(%edx),%eax
  80c673:	89 44 24 10          	mov    %eax,0x10(%esp)
  80c677:	c7 44 24 0c 11 00 00 	movl   $0x11,0xc(%esp)
  80c67e:	00 
  80c67f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80c682:	83 c0 10             	add    $0x10,%eax
  80c685:	89 44 24 08          	mov    %eax,0x8(%esp)
  80c689:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80c68c:	83 c0 0c             	add    $0xc,%eax
  80c68f:	89 44 24 04          	mov    %eax,0x4(%esp)
  80c693:	89 14 24             	mov    %edx,(%esp)
  80c696:	e8 55 e3 ff ff       	call   80a9f0 <inet_chksum_pseudo>
  80c69b:	66 85 c0             	test   %ax,%ax
  80c69e:	74 10                	je     80c6b0 <udp_input+0x208>
          LWIP_DEBUGF(UDP_DEBUG | 2,
                      ("udp_input: UDP datagram discarded due to failing checksum\n"));
          UDP_STATS_INC(udp.chkerr);
          UDP_STATS_INC(udp.drop);
          snmp_inc_udpinerrors();
          pbuf_free(p);
  80c6a0:	8b 45 08             	mov    0x8(%ebp),%eax
  80c6a3:	89 04 24             	mov    %eax,(%esp)
  80c6a6:	e8 52 b8 ff ff       	call   807efd <pbuf_free>
          goto end;
  80c6ab:	e9 59 01 00 00       	jmp    80c809 <udp_input+0x361>
        }
      }
#endif /* CHECKSUM_CHECK_UDP */
    }
    if(pbuf_header(p, -UDP_HLEN)) {
  80c6b0:	c7 44 24 04 f8 ff ff 	movl   $0xfffffff8,0x4(%esp)
  80c6b7:	ff 
  80c6b8:	8b 55 08             	mov    0x8(%ebp),%edx
  80c6bb:	89 14 24             	mov    %edx,(%esp)
  80c6be:	e8 d0 b4 ff ff       	call   807b93 <pbuf_header>
  80c6c3:	84 c0                	test   %al,%al
  80c6c5:	74 1c                	je     80c6e3 <udp_input+0x23b>
      /* Can we cope with this failing? Just assert for now */
      LWIP_ASSERT("pbuf_header failed\n", 0);
  80c6c7:	c7 44 24 08 24 40 81 	movl   $0x814024,0x8(%esp)
  80c6ce:	00 
  80c6cf:	c7 44 24 04 0a 01 00 	movl   $0x10a,0x4(%esp)
  80c6d6:	00 
  80c6d7:	c7 04 24 44 40 81 00 	movl   $0x814044,(%esp)
  80c6de:	e8 b9 42 ff ff       	call   80099c <_panic>
      UDP_STATS_INC(udp.drop);
      snmp_inc_udpinerrors();
      pbuf_free(p);
      goto end;
    }
    if (pcb != NULL) {
  80c6e3:	85 db                	test   %ebx,%ebx
  80c6e5:	74 41                	je     80c728 <udp_input+0x280>
      snmp_inc_udpindatagrams();
      /* callback */
      if (pcb->recv != NULL) {
  80c6e7:	8b 43 18             	mov    0x18(%ebx),%eax
  80c6ea:	85 c0                	test   %eax,%eax
  80c6ec:	74 2a                	je     80c718 <udp_input+0x270>
        /* now the recv function is responsible for freeing p */
        pcb->recv(pcb->recv_arg, pcb, p, &(iphdr->src), src);
  80c6ee:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
  80c6f2:	89 54 24 10          	mov    %edx,0x10(%esp)
  80c6f6:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80c6f9:	83 c2 0c             	add    $0xc,%edx
  80c6fc:	89 54 24 0c          	mov    %edx,0xc(%esp)
  80c700:	8b 55 08             	mov    0x8(%ebp),%edx
  80c703:	89 54 24 08          	mov    %edx,0x8(%esp)
  80c707:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  80c70b:	8b 53 1c             	mov    0x1c(%ebx),%edx
  80c70e:	89 14 24             	mov    %edx,(%esp)
  80c711:	ff d0                	call   *%eax
  80c713:	e9 f1 00 00 00       	jmp    80c809 <udp_input+0x361>
      } else {
        /* no recv function registered? then we have to free the pbuf! */
        pbuf_free(p);
  80c718:	8b 45 08             	mov    0x8(%ebp),%eax
  80c71b:	89 04 24             	mov    %eax,(%esp)
  80c71e:	e8 da b7 ff ff       	call   807efd <pbuf_free>
        goto end;
  80c723:	e9 e1 00 00 00       	jmp    80c809 <udp_input+0x361>
      LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_input: not for us.\n"));

#if LWIP_ICMP
      /* No match was found, send ICMP destination port unreachable unless
         destination address was broadcast/multicast. */
      if (!ip_addr_isbroadcast(&iphdr->dest, inp) &&
  80c728:	8b 55 0c             	mov    0xc(%ebp),%edx
  80c72b:	89 54 24 04          	mov    %edx,0x4(%esp)
  80c72f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80c732:	83 c0 10             	add    $0x10,%eax
  80c735:	89 04 24             	mov    %eax,(%esp)
  80c738:	e8 ab d1 ff ff       	call   8098e8 <ip_addr_isbroadcast>
  80c73d:	84 c0                	test   %al,%al
  80c73f:	0f 85 8a 00 00 00    	jne    80c7cf <udp_input+0x327>
          !ip_addr_ismulticast(&iphdr->dest)) {
  80c745:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80c748:	8b 70 10             	mov    0x10(%eax),%esi
  80c74b:	c7 04 24 00 00 00 f0 	movl   $0xf0000000,(%esp)
  80c752:	e8 de e7 ff ff       	call   80af35 <ntohl>
  80c757:	89 c3                	mov    %eax,%ebx
  80c759:	c7 04 24 00 00 00 e0 	movl   $0xe0000000,(%esp)
  80c760:	e8 d0 e7 ff ff       	call   80af35 <ntohl>
      LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_input: not for us.\n"));

#if LWIP_ICMP
      /* No match was found, send ICMP destination port unreachable unless
         destination address was broadcast/multicast. */
      if (!ip_addr_isbroadcast(&iphdr->dest, inp) &&
  80c765:	21 f3                	and    %esi,%ebx
  80c767:	39 c3                	cmp    %eax,%ebx
  80c769:	74 64                	je     80c7cf <udp_input+0x327>
          !ip_addr_ismulticast(&iphdr->dest)) {
        /* move payload pointer back to ip header */
        pbuf_header(p, (IPH_HL(iphdr) * 4) + UDP_HLEN);
  80c76b:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80c76e:	0f b7 02             	movzwl (%edx),%eax
  80c771:	89 04 24             	mov    %eax,(%esp)
  80c774:	e8 87 e5 ff ff       	call   80ad00 <ntohs>
  80c779:	0f b6 c4             	movzbl %ah,%eax
  80c77c:	83 e0 0f             	and    $0xf,%eax
  80c77f:	8d 04 85 08 00 00 00 	lea    0x8(,%eax,4),%eax
  80c786:	89 44 24 04          	mov    %eax,0x4(%esp)
  80c78a:	8b 45 08             	mov    0x8(%ebp),%eax
  80c78d:	89 04 24             	mov    %eax,(%esp)
  80c790:	e8 fe b3 ff ff       	call   807b93 <pbuf_header>
        LWIP_ASSERT("p->payload == iphdr", (p->payload == iphdr));
  80c795:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80c798:	8b 55 08             	mov    0x8(%ebp),%edx
  80c79b:	39 42 04             	cmp    %eax,0x4(%edx)
  80c79e:	74 1c                	je     80c7bc <udp_input+0x314>
  80c7a0:	c7 44 24 08 58 40 81 	movl   $0x814058,0x8(%esp)
  80c7a7:	00 
  80c7a8:	c7 44 24 04 25 01 00 	movl   $0x125,0x4(%esp)
  80c7af:	00 
  80c7b0:	c7 04 24 44 40 81 00 	movl   $0x814044,(%esp)
  80c7b7:	e8 e0 41 ff ff       	call   80099c <_panic>
        icmp_dest_unreach(p, ICMP_DUR_PORT);
  80c7bc:	c7 44 24 04 03 00 00 	movl   $0x3,0x4(%esp)
  80c7c3:	00 
  80c7c4:	8b 55 08             	mov    0x8(%ebp),%edx
  80c7c7:	89 14 24             	mov    %edx,(%esp)
  80c7ca:	e8 e3 55 00 00       	call   811db2 <icmp_dest_unreach>
      }
#endif /* LWIP_ICMP */
      UDP_STATS_INC(udp.proterr);
      UDP_STATS_INC(udp.drop);
      snmp_inc_udpnoports();
      pbuf_free(p);
  80c7cf:	8b 45 08             	mov    0x8(%ebp),%eax
  80c7d2:	89 04 24             	mov    %eax,(%esp)
  80c7d5:	e8 23 b7 ff ff       	call   807efd <pbuf_free>
  80c7da:	eb 2d                	jmp    80c809 <udp_input+0x361>
    }
  } else {
    pbuf_free(p);
  80c7dc:	8b 55 08             	mov    0x8(%ebp),%edx
  80c7df:	89 14 24             	mov    %edx,(%esp)
  80c7e2:	e8 16 b7 ff ff       	call   807efd <pbuf_free>
  80c7e7:	eb 20                	jmp    80c809 <udp_input+0x361>
          uncon_pcb = pcb;
        }
      }
      /* compare PCB remote addr+port to UDP source addr+port */
      if ((local_match != 0) &&
          (pcb->remote_port == src) &&
  80c7e9:	0f b7 45 de          	movzwl -0x22(%ebp),%eax
  80c7ed:	66 3b 43 14          	cmp    0x14(%ebx),%ax
  80c7f1:	0f 85 37 fe ff ff    	jne    80c62e <udp_input+0x186>
  80c7f7:	90                   	nop
  80c7f8:	e9 00 fe ff ff       	jmp    80c5fd <udp_input+0x155>
  80c7fd:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
  80c804:	e9 39 fe ff ff       	jmp    80c642 <udp_input+0x19a>
  } else {
    pbuf_free(p);
  }
end:
  PERF_STOP("udp_input");
}
  80c809:	83 c4 4c             	add    $0x4c,%esp
  80c80c:	5b                   	pop    %ebx
  80c80d:	5e                   	pop    %esi
  80c80e:	5f                   	pop    %edi
  80c80f:	5d                   	pop    %ebp
  80c810:	c3                   	ret    
	...

0080c820 <etharp_send_ip>:
 * @params dst the destination MAC address to be copied into the ethernet header
 * @return ERR_OK if the packet was sent, any other err_t on failure
 */
static err_t
etharp_send_ip(struct netif *netif, struct pbuf *p, struct eth_addr *src, struct eth_addr *dst)
{
  80c820:	55                   	push   %ebp
  80c821:	89 e5                	mov    %esp,%ebp
  80c823:	57                   	push   %edi
  80c824:	56                   	push   %esi
  80c825:	53                   	push   %ebx
  80c826:	83 ec 2c             	sub    $0x2c,%esp
  80c829:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  80c82c:	89 55 e0             	mov    %edx,-0x20(%ebp)
  80c82f:	89 ce                	mov    %ecx,%esi
  80c831:	8b 7d 08             	mov    0x8(%ebp),%edi
  struct eth_hdr *ethhdr = p->payload;
  80c834:	8b 5a 04             	mov    0x4(%edx),%ebx
  u8_t k;

  LWIP_ASSERT("netif->hwaddr_len must be the same as ETHARP_HWADDR_LEN for etharp!",
  80c837:	80 78 24 06          	cmpb   $0x6,0x24(%eax)
  80c83b:	74 1c                	je     80c859 <etharp_send_ip+0x39>
  80c83d:	c7 44 24 08 9c 40 81 	movl   $0x81409c,0x8(%esp)
  80c844:	00 
  80c845:	c7 44 24 04 b3 01 00 	movl   $0x1b3,0x4(%esp)
  80c84c:	00 
  80c84d:	c7 04 24 85 41 81 00 	movl   $0x814185,(%esp)
  80c854:	e8 43 41 ff ff       	call   80099c <_panic>
  80c859:	ba 06 00 00 00       	mov    $0x6,%edx
              (netif->hwaddr_len == ETHARP_HWADDR_LEN));
  k = ETHARP_HWADDR_LEN;
  while(k > 0) {
    k--;
  80c85e:	83 ea 01             	sub    $0x1,%edx
    ethhdr->dest.addr[k] = dst->addr[k];
  80c861:	0f b6 c2             	movzbl %dl,%eax
  80c864:	0f b6 0c 07          	movzbl (%edi,%eax,1),%ecx
  80c868:	88 0c 03             	mov    %cl,(%ebx,%eax,1)
    ethhdr->src.addr[k]  = src->addr[k];
  80c86b:	0f b6 0c 06          	movzbl (%esi,%eax,1),%ecx
  80c86f:	88 4c 03 06          	mov    %cl,0x6(%ebx,%eax,1)
  u8_t k;

  LWIP_ASSERT("netif->hwaddr_len must be the same as ETHARP_HWADDR_LEN for etharp!",
              (netif->hwaddr_len == ETHARP_HWADDR_LEN));
  k = ETHARP_HWADDR_LEN;
  while(k > 0) {
  80c873:	84 d2                	test   %dl,%dl
  80c875:	75 e7                	jne    80c85e <etharp_send_ip+0x3e>
    k--;
    ethhdr->dest.addr[k] = dst->addr[k];
    ethhdr->src.addr[k]  = src->addr[k];
  }
  ethhdr->type = htons(ETHTYPE_IP);
  80c877:	c7 04 24 00 08 00 00 	movl   $0x800,(%esp)
  80c87e:	e8 70 e4 ff ff       	call   80acf3 <htons>
  80c883:	66 89 43 0c          	mov    %ax,0xc(%ebx)
  LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_send_ip: sending packet %p\n", (void *)p));
  /* send the packet */
  return netif->linkoutput(netif, p);
  80c887:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80c88a:	89 44 24 04          	mov    %eax,0x4(%esp)
  80c88e:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80c891:	89 14 24             	mov    %edx,(%esp)
  80c894:	ff 52 18             	call   *0x18(%edx)
}
  80c897:	83 c4 2c             	add    $0x2c,%esp
  80c89a:	5b                   	pop    %ebx
  80c89b:	5e                   	pop    %esi
  80c89c:	5f                   	pop    %edi
  80c89d:	5d                   	pop    %ebp
  80c89e:	c3                   	ret    

0080c89f <etharp_request>:
 *         ERR_MEM if the ARP packet couldn't be allocated
 *         any other err_t on failure
 */
err_t
etharp_request(struct netif *netif, struct ip_addr *ipaddr)
{
  80c89f:	55                   	push   %ebp
  80c8a0:	89 e5                	mov    %esp,%ebp
  80c8a2:	57                   	push   %edi
  80c8a3:	56                   	push   %esi
  80c8a4:	53                   	push   %ebx
  80c8a5:	83 ec 3c             	sub    $0x3c,%esp
  LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_request: sending ARP request.\n"));
  return etharp_raw(netif, (struct eth_addr *)netif->hwaddr, &ethbroadcast,
  80c8a8:	8b 75 08             	mov    0x8(%ebp),%esi
  80c8ab:	83 c6 25             	add    $0x25,%esi
#if LWIP_AUTOIP
  const u8_t * ethdst_hwaddr;
#endif /* LWIP_AUTOIP */

  /* allocate a pbuf for the outgoing ARP request packet */
  p = pbuf_alloc(PBUF_LINK, sizeof(struct etharp_hdr), PBUF_RAM);
  80c8ae:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80c8b5:	00 
  80c8b6:	c7 44 24 04 2a 00 00 	movl   $0x2a,0x4(%esp)
  80c8bd:	00 
  80c8be:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  80c8c5:	e8 ef b8 ff ff       	call   8081b9 <pbuf_alloc>
  80c8ca:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  /* could allocate a pbuf for an ARP request? */
  if (p == NULL) {
  80c8cd:	bb ff ff ff ff       	mov    $0xffffffff,%ebx
  80c8d2:	85 c0                	test   %eax,%eax
  80c8d4:	0f 84 02 01 00 00    	je     80c9dc <etharp_request+0x13d>
    LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | 2, ("etharp_raw: could not allocate pbuf for ARP request.\n"));
    ETHARP_STATS_INC(etharp.memerr);
    return ERR_MEM;
  }
  LWIP_ASSERT("check that first pbuf can hold struct etharp_hdr",
  80c8da:	66 83 78 0a 29       	cmpw   $0x29,0xa(%eax)
  80c8df:	77 1c                	ja     80c8fd <etharp_request+0x5e>
  80c8e1:	c7 44 24 08 e0 40 81 	movl   $0x8140e0,0x8(%esp)
  80c8e8:	00 
  80c8e9:	c7 44 24 04 1c 04 00 	movl   $0x41c,0x4(%esp)
  80c8f0:	00 
  80c8f1:	c7 04 24 85 41 81 00 	movl   $0x814185,(%esp)
  80c8f8:	e8 9f 40 ff ff       	call   80099c <_panic>
              (p->len >= sizeof(struct etharp_hdr)));

  hdr = p->payload;
  80c8fd:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80c900:	8b 5a 04             	mov    0x4(%edx),%ebx
  LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_raw: sending raw ARP packet.\n"));
  hdr->opcode = htons(opcode);
  80c903:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  80c90a:	e8 e4 e3 ff ff       	call   80acf3 <htons>
  80c90f:	66 89 43 14          	mov    %ax,0x14(%ebx)

  LWIP_ASSERT("netif->hwaddr_len must be the same as ETHARP_HWADDR_LEN for etharp!",
  80c913:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80c916:	80 79 24 06          	cmpb   $0x6,0x24(%ecx)
  80c91a:	74 1c                	je     80c938 <etharp_request+0x99>
  80c91c:	c7 44 24 08 9c 40 81 	movl   $0x81409c,0x8(%esp)
  80c923:	00 
  80c924:	c7 44 24 04 23 04 00 	movl   $0x423,0x4(%esp)
  80c92b:	00 
  80c92c:	c7 04 24 85 41 81 00 	movl   $0x814185,(%esp)
  80c933:	e8 64 40 ff ff       	call   80099c <_panic>
  80c938:	ba 06 00 00 00       	mov    $0x6,%edx
  /* Write MAC-Addresses (combined loop for both headers) */
  while(k > 0) {
    k--;
    /* Write the ARP MAC-Addresses */
    hdr->shwaddr.addr[k] = hwsrc_addr->addr[k];
    hdr->dhwaddr.addr[k] = hwdst_addr->addr[k];
  80c93d:	bf 01 42 81 00       	mov    $0x814201,%edi
   * link layer. (See RFC3927 Section 2.5) */
  ethdst_hwaddr = ((netif->autoip != NULL) && (netif->autoip->state != AUTOIP_STATE_OFF)) ? (u8_t*)(ethbroadcast.addr) : ethdst_addr->addr;
#endif /* LWIP_AUTOIP */
  /* Write MAC-Addresses (combined loop for both headers) */
  while(k > 0) {
    k--;
  80c942:	83 ea 01             	sub    $0x1,%edx
    /* Write the ARP MAC-Addresses */
    hdr->shwaddr.addr[k] = hwsrc_addr->addr[k];
  80c945:	0f b6 c2             	movzbl %dl,%eax
  80c948:	0f b6 0c 06          	movzbl (%esi,%eax,1),%ecx
  80c94c:	88 4c 18 16          	mov    %cl,0x16(%eax,%ebx,1)
    hdr->dhwaddr.addr[k] = hwdst_addr->addr[k];
  80c950:	0f b6 0c 07          	movzbl (%edi,%eax,1),%ecx
  80c954:	88 4c 18 20          	mov    %cl,0x20(%eax,%ebx,1)
    /* Write the Ethernet MAC-Addresses */
#if LWIP_AUTOIP
    hdr->ethhdr.dest.addr[k] = ethdst_hwaddr[k];
#else  /* LWIP_AUTOIP */
    hdr->ethhdr.dest.addr[k] = ethdst_addr->addr[k];
  80c958:	0f b6 88 fb 41 81 00 	movzbl 0x8141fb(%eax),%ecx
  80c95f:	88 0c 03             	mov    %cl,(%ebx,%eax,1)
#endif /* LWIP_AUTOIP */
    hdr->ethhdr.src.addr[k]  = ethsrc_addr->addr[k];
  80c962:	0f b6 0c 06          	movzbl (%esi,%eax,1),%ecx
  80c966:	88 4c 03 06          	mov    %cl,0x6(%ebx,%eax,1)
  /* If we are using Link-Local, ARP packets must be broadcast on the
   * link layer. (See RFC3927 Section 2.5) */
  ethdst_hwaddr = ((netif->autoip != NULL) && (netif->autoip->state != AUTOIP_STATE_OFF)) ? (u8_t*)(ethbroadcast.addr) : ethdst_addr->addr;
#endif /* LWIP_AUTOIP */
  /* Write MAC-Addresses (combined loop for both headers) */
  while(k > 0) {
  80c96a:	84 d2                	test   %dl,%dl
  80c96c:	75 d4                	jne    80c942 <etharp_request+0xa3>
#else  /* LWIP_AUTOIP */
    hdr->ethhdr.dest.addr[k] = ethdst_addr->addr[k];
#endif /* LWIP_AUTOIP */
    hdr->ethhdr.src.addr[k]  = ethsrc_addr->addr[k];
  }
  hdr->sipaddr = *(struct ip_addr2 *)ipsrc_addr;
  80c96e:	8b 55 08             	mov    0x8(%ebp),%edx
  80c971:	8b 42 04             	mov    0x4(%edx),%eax
  80c974:	89 43 1c             	mov    %eax,0x1c(%ebx)
  hdr->dipaddr = *(struct ip_addr2 *)ipdst_addr;
  80c977:	8b 45 0c             	mov    0xc(%ebp),%eax
  80c97a:	8b 00                	mov    (%eax),%eax
  80c97c:	89 43 26             	mov    %eax,0x26(%ebx)

  hdr->hwtype = htons(HWTYPE_ETHERNET);
  80c97f:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  80c986:	e8 68 e3 ff ff       	call   80acf3 <htons>
  80c98b:	66 89 43 0e          	mov    %ax,0xe(%ebx)
  hdr->proto = htons(ETHTYPE_IP);
  80c98f:	c7 04 24 00 08 00 00 	movl   $0x800,(%esp)
  80c996:	e8 58 e3 ff ff       	call   80acf3 <htons>
  80c99b:	66 89 43 10          	mov    %ax,0x10(%ebx)
  /* set hwlen and protolen together */
  hdr->_hwlen_protolen = htons((ETHARP_HWADDR_LEN << 8) | sizeof(struct ip_addr));
  80c99f:	c7 04 24 04 06 00 00 	movl   $0x604,(%esp)
  80c9a6:	e8 48 e3 ff ff       	call   80acf3 <htons>
  80c9ab:	66 89 43 12          	mov    %ax,0x12(%ebx)

  hdr->ethhdr.type = htons(ETHTYPE_ARP);
  80c9af:	c7 04 24 06 08 00 00 	movl   $0x806,(%esp)
  80c9b6:	e8 38 e3 ff ff       	call   80acf3 <htons>
  80c9bb:	66 89 43 0c          	mov    %ax,0xc(%ebx)
  /* send ARP query */
  result = netif->linkoutput(netif, p);
  80c9bf:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  80c9c2:	89 4c 24 04          	mov    %ecx,0x4(%esp)
  80c9c6:	8b 45 08             	mov    0x8(%ebp),%eax
  80c9c9:	89 04 24             	mov    %eax,(%esp)
  80c9cc:	ff 50 18             	call   *0x18(%eax)
  80c9cf:	89 c3                	mov    %eax,%ebx
  ETHARP_STATS_INC(etharp.xmit);
  /* free ARP query packet */
  pbuf_free(p);
  80c9d1:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  80c9d4:	89 0c 24             	mov    %ecx,(%esp)
  80c9d7:	e8 21 b5 ff ff       	call   807efd <pbuf_free>
{
  LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_request: sending ARP request.\n"));
  return etharp_raw(netif, (struct eth_addr *)netif->hwaddr, &ethbroadcast,
                    (struct eth_addr *)netif->hwaddr, &netif->ip_addr, &ethzero,
                    ipaddr, ARP_REQUEST);
}
  80c9dc:	89 d8                	mov    %ebx,%eax
  80c9de:	83 c4 3c             	add    $0x3c,%esp
  80c9e1:	5b                   	pop    %ebx
  80c9e2:	5e                   	pop    %esi
  80c9e3:	5f                   	pop    %edi
  80c9e4:	5d                   	pop    %ebp
  80c9e5:	c3                   	ret    

0080c9e6 <free_etharp_q>:
 *
 * @param q a qeueue of etharp_q_entry's to free
 */
static void
free_etharp_q(struct etharp_q_entry *q)
{
  80c9e6:	55                   	push   %ebp
  80c9e7:	89 e5                	mov    %esp,%ebp
  80c9e9:	56                   	push   %esi
  80c9ea:	53                   	push   %ebx
  80c9eb:	83 ec 10             	sub    $0x10,%esp
  80c9ee:	89 c6                	mov    %eax,%esi
  struct etharp_q_entry *r;
  LWIP_ASSERT("q != NULL", q != NULL);
  80c9f0:	85 c0                	test   %eax,%eax
  80c9f2:	75 1c                	jne    80ca10 <free_etharp_q+0x2a>
  80c9f4:	c7 44 24 08 4f 39 81 	movl   $0x81394f,0x8(%esp)
  80c9fb:	00 
  80c9fc:	c7 44 24 04 93 00 00 	movl   $0x93,0x4(%esp)
  80ca03:	00 
  80ca04:	c7 04 24 85 41 81 00 	movl   $0x814185,(%esp)
  80ca0b:	e8 8c 3f ff ff       	call   80099c <_panic>
  LWIP_ASSERT("q->p != NULL", q->p != NULL);
  80ca10:	8b 40 04             	mov    0x4(%eax),%eax
  80ca13:	85 c0                	test   %eax,%eax
  80ca15:	74 04                	je     80ca1b <free_etharp_q+0x35>
  while (q) {
    r = q;
    q = q->next;
  80ca17:	8b 1e                	mov    (%esi),%ebx
  80ca19:	eb 45                	jmp    80ca60 <free_etharp_q+0x7a>
static void
free_etharp_q(struct etharp_q_entry *q)
{
  struct etharp_q_entry *r;
  LWIP_ASSERT("q != NULL", q != NULL);
  LWIP_ASSERT("q->p != NULL", q->p != NULL);
  80ca1b:	c7 44 24 08 9d 41 81 	movl   $0x81419d,0x8(%esp)
  80ca22:	00 
  80ca23:	c7 44 24 04 94 00 00 	movl   $0x94,0x4(%esp)
  80ca2a:	00 
  80ca2b:	c7 04 24 85 41 81 00 	movl   $0x814185,(%esp)
  80ca32:	e8 65 3f ff ff       	call   80099c <_panic>
  while (q) {
    r = q;
    q = q->next;
  80ca37:	8b 13                	mov    (%ebx),%edx
    LWIP_ASSERT("r->p != NULL", (r->p != NULL));
  80ca39:	8b 43 04             	mov    0x4(%ebx),%eax
  80ca3c:	85 c0                	test   %eax,%eax
  80ca3e:	75 1c                	jne    80ca5c <free_etharp_q+0x76>
  80ca40:	c7 44 24 08 aa 41 81 	movl   $0x8141aa,0x8(%esp)
  80ca47:	00 
  80ca48:	c7 44 24 04 98 00 00 	movl   $0x98,0x4(%esp)
  80ca4f:	00 
  80ca50:	c7 04 24 85 41 81 00 	movl   $0x814185,(%esp)
  80ca57:	e8 40 3f ff ff       	call   80099c <_panic>
  80ca5c:	89 de                	mov    %ebx,%esi
  80ca5e:	89 d3                	mov    %edx,%ebx
    pbuf_free(r->p);
  80ca60:	89 04 24             	mov    %eax,(%esp)
  80ca63:	e8 95 b4 ff ff       	call   807efd <pbuf_free>
    memp_free(MEMP_ARP_QUEUE, r);
  80ca68:	89 74 24 04          	mov    %esi,0x4(%esp)
  80ca6c:	c7 04 24 0a 00 00 00 	movl   $0xa,(%esp)
  80ca73:	e8 fc ac ff ff       	call   807774 <memp_free>
free_etharp_q(struct etharp_q_entry *q)
{
  struct etharp_q_entry *r;
  LWIP_ASSERT("q != NULL", q != NULL);
  LWIP_ASSERT("q->p != NULL", q->p != NULL);
  while (q) {
  80ca78:	85 db                	test   %ebx,%ebx
  80ca7a:	75 bb                	jne    80ca37 <free_etharp_q+0x51>
    q = q->next;
    LWIP_ASSERT("r->p != NULL", (r->p != NULL));
    pbuf_free(r->p);
    memp_free(MEMP_ARP_QUEUE, r);
  }
}
  80ca7c:	83 c4 10             	add    $0x10,%esp
  80ca7f:	5b                   	pop    %ebx
  80ca80:	5e                   	pop    %esi
  80ca81:	5d                   	pop    %ebp
  80ca82:	c3                   	ret    

0080ca83 <find_entry>:
#if LWIP_NETIF_HWADDRHINT
find_entry(struct ip_addr *ipaddr, u8_t flags, struct netif *netif)
#else /* LWIP_NETIF_HWADDRHINT */
find_entry(struct ip_addr *ipaddr, u8_t flags)
#endif /* LWIP_NETIF_HWADDRHINT */
{
  80ca83:	55                   	push   %ebp
  80ca84:	89 e5                	mov    %esp,%ebp
  80ca86:	57                   	push   %edi
  80ca87:	56                   	push   %esi
  80ca88:	53                   	push   %ebx
  80ca89:	83 ec 3c             	sub    $0x3c,%esp
  80ca8c:	89 45 e0             	mov    %eax,-0x20(%ebp)
  80ca8f:	88 55 dd             	mov    %dl,-0x23(%ebp)
  u8_t age_queue = 0;
#endif

  /* First, test if the last call to this function asked for the
   * same address. If so, we're really fast! */
  if (ipaddr) {
  80ca92:	85 c0                	test   %eax,%eax
  80ca94:	74 16                	je     80caac <find_entry+0x29>
          return per_pcb_cache;
        }
      }
    }
#else /* #if LWIP_NETIF_HWADDRHINT */
    if (arp_table[etharp_cached_entry].state == ETHARP_STATE_STABLE) {
  80ca96:	0f b6 05 f8 8e b3 00 	movzbl 0xb38ef8,%eax
  80ca9d:	0f b6 d0             	movzbl %al,%edx
  80caa0:	6b ca 1c             	imul   $0x1c,%edx,%ecx
  80caa3:	83 b9 f0 8d b3 00 02 	cmpl   $0x2,0xb38df0(%ecx)
  80caaa:	74 2a                	je     80cad6 <find_entry+0x53>
  80caac:	ba f4 8d b3 00       	mov    $0xb38df4,%edx
  80cab1:	be 00 00 00 00       	mov    $0x0,%esi
  80cab6:	c6 45 df 0a          	movb   $0xa,-0x21(%ebp)
  80caba:	bf 00 00 00 00       	mov    $0x0,%edi
  80cabf:	c6 45 e7 00          	movb   $0x0,-0x19(%ebp)
  80cac3:	b8 00 00 00 00       	mov    $0x0,%eax
  80cac8:	c6 45 e5 0a          	movb   $0xa,-0x1b(%ebp)
  80cacc:	c6 45 de 0a          	movb   $0xa,-0x22(%ebp)
  80cad0:	c6 45 dc 0a          	movb   $0xa,-0x24(%ebp)
  80cad4:	eb 22                	jmp    80caf8 <find_entry+0x75>
      /* the cached entry is stable */
      if (ip_addr_cmp(ipaddr, &arp_table[etharp_cached_entry].ipaddr)) {
  80cad6:	6b d2 1c             	imul   $0x1c,%edx,%edx
  80cad9:	8b 5d e0             	mov    -0x20(%ebp),%ebx
  80cadc:	8b 0b                	mov    (%ebx),%ecx
  80cade:	3b 8a e4 8d b3 00    	cmp    0xb38de4(%edx),%ecx
  80cae4:	75 c6                	jne    80caac <find_entry+0x29>
  80cae6:	e9 c4 01 00 00       	jmp    80ccaf <find_entry+0x22c>
        /* cached entry was the right one! */
        ETHARP_STATS_INC(etharp.cachehit);
        return etharp_cached_entry;
  80caeb:	89 ce                	mov    %ecx,%esi
  80caed:	0f b6 7d d7          	movzbl -0x29(%ebp),%edi
  80caf1:	0f b6 4d e6          	movzbl -0x1a(%ebp),%ecx
  80caf5:	88 4d e7             	mov    %cl,-0x19(%ebp)
   *    until 5 matches, or all entries are searched for.
   */

  for (i = 0; i < ARP_TABLE_SIZE; ++i) {
    /* no empty entry found yet and now we do find one? */
    if ((empty == ARP_TABLE_SIZE) && (arp_table[i].state == ETHARP_STATE_EMPTY)) {
  80caf8:	80 7d e5 0a          	cmpb   $0xa,-0x1b(%ebp)
  80cafc:	75 1c                	jne    80cb1a <find_entry+0x97>
  80cafe:	83 7a fc 00          	cmpl   $0x0,-0x4(%edx)
  80cb02:	75 16                	jne    80cb1a <find_entry+0x97>
  80cb04:	88 45 e5             	mov    %al,-0x1b(%ebp)
  80cb07:	89 f1                	mov    %esi,%ecx
  80cb09:	89 fb                	mov    %edi,%ebx
  80cb0b:	88 5d d7             	mov    %bl,-0x29(%ebp)
  80cb0e:	0f b6 5d e7          	movzbl -0x19(%ebp),%ebx
  80cb12:	88 5d e6             	mov    %bl,-0x1a(%ebp)
  80cb15:	e9 a0 00 00 00       	jmp    80cbba <find_entry+0x137>
      LWIP_DEBUGF(ETHARP_DEBUG, ("find_entry: found empty entry %"U16_F"\n", (u16_t)i));
      /* remember first empty entry */
      empty = i;
    }
    /* pending entry? */
    else if (arp_table[i].state == ETHARP_STATE_PENDING) {
  80cb1a:	8b 4a fc             	mov    -0x4(%edx),%ecx
  80cb1d:	83 f9 01             	cmp    $0x1,%ecx
  80cb20:	75 51                	jne    80cb73 <find_entry+0xf0>
      /* if given, does IP address match IP address in ARP entry? */
      if (ipaddr && ip_addr_cmp(ipaddr, &arp_table[i].ipaddr)) {
  80cb22:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  80cb26:	74 14                	je     80cb3c <find_entry+0xb9>
  80cb28:	8b 5d e0             	mov    -0x20(%ebp),%ebx
  80cb2b:	8b 0b                	mov    (%ebx),%ecx
  80cb2d:	3b 4a f0             	cmp    -0x10(%edx),%ecx
  80cb30:	75 0a                	jne    80cb3c <find_entry+0xb9>
        LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("find_entry: found matching pending entry %"U16_F"\n", (u16_t)i));
        /* found exact IP address match, simply bail out */
#if LWIP_NETIF_HWADDRHINT
        NETIF_SET_HINT(netif, i);
#else /* #if LWIP_NETIF_HWADDRHINT */
        etharp_cached_entry = i;
  80cb32:	a2 f8 8e b3 00       	mov    %al,0xb38ef8
#endif /* #if LWIP_NETIF_HWADDRHINT */
        return i;
  80cb37:	e9 73 01 00 00       	jmp    80ccaf <find_entry+0x22c>
#if ARP_QUEUEING
      /* pending with queued packets? */
      } else if (arp_table[i].q != NULL) {
  80cb3c:	83 7a ec 00          	cmpl   $0x0,-0x14(%edx)
  80cb40:	74 1a                	je     80cb5c <find_entry+0xd9>
        if (arp_table[i].ctime >= age_queue) {
  80cb42:	0f b6 0a             	movzbl (%edx),%ecx
  80cb45:	89 f3                	mov    %esi,%ebx
  80cb47:	38 cb                	cmp    %cl,%bl
  80cb49:	77 61                	ja     80cbac <find_entry+0x129>
  80cb4b:	88 45 df             	mov    %al,-0x21(%ebp)
  80cb4e:	89 fb                	mov    %edi,%ebx
  80cb50:	88 5d d7             	mov    %bl,-0x29(%ebp)
  80cb53:	0f b6 5d e7          	movzbl -0x19(%ebp),%ebx
  80cb57:	88 5d e6             	mov    %bl,-0x1a(%ebp)
  80cb5a:	eb 5e                	jmp    80cbba <find_entry+0x137>
          age_queue = arp_table[i].ctime;
        }
#endif
      /* pending without queued packets? */
      } else {
        if (arp_table[i].ctime >= age_pending) {
  80cb5c:	0f b6 0a             	movzbl (%edx),%ecx
  80cb5f:	88 4d e6             	mov    %cl,-0x1a(%ebp)
  80cb62:	38 4d e7             	cmp    %cl,-0x19(%ebp)
  80cb65:	77 45                	ja     80cbac <find_entry+0x129>
  80cb67:	88 45 dc             	mov    %al,-0x24(%ebp)
  80cb6a:	89 f1                	mov    %esi,%ecx
  80cb6c:	89 fb                	mov    %edi,%ebx
  80cb6e:	88 5d d7             	mov    %bl,-0x29(%ebp)
  80cb71:	eb 47                	jmp    80cbba <find_entry+0x137>
          age_pending = arp_table[i].ctime;
        }
      }        
    }
    /* stable entry? */
    else if (arp_table[i].state == ETHARP_STATE_STABLE) {
  80cb73:	83 f9 02             	cmp    $0x2,%ecx
  80cb76:	75 34                	jne    80cbac <find_entry+0x129>
      /* if given, does IP address match IP address in ARP entry? */
      if (ipaddr && ip_addr_cmp(ipaddr, &arp_table[i].ipaddr)) {
  80cb78:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  80cb7c:	74 14                	je     80cb92 <find_entry+0x10f>
  80cb7e:	8b 5d e0             	mov    -0x20(%ebp),%ebx
  80cb81:	8b 0b                	mov    (%ebx),%ecx
  80cb83:	3b 4a f0             	cmp    -0x10(%edx),%ecx
  80cb86:	75 0a                	jne    80cb92 <find_entry+0x10f>
        LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("find_entry: found matching stable entry %"U16_F"\n", (u16_t)i));
        /* found exact IP address match, simply bail out */
#if LWIP_NETIF_HWADDRHINT
        NETIF_SET_HINT(netif, i);
#else /* #if LWIP_NETIF_HWADDRHINT */
        etharp_cached_entry = i;
  80cb88:	a2 f8 8e b3 00       	mov    %al,0xb38ef8
#endif /* #if LWIP_NETIF_HWADDRHINT */
        return i;
  80cb8d:	e9 1d 01 00 00       	jmp    80ccaf <find_entry+0x22c>
      /* remember entry with oldest stable entry in oldest, its age in maxtime */
      } else if (arp_table[i].ctime >= age_stable) {
  80cb92:	0f b6 0a             	movzbl (%edx),%ecx
  80cb95:	88 4d d7             	mov    %cl,-0x29(%ebp)
  80cb98:	89 fb                	mov    %edi,%ebx
  80cb9a:	38 cb                	cmp    %cl,%bl
  80cb9c:	77 0e                	ja     80cbac <find_entry+0x129>
  80cb9e:	88 45 de             	mov    %al,-0x22(%ebp)
  80cba1:	89 f1                	mov    %esi,%ecx
  80cba3:	0f b6 5d e7          	movzbl -0x19(%ebp),%ebx
  80cba7:	88 5d e6             	mov    %bl,-0x1a(%ebp)
  80cbaa:	eb 0e                	jmp    80cbba <find_entry+0x137>
  80cbac:	89 f1                	mov    %esi,%ecx
  80cbae:	89 fb                	mov    %edi,%ebx
  80cbb0:	88 5d d7             	mov    %bl,-0x29(%ebp)
  80cbb3:	0f b6 5d e7          	movzbl -0x19(%ebp),%ebx
  80cbb7:	88 5d e6             	mov    %bl,-0x1a(%ebp)
   * 4) remember the oldest pending entry with queued packets (if any)
   * 5) search for a matching IP entry, either pending or stable
   *    until 5 matches, or all entries are searched for.
   */

  for (i = 0; i < ARP_TABLE_SIZE; ++i) {
  80cbba:	83 c0 01             	add    $0x1,%eax
  80cbbd:	83 c2 1c             	add    $0x1c,%edx
  80cbc0:	3c 0a                	cmp    $0xa,%al
  80cbc2:	0f 85 23 ff ff ff    	jne    80caeb <find_entry+0x68>
    }
  }
  /* { we have no match } => try to create a new entry */
   
  /* no empty entry found and not allowed to recycle? */
  if (((empty == ARP_TABLE_SIZE) && ((flags & ETHARP_TRY_HARD) == 0))
  80cbc8:	80 7d e5 0a          	cmpb   $0xa,-0x1b(%ebp)
  80cbcc:	75 0a                	jne    80cbd8 <find_entry+0x155>
  80cbce:	f6 45 dd 01          	testb  $0x1,-0x23(%ebp)
  80cbd2:	0f 84 d2 00 00 00    	je     80ccaa <find_entry+0x227>
  80cbd8:	f6 45 dd 02          	testb  $0x2,-0x23(%ebp)
  80cbdc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  80cbe0:	0f 85 c4 00 00 00    	jne    80ccaa <find_entry+0x227>
   * { ETHARP_TRY_HARD is set at this point }
   */ 

  /* 1) empty entry available? */
  if (empty < ARP_TABLE_SIZE) {
    i = empty;
  80cbe6:	0f b6 5d e5          	movzbl -0x1b(%ebp),%ebx
   * 
   * { ETHARP_TRY_HARD is set at this point }
   */ 

  /* 1) empty entry available? */
  if (empty < ARP_TABLE_SIZE) {
  80cbea:	80 fb 09             	cmp    $0x9,%bl
  80cbed:	8d 76 00             	lea    0x0(%esi),%esi
  80cbf0:	7e 62                	jle    80cc54 <find_entry+0x1d1>
    i = empty;
    LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("find_entry: selecting empty entry %"U16_F"\n", (u16_t)i));
  }
  /* 2) found recyclable stable entry? */
  else if (old_stable < ARP_TABLE_SIZE) {
  80cbf2:	80 7d de 09          	cmpb   $0x9,-0x22(%ebp)
  80cbf6:	7f 2f                	jg     80cc27 <find_entry+0x1a4>
    /* recycle oldest stable*/
    i = old_stable;
  80cbf8:	0f b6 5d de          	movzbl -0x22(%ebp),%ebx
    LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("find_entry: selecting oldest stable entry %"U16_F"\n", (u16_t)i));
#if ARP_QUEUEING
    /* no queued packets should exist on stable entries */
    LWIP_ASSERT("arp_table[i].q == NULL", arp_table[i].q == NULL);
  80cbfc:	0f b6 c3             	movzbl %bl,%eax
  80cbff:	6b c0 1c             	imul   $0x1c,%eax,%eax
  80cc02:	83 b8 e0 8d b3 00 00 	cmpl   $0x0,0xb38de0(%eax)
  80cc09:	74 49                	je     80cc54 <find_entry+0x1d1>
  80cc0b:	c7 44 24 08 b7 41 81 	movl   $0x8141b7,0x8(%esp)
  80cc12:	00 
  80cc13:	c7 44 24 04 75 01 00 	movl   $0x175,0x4(%esp)
  80cc1a:	00 
  80cc1b:	c7 04 24 85 41 81 00 	movl   $0x814185,(%esp)
  80cc22:	e8 75 3d ff ff       	call   80099c <_panic>
#endif
  /* 3) found recyclable pending entry without queued packets? */
  } else if (old_pending < ARP_TABLE_SIZE) {
    /* recycle oldest pending */
    i = old_pending;
  80cc27:	0f b6 5d dc          	movzbl -0x24(%ebp),%ebx
#if ARP_QUEUEING
    /* no queued packets should exist on stable entries */
    LWIP_ASSERT("arp_table[i].q == NULL", arp_table[i].q == NULL);
#endif
  /* 3) found recyclable pending entry without queued packets? */
  } else if (old_pending < ARP_TABLE_SIZE) {
  80cc2b:	80 fb 09             	cmp    $0x9,%bl
  80cc2e:	7e 24                	jle    80cc54 <find_entry+0x1d1>
    /* recycle oldest pending */
    i = old_pending;
    LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("find_entry: selecting oldest pending entry %"U16_F" (without queue)\n", (u16_t)i));
#if ARP_QUEUEING
  /* 4) found recyclable pending entry with queued packets? */
  } else if (old_queue < ARP_TABLE_SIZE) {
  80cc30:	80 7d df 09          	cmpb   $0x9,-0x21(%ebp)
  80cc34:	7f 74                	jg     80ccaa <find_entry+0x227>
    /* recycle oldest pending */
    i = old_queue;
  80cc36:	0f b6 5d df          	movzbl -0x21(%ebp),%ebx
    LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("find_entry: selecting oldest pending entry %"U16_F", freeing packet queue %p\n", (u16_t)i, (void *)(arp_table[i].q)));
    free_etharp_q(arp_table[i].q);
  80cc3a:	0f b6 f3             	movzbl %bl,%esi
  80cc3d:	bf e0 8d b3 00       	mov    $0xb38de0,%edi
  80cc42:	6b f6 1c             	imul   $0x1c,%esi,%esi
  80cc45:	8b 04 3e             	mov    (%esi,%edi,1),%eax
  80cc48:	e8 99 fd ff ff       	call   80c9e6 <free_etharp_q>
    arp_table[i].q = NULL;
  80cc4d:	c7 04 3e 00 00 00 00 	movl   $0x0,(%esi,%edi,1)
  } else {
    return (s8_t)ERR_MEM;
  }

  /* { empty or recyclable entry found } */
  LWIP_ASSERT("i < ARP_TABLE_SIZE", i < ARP_TABLE_SIZE);
  80cc54:	80 fb 09             	cmp    $0x9,%bl
  80cc57:	76 1c                	jbe    80cc75 <find_entry+0x1f2>
  80cc59:	c7 44 24 08 ce 41 81 	movl   $0x8141ce,0x8(%esp)
  80cc60:	00 
  80cc61:	c7 44 24 04 8b 01 00 	movl   $0x18b,0x4(%esp)
  80cc68:	00 
  80cc69:	c7 04 24 85 41 81 00 	movl   $0x814185,(%esp)
  80cc70:	e8 27 3d ff ff       	call   80099c <_panic>
  if (arp_table[i].state != ETHARP_STATE_EMPTY)
  {
    snmp_delete_arpidx_tree(arp_table[i].netif, &arp_table[i].ipaddr);
  }
  /* recycle entry (no-op for an already empty entry) */
  arp_table[i].state = ETHARP_STATE_EMPTY;
  80cc75:	0f b6 c3             	movzbl %bl,%eax
  80cc78:	6b d0 1c             	imul   $0x1c,%eax,%edx
  80cc7b:	c7 82 f0 8d b3 00 00 	movl   $0x0,0xb38df0(%edx)
  80cc82:	00 00 00 

  /* IP address given? */
  if (ipaddr != NULL) {
  80cc85:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  80cc89:	74 0b                	je     80cc96 <find_entry+0x213>
    /* set IP address */
    ip_addr_set(&arp_table[i].ipaddr, ipaddr);
  80cc8b:	8b 75 e0             	mov    -0x20(%ebp),%esi
  80cc8e:	8b 0e                	mov    (%esi),%ecx
  80cc90:	89 8a e4 8d b3 00    	mov    %ecx,0xb38de4(%edx)
  }
  arp_table[i].ctime = 0;
  80cc96:	6b c0 1c             	imul   $0x1c,%eax,%eax
  80cc99:	c6 80 f4 8d b3 00 00 	movb   $0x0,0xb38df4(%eax)
#if LWIP_NETIF_HWADDRHINT
  NETIF_SET_HINT(netif, i);
#else /* #if LWIP_NETIF_HWADDRHINT */
  etharp_cached_entry = i;
  80cca0:	88 1d f8 8e b3 00    	mov    %bl,0xb38ef8
#endif /* #if LWIP_NETIF_HWADDRHINT */
  return (err_t)i;
  80cca6:	89 d8                	mov    %ebx,%eax
  80cca8:	eb 05                	jmp    80ccaf <find_entry+0x22c>
  80ccaa:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
  80ccaf:	83 c4 3c             	add    $0x3c,%esp
  80ccb2:	5b                   	pop    %ebx
  80ccb3:	5e                   	pop    %esi
  80ccb4:	5f                   	pop    %edi
  80ccb5:	5d                   	pop    %ebp
  80ccb6:	c3                   	ret    

0080ccb7 <etharp_query>:
 * - ERR_ARG Non-unicast address given, those will not appear in ARP cache.
 *
 */
err_t
etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q)
{
  80ccb7:	55                   	push   %ebp
  80ccb8:	89 e5                	mov    %esp,%ebp
  80ccba:	83 ec 38             	sub    $0x38,%esp
  80ccbd:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  80ccc0:	89 75 f8             	mov    %esi,-0x8(%ebp)
  80ccc3:	89 7d fc             	mov    %edi,-0x4(%ebp)
  80ccc6:	8b 75 08             	mov    0x8(%ebp),%esi
  80ccc9:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  struct eth_addr * srcaddr = (struct eth_addr *)netif->hwaddr;
  err_t result = ERR_MEM;
  s8_t i; /* ARP entry index */

  /* non-unicast address? */
  if (ip_addr_isbroadcast(ipaddr, netif) ||
  80cccc:	89 74 24 04          	mov    %esi,0x4(%esp)
  80ccd0:	89 1c 24             	mov    %ebx,(%esp)
  80ccd3:	e8 10 cc ff ff       	call   8098e8 <ip_addr_isbroadcast>
  80ccd8:	84 c0                	test   %al,%al
  80ccda:	0f 85 c4 01 00 00    	jne    80cea4 <etharp_query+0x1ed>
      ip_addr_ismulticast(ipaddr) ||
  80cce0:	8b 03                	mov    (%ebx),%eax
  80cce2:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  80cce5:	c7 04 24 00 00 00 f0 	movl   $0xf0000000,(%esp)
  80ccec:	e8 44 e2 ff ff       	call   80af35 <ntohl>
  80ccf1:	89 c7                	mov    %eax,%edi
  80ccf3:	c7 04 24 00 00 00 e0 	movl   $0xe0000000,(%esp)
  80ccfa:	e8 36 e2 ff ff       	call   80af35 <ntohl>
  struct eth_addr * srcaddr = (struct eth_addr *)netif->hwaddr;
  err_t result = ERR_MEM;
  s8_t i; /* ARP entry index */

  /* non-unicast address? */
  if (ip_addr_isbroadcast(ipaddr, netif) ||
  80ccff:	23 7d e4             	and    -0x1c(%ebp),%edi
  80cd02:	39 c7                	cmp    %eax,%edi
  80cd04:	0f 84 9a 01 00 00    	je     80cea4 <etharp_query+0x1ed>
  80cd0a:	85 db                	test   %ebx,%ebx
  80cd0c:	0f 84 92 01 00 00    	je     80cea4 <etharp_query+0x1ed>
      ip_addr_ismulticast(ipaddr) ||
      ip_addr_isany(ipaddr)) {
  80cd12:	83 3b 00             	cmpl   $0x0,(%ebx)
  80cd15:	0f 84 89 01 00 00    	je     80cea4 <etharp_query+0x1ed>

  /* find entry in ARP cache, ask to create entry if queueing packet */
#if LWIP_NETIF_HWADDRHINT
  i = find_entry(ipaddr, ETHARP_TRY_HARD, netif);
#else /* LWIP_NETIF_HWADDRHINT */
  i = find_entry(ipaddr, ETHARP_TRY_HARD);
  80cd1b:	ba 01 00 00 00       	mov    $0x1,%edx
  80cd20:	89 d8                	mov    %ebx,%eax
  80cd22:	e8 5c fd ff ff       	call   80ca83 <find_entry>
#endif /* LWIP_NETIF_HWADDRHINT */

  /* could not find or create entry? */
  if (i < 0) {
  80cd27:	84 c0                	test   %al,%al
  80cd29:	0f 88 80 01 00 00    	js     80ceaf <etharp_query+0x1f8>
    }
    return (err_t)i;
  }

  /* mark a fresh entry as pending (we just sent a request) */
  if (arp_table[i].state == ETHARP_STATE_EMPTY) {
  80cd2f:	0f be f8             	movsbl %al,%edi
  80cd32:	6b c7 1c             	imul   $0x1c,%edi,%eax
  80cd35:	8b 80 f0 8d b3 00    	mov    0xb38df0(%eax),%eax
  80cd3b:	85 c0                	test   %eax,%eax
  80cd3d:	75 0f                	jne    80cd4e <etharp_query+0x97>
    arp_table[i].state = ETHARP_STATE_PENDING;
  80cd3f:	6b c7 1c             	imul   $0x1c,%edi,%eax
  80cd42:	c7 80 f0 8d b3 00 01 	movl   $0x1,0xb38df0(%eax)
  80cd49:	00 00 00 
  80cd4c:	eb 33                	jmp    80cd81 <etharp_query+0xca>
  }

  /* { i is either a STABLE or (new or existing) PENDING entry } */
  LWIP_ASSERT("arp_table[i].state == PENDING or STABLE",
  80cd4e:	8d 50 ff             	lea    -0x1(%eax),%edx
  80cd51:	83 fa 01             	cmp    $0x1,%edx
  80cd54:	76 1c                	jbe    80cd72 <etharp_query+0xbb>
  80cd56:	c7 44 24 08 14 41 81 	movl   $0x814114,0x8(%esp)
  80cd5d:	00 
  80cd5e:	c7 44 24 04 92 03 00 	movl   $0x392,0x4(%esp)
  80cd65:	00 
  80cd66:	c7 04 24 85 41 81 00 	movl   $0x814185,(%esp)
  80cd6d:	e8 2a 3c ff ff       	call   80099c <_panic>
  ((arp_table[i].state == ETHARP_STATE_PENDING) ||
   (arp_table[i].state == ETHARP_STATE_STABLE)));

  /* do we have a pending entry? or an implicit query request? */
  if ((arp_table[i].state == ETHARP_STATE_PENDING) || (q == NULL)) {
  80cd72:	83 f8 01             	cmp    $0x1,%eax
  80cd75:	74 0a                	je     80cd81 <etharp_query+0xca>
  80cd77:	c6 45 e4 ff          	movb   $0xff,-0x1c(%ebp)
  80cd7b:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  80cd7f:	75 0f                	jne    80cd90 <etharp_query+0xd9>
    /* try to resolve it; send out ARP request */
    result = etharp_request(netif, ipaddr);
  80cd81:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  80cd85:	89 34 24             	mov    %esi,(%esp)
  80cd88:	e8 12 fb ff ff       	call   80c89f <etharp_request>
  80cd8d:	88 45 e4             	mov    %al,-0x1c(%ebp)
         etharp_query again could lead to sending the queued packets. */
    }
  }
  
  /* packet given? */
  if (q != NULL) {
  80cd90:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  80cd94:	0f 84 11 01 00 00    	je     80ceab <etharp_query+0x1f4>
    /* stable entry? */
    if (arp_table[i].state == ETHARP_STATE_STABLE) {
  80cd9a:	6b c7 1c             	imul   $0x1c,%edi,%eax
  80cd9d:	8b 80 f0 8d b3 00    	mov    0xb38df0(%eax),%eax
  80cda3:	83 f8 02             	cmp    $0x2,%eax
  80cda6:	75 1d                	jne    80cdc5 <etharp_query+0x10e>
      /* we have a valid IP->Ethernet address mapping */
      /* send the packet */
      result = etharp_send_ip(netif, q, srcaddr, &(arp_table[i].ethaddr));
  80cda8:	8d 4e 25             	lea    0x25(%esi),%ecx
  80cdab:	6b c7 1c             	imul   $0x1c,%edi,%eax
  80cdae:	05 e8 8d b3 00       	add    $0xb38de8,%eax
  80cdb3:	89 04 24             	mov    %eax,(%esp)
  80cdb6:	8b 55 10             	mov    0x10(%ebp),%edx
  80cdb9:	89 f0                	mov    %esi,%eax
  80cdbb:	e8 60 fa ff ff       	call   80c820 <etharp_send_ip>
  80cdc0:	e9 ea 00 00 00       	jmp    80ceaf <etharp_query+0x1f8>
    /* pending entry? (either just created or already pending */
    } else if (arp_table[i].state == ETHARP_STATE_PENDING) {
  80cdc5:	83 f8 01             	cmp    $0x1,%eax
  80cdc8:	0f 85 dd 00 00 00    	jne    80ceab <etharp_query+0x1f4>
  80cdce:	8b 45 10             	mov    0x10(%ebp),%eax
      /* IF q includes a PBUF_REF, PBUF_POOL or PBUF_RAM, we have no choice but
       * to copy the whole queue into a new PBUF_RAM (see bug #11400) 
       * PBUF_ROMs can be left as they are, since ROM must not get changed. */
      p = q;
      while (p) {
        LWIP_ASSERT("no packet queues allowed!", (p->len != p->tot_len) || (p->next == 0));
  80cdd1:	0f b7 50 08          	movzwl 0x8(%eax),%edx
  80cdd5:	66 39 50 0a          	cmp    %dx,0xa(%eax)
  80cdd9:	75 21                	jne    80cdfc <etharp_query+0x145>
  80cddb:	83 38 00             	cmpl   $0x0,(%eax)
  80cdde:	74 1c                	je     80cdfc <etharp_query+0x145>
  80cde0:	c7 44 24 08 e1 41 81 	movl   $0x8141e1,0x8(%esp)
  80cde7:	00 
  80cde8:	c7 44 24 04 b1 03 00 	movl   $0x3b1,0x4(%esp)
  80cdef:	00 
  80cdf0:	c7 04 24 85 41 81 00 	movl   $0x814185,(%esp)
  80cdf7:	e8 a0 3b ff ff       	call   80099c <_panic>
        if(p->type != PBUF_ROM) {
  80cdfc:	80 78 0c 01          	cmpb   $0x1,0xc(%eax)
  80ce00:	75 0b                	jne    80ce0d <etharp_query+0x156>
          copy_needed = 1;
          break;
        }
        p = p->next;
  80ce02:	8b 00                	mov    (%eax),%eax
      int copy_needed = 0;
      /* IF q includes a PBUF_REF, PBUF_POOL or PBUF_RAM, we have no choice but
       * to copy the whole queue into a new PBUF_RAM (see bug #11400) 
       * PBUF_ROMs can be left as they are, since ROM must not get changed. */
      p = q;
      while (p) {
  80ce04:	85 c0                	test   %eax,%eax
  80ce06:	75 c9                	jne    80cdd1 <etharp_query+0x11a>
  80ce08:	e9 af 00 00 00       	jmp    80cebc <etharp_query+0x205>
        }
        p = p->next;
      }
      if(copy_needed) {
        /* copy the whole packet into new pbufs */
        p = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM);
  80ce0d:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80ce14:	00 
  80ce15:	0f b7 d2             	movzwl %dx,%edx
  80ce18:	89 54 24 04          	mov    %edx,0x4(%esp)
  80ce1c:	c7 04 24 03 00 00 00 	movl   $0x3,(%esp)
  80ce23:	e8 91 b3 ff ff       	call   8081b9 <pbuf_alloc>
  80ce28:	89 c3                	mov    %eax,%ebx
        if(p != NULL) {
  80ce2a:	85 c0                	test   %eax,%eax
  80ce2c:	74 7d                	je     80ceab <etharp_query+0x1f4>
          if (pbuf_copy(p, q) != ERR_OK) {
  80ce2e:	8b 45 10             	mov    0x10(%ebp),%eax
  80ce31:	89 44 24 04          	mov    %eax,0x4(%esp)
  80ce35:	89 1c 24             	mov    %ebx,(%esp)
  80ce38:	e8 17 af ff ff       	call   807d54 <pbuf_copy>
  80ce3d:	84 c0                	test   %al,%al
  80ce3f:	74 0e                	je     80ce4f <etharp_query+0x198>
            pbuf_free(p);
  80ce41:	89 1c 24             	mov    %ebx,(%esp)
  80ce44:	e8 b4 b0 ff ff       	call   807efd <pbuf_free>
  80ce49:	0f b6 45 e4          	movzbl -0x1c(%ebp),%eax
  80ce4d:	eb 60                	jmp    80ceaf <etharp_query+0x1f8>
      /* packet could be taken over? */
      if (p != NULL) {
        /* queue packet ... */
        struct etharp_q_entry *new_entry;
        /* allocate a new arp queue entry */
        new_entry = memp_malloc(MEMP_ARP_QUEUE);
  80ce4f:	c7 04 24 0a 00 00 00 	movl   $0xa,(%esp)
  80ce56:	e8 5d a9 ff ff       	call   8077b8 <memp_malloc>
        if (new_entry != NULL) {
  80ce5b:	85 c0                	test   %eax,%eax
  80ce5d:	74 37                	je     80ce96 <etharp_query+0x1df>
          new_entry->next = 0;
  80ce5f:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
          new_entry->p = p;
  80ce65:	89 58 04             	mov    %ebx,0x4(%eax)
          if(arp_table[i].q != NULL) {
  80ce68:	6b d7 1c             	imul   $0x1c,%edi,%edx
  80ce6b:	8b 92 e0 8d b3 00    	mov    0xb38de0(%edx),%edx
  80ce71:	85 d2                	test   %edx,%edx
  80ce73:	74 11                	je     80ce86 <etharp_query+0x1cf>
            /* queue was already existent, append the new entry to the end */
            struct etharp_q_entry *r;
            r = arp_table[i].q;
            while (r->next != NULL) {
  80ce75:	89 d1                	mov    %edx,%ecx
  80ce77:	8b 12                	mov    (%edx),%edx
  80ce79:	85 d2                	test   %edx,%edx
  80ce7b:	75 f8                	jne    80ce75 <etharp_query+0x1be>
              r = r->next;
            }
            r->next = new_entry;
  80ce7d:	89 01                	mov    %eax,(%ecx)
  80ce7f:	b8 00 00 00 00       	mov    $0x0,%eax
  80ce84:	eb 29                	jmp    80ceaf <etharp_query+0x1f8>
          } else {
            /* queue did not exist, first item in queue */
            arp_table[i].q = new_entry;
  80ce86:	6b ff 1c             	imul   $0x1c,%edi,%edi
  80ce89:	89 87 e0 8d b3 00    	mov    %eax,0xb38de0(%edi)
  80ce8f:	b8 00 00 00 00       	mov    $0x0,%eax
  80ce94:	eb 19                	jmp    80ceaf <etharp_query+0x1f8>
          }
          LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: queued packet %p on ARP entry %"S16_F"\n", (void *)q, (s16_t)i));
          result = ERR_OK;
        } else {
          /* the pool MEMP_ARP_QUEUE is empty */
          pbuf_free(p);
  80ce96:	89 1c 24             	mov    %ebx,(%esp)
  80ce99:	e8 5f b0 ff ff       	call   807efd <pbuf_free>
  80ce9e:	0f b6 45 e4          	movzbl -0x1c(%ebp),%eax
          LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: could not queue a copy of PBUF_REF packet %p (out of memory)\n", (void *)q));
  80cea2:	eb 0b                	jmp    80ceaf <etharp_query+0x1f8>
  80cea4:	b8 f6 ff ff ff       	mov    $0xfffffff6,%eax
  80cea9:	eb 04                	jmp    80ceaf <etharp_query+0x1f8>
  80ceab:	0f b6 45 e4          	movzbl -0x1c(%ebp),%eax
      LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: Ethernet destination address unknown, queueing disabled, packet %p dropped\n", (void *)q));
#endif
    }
  }
  return result;
}
  80ceaf:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  80ceb2:	8b 75 f8             	mov    -0x8(%ebp),%esi
  80ceb5:	8b 7d fc             	mov    -0x4(%ebp),%edi
  80ceb8:	89 ec                	mov    %ebp,%esp
  80ceba:	5d                   	pop    %ebp
  80cebb:	c3                   	ret    
          }
        }
      } else {
        /* referencing the old pbuf is enough */
        p = q;
        pbuf_ref(p);
  80cebc:	8b 45 10             	mov    0x10(%ebp),%eax
  80cebf:	89 04 24             	mov    %eax,(%esp)
  80cec2:	e8 f3 ab ff ff       	call   807aba <pbuf_ref>
  80cec7:	8b 5d 10             	mov    0x10(%ebp),%ebx
  80ceca:	eb 83                	jmp    80ce4f <etharp_query+0x198>

0080cecc <etharp_output>:
 * - ERR_RTE No route to destination (no gateway to external networks),
 * or the return type of either etharp_query() or etharp_send_ip().
 */
err_t
etharp_output(struct netif *netif, struct pbuf *q, struct ip_addr *ipaddr)
{
  80cecc:	55                   	push   %ebp
  80cecd:	89 e5                	mov    %esp,%ebp
  80cecf:	83 ec 48             	sub    $0x48,%esp
  80ced2:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  80ced5:	89 75 f8             	mov    %esi,-0x8(%ebp)
  80ced8:	89 7d fc             	mov    %edi,-0x4(%ebp)
  80cedb:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80cede:	8b 75 0c             	mov    0xc(%ebp),%esi
  80cee1:	8b 7d 10             	mov    0x10(%ebp),%edi
  struct eth_addr *dest, mcastaddr;

  /* make room for Ethernet header - should not fail */
  if (pbuf_header(q, sizeof(struct eth_hdr)) != 0) {
  80cee4:	c7 44 24 04 0e 00 00 	movl   $0xe,0x4(%esp)
  80ceeb:	00 
  80ceec:	89 34 24             	mov    %esi,(%esp)
  80ceef:	e8 9f ac ff ff       	call   807b93 <pbuf_header>
  80cef4:	89 c2                	mov    %eax,%edx
  80cef6:	b8 fe ff ff ff       	mov    $0xfffffffe,%eax
  80cefb:	84 d2                	test   %dl,%dl
  80cefd:	0f 85 bd 00 00 00    	jne    80cfc0 <etharp_output+0xf4>
  dest = NULL;
  /* Determine on destination hardware address. Broadcasts and multicasts
   * are special, other IP addresses are looked up in the ARP table. */

  /* broadcast destination IP address? */
  if (ip_addr_isbroadcast(ipaddr, netif)) {
  80cf03:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  80cf07:	89 3c 24             	mov    %edi,(%esp)
  80cf0a:	e8 d9 c9 ff ff       	call   8098e8 <ip_addr_isbroadcast>
        /* no route to destination error (default gateway missing) */
        return ERR_RTE;
      }
    }
    /* queue on destination Ethernet address belonging to ipaddr */
    return etharp_query(netif, ipaddr, q);
  80cf0f:	ba fb 41 81 00       	mov    $0x8141fb,%edx
  dest = NULL;
  /* Determine on destination hardware address. Broadcasts and multicasts
   * are special, other IP addresses are looked up in the ARP table. */

  /* broadcast destination IP address? */
  if (ip_addr_isbroadcast(ipaddr, netif)) {
  80cf14:	84 c0                	test   %al,%al
  80cf16:	0f 85 95 00 00 00    	jne    80cfb1 <etharp_output+0xe5>
    /* broadcast on Ethernet also */
    dest = (struct eth_addr *)&ethbroadcast;
  /* multicast destination IP address? */
  } else if (ip_addr_ismulticast(ipaddr)) {
  80cf1c:	8b 07                	mov    (%edi),%eax
  80cf1e:	89 45 d0             	mov    %eax,-0x30(%ebp)
  80cf21:	c7 04 24 00 00 00 f0 	movl   $0xf0000000,(%esp)
  80cf28:	e8 08 e0 ff ff       	call   80af35 <ntohl>
  80cf2d:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  80cf30:	c7 04 24 00 00 00 e0 	movl   $0xe0000000,(%esp)
  80cf37:	e8 f9 df ff ff       	call   80af35 <ntohl>
  80cf3c:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  80cf3f:	23 55 d0             	and    -0x30(%ebp),%edx
  80cf42:	39 c2                	cmp    %eax,%edx
  80cf44:	75 41                	jne    80cf87 <etharp_output+0xbb>
    /* Hash IP multicast address to MAC address.*/
    mcastaddr.addr[0] = 0x01;
  80cf46:	c6 45 e2 01          	movb   $0x1,-0x1e(%ebp)
    mcastaddr.addr[1] = 0x00;
  80cf4a:	c6 45 e3 00          	movb   $0x0,-0x1d(%ebp)
    mcastaddr.addr[2] = 0x5e;
  80cf4e:	c6 45 e4 5e          	movb   $0x5e,-0x1c(%ebp)
    mcastaddr.addr[3] = ip4_addr2(ipaddr) & 0x7f;
  80cf52:	8b 07                	mov    (%edi),%eax
  80cf54:	89 04 24             	mov    %eax,(%esp)
  80cf57:	e8 d9 df ff ff       	call   80af35 <ntohl>
  80cf5c:	c1 e8 10             	shr    $0x10,%eax
  80cf5f:	83 e0 7f             	and    $0x7f,%eax
  80cf62:	88 45 e5             	mov    %al,-0x1b(%ebp)
    mcastaddr.addr[4] = ip4_addr3(ipaddr);
  80cf65:	8b 07                	mov    (%edi),%eax
  80cf67:	89 04 24             	mov    %eax,(%esp)
  80cf6a:	e8 c6 df ff ff       	call   80af35 <ntohl>
  80cf6f:	c1 e8 08             	shr    $0x8,%eax
  80cf72:	88 45 e6             	mov    %al,-0x1a(%ebp)
    mcastaddr.addr[5] = ip4_addr4(ipaddr);
  80cf75:	8b 07                	mov    (%edi),%eax
  80cf77:	89 04 24             	mov    %eax,(%esp)
  80cf7a:	e8 b6 df ff ff       	call   80af35 <ntohl>
  80cf7f:	88 45 e7             	mov    %al,-0x19(%ebp)
  80cf82:	8d 55 e2             	lea    -0x1e(%ebp),%edx
  80cf85:	eb 2a                	jmp    80cfb1 <etharp_output+0xe5>
    /* destination Ethernet address is multicast */
    dest = &mcastaddr;
  /* unicast destination IP address? */
  } else {
    /* outside local network? */
    if (!ip_addr_netcmp(ipaddr, &(netif->ip_addr), &(netif->netmask))) {
  80cf87:	8b 43 04             	mov    0x4(%ebx),%eax
  80cf8a:	33 07                	xor    (%edi),%eax
  80cf8c:	85 43 08             	test   %eax,0x8(%ebx)
  80cf8f:	74 0e                	je     80cf9f <etharp_output+0xd3>
      /* interface has default gateway? */
      if (netif->gw.addr != 0) {
  80cf91:	b8 fc ff ff ff       	mov    $0xfffffffc,%eax
  80cf96:	83 7b 0c 00          	cmpl   $0x0,0xc(%ebx)
  80cf9a:	74 24                	je     80cfc0 <etharp_output+0xf4>
        /* send to hardware address of default gateway IP address */
        ipaddr = &(netif->gw);
  80cf9c:	8d 7b 0c             	lea    0xc(%ebx),%edi
        /* no route to destination error (default gateway missing) */
        return ERR_RTE;
      }
    }
    /* queue on destination Ethernet address belonging to ipaddr */
    return etharp_query(netif, ipaddr, q);
  80cf9f:	89 74 24 08          	mov    %esi,0x8(%esp)
  80cfa3:	89 7c 24 04          	mov    %edi,0x4(%esp)
  80cfa7:	89 1c 24             	mov    %ebx,(%esp)
  80cfaa:	e8 08 fd ff ff       	call   80ccb7 <etharp_query>
  80cfaf:	eb 0f                	jmp    80cfc0 <etharp_output+0xf4>
  }

  /* continuation for multicast/broadcast destinations */
  /* obtain source Ethernet address of the given interface */
  /* send packet directly on the link */
  return etharp_send_ip(netif, q, (struct eth_addr*)(netif->hwaddr), dest);
  80cfb1:	8d 4b 25             	lea    0x25(%ebx),%ecx
  80cfb4:	89 14 24             	mov    %edx,(%esp)
  80cfb7:	89 f2                	mov    %esi,%edx
  80cfb9:	89 d8                	mov    %ebx,%eax
  80cfbb:	e8 60 f8 ff ff       	call   80c820 <etharp_send_ip>
}
  80cfc0:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  80cfc3:	8b 75 f8             	mov    -0x8(%ebp),%esi
  80cfc6:	8b 7d fc             	mov    -0x4(%ebp),%edi
  80cfc9:	89 ec                	mov    %ebp,%esp
  80cfcb:	5d                   	pop    %ebp
  80cfcc:	c3                   	ret    

0080cfcd <etharp_find_addr>:
 * @return table index if found, -1 otherwise
 */
s8_t
etharp_find_addr(struct netif *netif, struct ip_addr *ipaddr,
         struct eth_addr **eth_ret, struct ip_addr **ip_ret)
{
  80cfcd:	55                   	push   %ebp
  80cfce:	89 e5                	mov    %esp,%ebp
  80cfd0:	53                   	push   %ebx
  80cfd1:	83 ec 04             	sub    $0x4,%esp
  LWIP_UNUSED_ARG(netif);

#if LWIP_NETIF_HWADDRHINT
  i = find_entry(ipaddr, ETHARP_FIND_ONLY, NULL);
#else /* LWIP_NETIF_HWADDRHINT */
  i = find_entry(ipaddr, ETHARP_FIND_ONLY);
  80cfd4:	ba 02 00 00 00       	mov    $0x2,%edx
  80cfd9:	8b 45 0c             	mov    0xc(%ebp),%eax
  80cfdc:	e8 a2 fa ff ff       	call   80ca83 <find_entry>
#endif /* LWIP_NETIF_HWADDRHINT */
  if((i >= 0) && arp_table[i].state == ETHARP_STATE_STABLE) {
  80cfe1:	84 c0                	test   %al,%al
  80cfe3:	78 29                	js     80d00e <etharp_find_addr+0x41>
  80cfe5:	0f be d0             	movsbl %al,%edx
  80cfe8:	6b ca 1c             	imul   $0x1c,%edx,%ecx
  80cfeb:	83 b9 f0 8d b3 00 02 	cmpl   $0x2,0xb38df0(%ecx)
  80cff2:	75 1a                	jne    80d00e <etharp_find_addr+0x41>
      *eth_ret = &arp_table[i].ethaddr;
  80cff4:	89 ca                	mov    %ecx,%edx
  80cff6:	81 c2 e0 8d b3 00    	add    $0xb38de0,%edx
  80cffc:	8d 5a 08             	lea    0x8(%edx),%ebx
  80cfff:	8b 4d 10             	mov    0x10(%ebp),%ecx
  80d002:	89 19                	mov    %ebx,(%ecx)
      *ip_ret = &arp_table[i].ipaddr;
  80d004:	83 c2 04             	add    $0x4,%edx
  80d007:	8b 4d 14             	mov    0x14(%ebp),%ecx
  80d00a:	89 11                	mov    %edx,(%ecx)
      return i;
  80d00c:	eb 05                	jmp    80d013 <etharp_find_addr+0x46>
  80d00e:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  }
  return -1;
}
  80d013:	83 c4 04             	add    $0x4,%esp
  80d016:	5b                   	pop    %ebx
  80d017:	5d                   	pop    %ebp
  80d018:	c3                   	ret    

0080d019 <etharp_tmr>:
 * This function should be called every ETHARP_TMR_INTERVAL microseconds (5 seconds),
 * in order to expire entries in the ARP table.
 */
void
etharp_tmr(void)
{
  80d019:	55                   	push   %ebp
  80d01a:	89 e5                	mov    %esp,%ebp
  80d01c:	57                   	push   %edi
  80d01d:	56                   	push   %esi
  80d01e:	53                   	push   %ebx
  80d01f:	83 ec 0c             	sub    $0xc,%esp
  80d022:	bb 00 00 00 00       	mov    $0x0,%ebx
  u8_t i;

  LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_timer\n"));
  /* remove expired entries from the ARP table */
  for (i = 0; i < ARP_TABLE_SIZE; ++i) {
    arp_table[i].ctime++;
  80d027:	be f4 8d b3 00       	mov    $0xb38df4,%esi
    if (((arp_table[i].state == ETHARP_STATE_STABLE) &&
  80d02c:	bf f0 8d b3 00       	mov    $0xb38df0,%edi
  u8_t i;

  LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_timer\n"));
  /* remove expired entries from the ARP table */
  for (i = 0; i < ARP_TABLE_SIZE; ++i) {
    arp_table[i].ctime++;
  80d031:	0f b6 14 33          	movzbl (%ebx,%esi,1),%edx
  80d035:	83 c2 01             	add    $0x1,%edx
  80d038:	88 14 33             	mov    %dl,(%ebx,%esi,1)
    if (((arp_table[i].state == ETHARP_STATE_STABLE) &&
  80d03b:	8b 04 3b             	mov    (%ebx,%edi,1),%eax
  80d03e:	83 f8 02             	cmp    $0x2,%eax
  80d041:	75 07                	jne    80d04a <etharp_tmr+0x31>
  80d043:	80 fa ef             	cmp    $0xef,%dl
  80d046:	77 12                	ja     80d05a <etharp_tmr+0x41>
  80d048:	eb 30                	jmp    80d07a <etharp_tmr+0x61>
  80d04a:	83 f8 01             	cmp    $0x1,%eax
  80d04d:	8d 76 00             	lea    0x0(%esi),%esi
  80d050:	75 28                	jne    80d07a <etharp_tmr+0x61>
  80d052:	80 fa 01             	cmp    $0x1,%dl
  80d055:	8d 76 00             	lea    0x0(%esi),%esi
  80d058:	76 20                	jbe    80d07a <etharp_tmr+0x61>
      /* clean up entries that have just been expired */
      /* remove from SNMP ARP index tree */
      snmp_delete_arpidx_tree(arp_table[i].netif, &arp_table[i].ipaddr);
#if ARP_QUEUEING
      /* and empty packet queue */
      if (arp_table[i].q != NULL) {
  80d05a:	8b 83 e0 8d b3 00    	mov    0xb38de0(%ebx),%eax
  80d060:	85 c0                	test   %eax,%eax
  80d062:	74 0f                	je     80d073 <etharp_tmr+0x5a>
        /* remove all queued packets */
        LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_timer: freeing entry %"U16_F", packet queue %p.\n", (u16_t)i, (void *)(arp_table[i].q)));
        free_etharp_q(arp_table[i].q);
  80d064:	e8 7d f9 ff ff       	call   80c9e6 <free_etharp_q>
        arp_table[i].q = NULL;
  80d069:	c7 83 e0 8d b3 00 00 	movl   $0x0,0xb38de0(%ebx)
  80d070:	00 00 00 
      }
#endif
      /* recycle entry for re-use */      
      arp_table[i].state = ETHARP_STATE_EMPTY;
  80d073:	c7 04 3b 00 00 00 00 	movl   $0x0,(%ebx,%edi,1)
  80d07a:	83 c3 1c             	add    $0x1c,%ebx
{
  u8_t i;

  LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_timer\n"));
  /* remove expired entries from the ARP table */
  for (i = 0; i < ARP_TABLE_SIZE; ++i) {
  80d07d:	81 fb 18 01 00 00    	cmp    $0x118,%ebx
  80d083:	75 ac                	jne    80d031 <etharp_tmr+0x18>
    if (arp_table[i].state == ETHARP_STATE_PENDING) {
        /* resend an ARP query here? */
    }
#endif
  }
}
  80d085:	83 c4 0c             	add    $0xc,%esp
  80d088:	5b                   	pop    %ebx
  80d089:	5e                   	pop    %esi
  80d08a:	5f                   	pop    %edi
  80d08b:	5d                   	pop    %ebp
  80d08c:	c3                   	ret    

0080d08d <update_arp_entry>:
 *
 * @see pbuf_free()
 */
static err_t
update_arp_entry(struct netif *netif, struct ip_addr *ipaddr, struct eth_addr *ethaddr, u8_t flags)
{
  80d08d:	55                   	push   %ebp
  80d08e:	89 e5                	mov    %esp,%ebp
  80d090:	83 ec 38             	sub    $0x38,%esp
  80d093:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  80d096:	89 75 f8             	mov    %esi,-0x8(%ebp)
  80d099:	89 7d fc             	mov    %edi,-0x4(%ebp)
  80d09c:	89 c6                	mov    %eax,%esi
  80d09e:	89 d3                	mov    %edx,%ebx
  80d0a0:	89 cf                	mov    %ecx,%edi
  80d0a2:	0f b6 45 08          	movzbl 0x8(%ebp),%eax
  80d0a6:	88 45 e4             	mov    %al,-0x1c(%ebp)
  s8_t i;
  u8_t k;
  LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | 3, ("update_arp_entry()\n"));
  LWIP_ASSERT("netif->hwaddr_len == ETHARP_HWADDR_LEN", netif->hwaddr_len == ETHARP_HWADDR_LEN);
  80d0a9:	80 7e 24 06          	cmpb   $0x6,0x24(%esi)
  80d0ad:	74 1c                	je     80d0cb <update_arp_entry+0x3e>
  80d0af:	c7 44 24 08 3c 41 81 	movl   $0x81413c,0x8(%esp)
  80d0b6:	00 
  80d0b7:	c7 44 24 04 d9 01 00 	movl   $0x1d9,0x4(%esp)
  80d0be:	00 
  80d0bf:	c7 04 24 85 41 81 00 	movl   $0x814185,(%esp)
  80d0c6:	e8 d1 38 ff ff       	call   80099c <_panic>
  LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("update_arp_entry: %"U16_F".%"U16_F".%"U16_F".%"U16_F" - %02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F"\n",
                                        ip4_addr1(ipaddr), ip4_addr2(ipaddr), ip4_addr3(ipaddr), ip4_addr4(ipaddr), 
                                        ethaddr->addr[0], ethaddr->addr[1], ethaddr->addr[2],
                                        ethaddr->addr[3], ethaddr->addr[4], ethaddr->addr[5]));
  /* non-unicast address? */
  if (ip_addr_isany(ipaddr) ||
  80d0cb:	85 d2                	test   %edx,%edx
  80d0cd:	0f 84 14 01 00 00    	je     80d1e7 <update_arp_entry+0x15a>
  80d0d3:	83 3a 00             	cmpl   $0x0,(%edx)
  80d0d6:	0f 84 0b 01 00 00    	je     80d1e7 <update_arp_entry+0x15a>
      ip_addr_isbroadcast(ipaddr, netif) ||
  80d0dc:	89 74 24 04          	mov    %esi,0x4(%esp)
  80d0e0:	89 14 24             	mov    %edx,(%esp)
  80d0e3:	e8 00 c8 ff ff       	call   8098e8 <ip_addr_isbroadcast>
  LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("update_arp_entry: %"U16_F".%"U16_F".%"U16_F".%"U16_F" - %02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F"\n",
                                        ip4_addr1(ipaddr), ip4_addr2(ipaddr), ip4_addr3(ipaddr), ip4_addr4(ipaddr), 
                                        ethaddr->addr[0], ethaddr->addr[1], ethaddr->addr[2],
                                        ethaddr->addr[3], ethaddr->addr[4], ethaddr->addr[5]));
  /* non-unicast address? */
  if (ip_addr_isany(ipaddr) ||
  80d0e8:	84 c0                	test   %al,%al
  80d0ea:	0f 85 f7 00 00 00    	jne    80d1e7 <update_arp_entry+0x15a>
      ip_addr_isbroadcast(ipaddr, netif) ||
      ip_addr_ismulticast(ipaddr)) {
  80d0f0:	8b 13                	mov    (%ebx),%edx
  80d0f2:	89 55 e0             	mov    %edx,-0x20(%ebp)
  80d0f5:	c7 04 24 00 00 00 f0 	movl   $0xf0000000,(%esp)
  80d0fc:	e8 34 de ff ff       	call   80af35 <ntohl>
  80d101:	89 45 dc             	mov    %eax,-0x24(%ebp)
  80d104:	c7 04 24 00 00 00 e0 	movl   $0xe0000000,(%esp)
  80d10b:	e8 25 de ff ff       	call   80af35 <ntohl>
  LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("update_arp_entry: %"U16_F".%"U16_F".%"U16_F".%"U16_F" - %02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F"\n",
                                        ip4_addr1(ipaddr), ip4_addr2(ipaddr), ip4_addr3(ipaddr), ip4_addr4(ipaddr), 
                                        ethaddr->addr[0], ethaddr->addr[1], ethaddr->addr[2],
                                        ethaddr->addr[3], ethaddr->addr[4], ethaddr->addr[5]));
  /* non-unicast address? */
  if (ip_addr_isany(ipaddr) ||
  80d110:	8b 55 dc             	mov    -0x24(%ebp),%edx
  80d113:	23 55 e0             	and    -0x20(%ebp),%edx
  80d116:	39 c2                	cmp    %eax,%edx
  80d118:	0f 84 c9 00 00 00    	je     80d1e7 <update_arp_entry+0x15a>
  }
  /* find or create ARP entry */
#if LWIP_NETIF_HWADDRHINT
  i = find_entry(ipaddr, flags, netif);
#else /* LWIP_NETIF_HWADDRHINT */
  i = find_entry(ipaddr, flags);
  80d11e:	0f b6 55 e4          	movzbl -0x1c(%ebp),%edx
  80d122:	89 d8                	mov    %ebx,%eax
  80d124:	e8 5a f9 ff ff       	call   80ca83 <find_entry>
#endif /* LWIP_NETIF_HWADDRHINT */
  /* bail out if no entry could be found */
  if (i < 0)
  80d129:	84 c0                	test   %al,%al
  80d12b:	0f 88 bb 00 00 00    	js     80d1ec <update_arp_entry+0x15f>
    return (err_t)i;
  
  /* mark it stable */
  arp_table[i].state = ETHARP_STATE_STABLE;
  80d131:	0f be c0             	movsbl %al,%eax
  80d134:	89 45 e0             	mov    %eax,-0x20(%ebp)
  80d137:	6b c0 1c             	imul   $0x1c,%eax,%eax
  80d13a:	c7 80 f0 8d b3 00 02 	movl   $0x2,0xb38df0(%eax)
  80d141:	00 00 00 
  /* record network interface */
  arp_table[i].netif = netif;
  80d144:	89 b0 f8 8d b3 00    	mov    %esi,0xb38df8(%eax)
  LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("update_arp_entry: updating stable entry %"S16_F"\n", (s16_t)i));
  /* update address */
  k = ETHARP_HWADDR_LEN;
  while (k > 0) {
    k--;
    arp_table[i].ethaddr.addr[k] = ethaddr->addr[k];
  80d14a:	0f b6 5f 05          	movzbl 0x5(%edi),%ebx
  80d14e:	88 98 ed 8d b3 00    	mov    %bl,0xb38ded(%eax)
  80d154:	6b 4d e0 07          	imul   $0x7,-0x20(%ebp),%ecx
  80d158:	bb e0 8d b3 00       	mov    $0xb38de0,%ebx
  80d15d:	0f b6 57 04          	movzbl 0x4(%edi),%edx
  80d161:	88 54 8b 0c          	mov    %dl,0xc(%ebx,%ecx,4)
  80d165:	0f b6 4f 03          	movzbl 0x3(%edi),%ecx
  80d169:	88 88 eb 8d b3 00    	mov    %cl,0xb38deb(%eax)
  80d16f:	6b 4d e0 0e          	imul   $0xe,-0x20(%ebp),%ecx
  80d173:	0f b6 57 02          	movzbl 0x2(%edi),%edx
  80d177:	88 54 4b 0a          	mov    %dl,0xa(%ebx,%ecx,2)
  80d17b:	0f b6 4f 01          	movzbl 0x1(%edi),%ecx
  80d17f:	88 88 e9 8d b3 00    	mov    %cl,0xb38de9(%eax)
  80d185:	0f b6 0f             	movzbl (%edi),%ecx
  80d188:	88 4c 18 08          	mov    %cl,0x8(%eax,%ebx,1)
  }
  /* reset time stamp */
  arp_table[i].ctime = 0;
  80d18c:	c6 80 f4 8d b3 00 00 	movb   $0x0,0xb38df4(%eax)
    /* get the packet pointer */
    p = q->p;
    /* now queue entry can be freed */
    memp_free(MEMP_ARP_QUEUE, q);
    /* send the queued IP packet */
    etharp_send_ip(netif, p, (struct eth_addr*)(netif->hwaddr), ethaddr);
  80d193:	8d 4e 25             	lea    0x25(%esi),%ecx
  80d196:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  }
  /* reset time stamp */
  arp_table[i].ctime = 0;
#if ARP_QUEUEING
  /* this is where we will send out queued packets! */
  while (arp_table[i].q != NULL) {
  80d199:	6b 45 e0 1c          	imul   $0x1c,-0x20(%ebp),%eax
  80d19d:	89 45 e0             	mov    %eax,-0x20(%ebp)
  80d1a0:	eb 39                	jmp    80d1db <update_arp_entry+0x14e>
    struct pbuf *p;
    /* remember remainder of queue */
    struct etharp_q_entry *q = arp_table[i].q;
    /* pop first item off the queue */
    arp_table[i].q = q->next;
  80d1a2:	8b 10                	mov    (%eax),%edx
  80d1a4:	8b 4d e0             	mov    -0x20(%ebp),%ecx
  80d1a7:	89 14 19             	mov    %edx,(%ecx,%ebx,1)
    /* get the packet pointer */
    p = q->p;
  80d1aa:	8b 50 04             	mov    0x4(%eax),%edx
  80d1ad:	89 55 e4             	mov    %edx,-0x1c(%ebp)
    /* now queue entry can be freed */
    memp_free(MEMP_ARP_QUEUE, q);
  80d1b0:	89 44 24 04          	mov    %eax,0x4(%esp)
  80d1b4:	c7 04 24 0a 00 00 00 	movl   $0xa,(%esp)
  80d1bb:	e8 b4 a5 ff ff       	call   807774 <memp_free>
    /* send the queued IP packet */
    etharp_send_ip(netif, p, (struct eth_addr*)(netif->hwaddr), ethaddr);
  80d1c0:	89 3c 24             	mov    %edi,(%esp)
  80d1c3:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  80d1c6:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80d1c9:	89 f0                	mov    %esi,%eax
  80d1cb:	e8 50 f6 ff ff       	call   80c820 <etharp_send_ip>
    /* free the queued IP packet */
    pbuf_free(p);
  80d1d0:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  80d1d3:	89 0c 24             	mov    %ecx,(%esp)
  80d1d6:	e8 22 ad ff ff       	call   807efd <pbuf_free>
  }
  /* reset time stamp */
  arp_table[i].ctime = 0;
#if ARP_QUEUEING
  /* this is where we will send out queued packets! */
  while (arp_table[i].q != NULL) {
  80d1db:	8b 55 e0             	mov    -0x20(%ebp),%edx
  80d1de:	8b 04 1a             	mov    (%edx,%ebx,1),%eax
  80d1e1:	85 c0                	test   %eax,%eax
  80d1e3:	75 bd                	jne    80d1a2 <update_arp_entry+0x115>
  80d1e5:	eb 05                	jmp    80d1ec <update_arp_entry+0x15f>
  80d1e7:	b8 f6 ff ff ff       	mov    $0xfffffff6,%eax
    /* free the queued IP packet */
    pbuf_free(p);
  }
#endif
  return ERR_OK;
}
  80d1ec:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  80d1ef:	8b 75 f8             	mov    -0x8(%ebp),%esi
  80d1f2:	8b 7d fc             	mov    -0x4(%ebp),%edi
  80d1f5:	89 ec                	mov    %ebp,%esp
  80d1f7:	5d                   	pop    %ebp
  80d1f8:	c3                   	ret    

0080d1f9 <etharp_ip_input>:
 *
 * @see pbuf_free()
 */
void
etharp_ip_input(struct netif *netif, struct pbuf *p)
{
  80d1f9:	55                   	push   %ebp
  80d1fa:	89 e5                	mov    %esp,%ebp
  80d1fc:	83 ec 18             	sub    $0x18,%esp
  80d1ff:	8b 45 08             	mov    0x8(%ebp),%eax
  struct ethip_hdr *hdr;
  LWIP_ERROR("netif != NULL", (netif != NULL), return;);
  80d202:	85 c0                	test   %eax,%eax
  80d204:	75 1c                	jne    80d222 <etharp_ip_input+0x29>
  80d206:	c7 44 24 08 fb 33 81 	movl   $0x8133fb,0x8(%esp)
  80d20d:	00 
  80d20e:	c7 44 24 04 48 02 00 	movl   $0x248,0x4(%esp)
  80d215:	00 
  80d216:	c7 04 24 85 41 81 00 	movl   $0x814185,(%esp)
  80d21d:	e8 7a 37 ff ff       	call   80099c <_panic>
  /* Only insert an entry if the source IP address of the
     incoming IP packet comes from a host on the local network. */
  hdr = p->payload;
  80d222:	8b 55 0c             	mov    0xc(%ebp),%edx
  80d225:	8b 52 04             	mov    0x4(%edx),%edx
  /* source is not on the local network? */
  if (!ip_addr_netcmp(&(hdr->ip.src), &(netif->ip_addr), &(netif->netmask))) {
  80d228:	8b 48 04             	mov    0x4(%eax),%ecx
  80d22b:	33 4a 1c             	xor    0x1c(%edx),%ecx
  80d22e:	85 48 08             	test   %ecx,0x8(%eax)
  80d231:	75 12                	jne    80d245 <etharp_ip_input+0x4c>

  LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_ip_input: updating ETHARP table.\n"));
  /* update ARP table */
  /* @todo We could use ETHARP_TRY_HARD if we think we are going to talk
   * back soon (for example, if the destination IP address is ours. */
  update_arp_entry(netif, &(hdr->ip.src), &(hdr->eth.src), 0);
  80d233:	8d 4a 06             	lea    0x6(%edx),%ecx
  80d236:	83 c2 1c             	add    $0x1c,%edx
  80d239:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80d240:	e8 48 fe ff ff       	call   80d08d <update_arp_entry>
}
  80d245:	c9                   	leave  
  80d246:	c3                   	ret    

0080d247 <etharp_arp_input>:
 *
 * @see pbuf_free()
 */
void
etharp_arp_input(struct netif *netif, struct eth_addr *ethaddr, struct pbuf *p)
{
  80d247:	55                   	push   %ebp
  80d248:	89 e5                	mov    %esp,%ebp
  80d24a:	83 ec 38             	sub    $0x38,%esp
  80d24d:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  80d250:	89 75 f8             	mov    %esi,-0x8(%ebp)
  80d253:	89 7d fc             	mov    %edi,-0x4(%ebp)
  80d256:	8b 5d 10             	mov    0x10(%ebp),%ebx
  u8_t for_us;
#if LWIP_AUTOIP
  const u8_t * ethdst_hwaddr;
#endif /* LWIP_AUTOIP */

  LWIP_ERROR("netif != NULL", (netif != NULL), return;);
  80d259:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  80d25d:	75 1c                	jne    80d27b <etharp_arp_input+0x34>
  80d25f:	c7 44 24 08 fb 33 81 	movl   $0x8133fb,0x8(%esp)
  80d266:	00 
  80d267:	c7 44 24 04 75 02 00 	movl   $0x275,0x4(%esp)
  80d26e:	00 
  80d26f:	c7 04 24 85 41 81 00 	movl   $0x814185,(%esp)
  80d276:	e8 21 37 ff ff       	call   80099c <_panic>
  
  /* drop short ARP packets: we have to check for p->len instead of p->tot_len here
     since a struct etharp_hdr is pointed to p->payload, so it musn't be chained! */
  if (p->len < sizeof(struct etharp_hdr)) {
  80d27b:	66 83 7b 0a 29       	cmpw   $0x29,0xa(%ebx)
  80d280:	77 0d                	ja     80d28f <etharp_arp_input+0x48>
    LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | 1, ("etharp_arp_input: packet dropped, too short (%"S16_F"/%"S16_F")\n", p->tot_len, (s16_t)sizeof(struct etharp_hdr)));
    ETHARP_STATS_INC(etharp.lenerr);
    ETHARP_STATS_INC(etharp.drop);
    pbuf_free(p);
  80d282:	89 1c 24             	mov    %ebx,(%esp)
  80d285:	e8 73 ac ff ff       	call   807efd <pbuf_free>
    return;
  80d28a:	e9 ab 01 00 00       	jmp    80d43a <etharp_arp_input+0x1f3>
  }

  hdr = p->payload;
  80d28f:	8b 73 04             	mov    0x4(%ebx),%esi

  /* RFC 826 "Packet Reception": */
  if ((hdr->hwtype != htons(HWTYPE_ETHERNET)) ||
  80d292:	0f b7 7e 0e          	movzwl 0xe(%esi),%edi
  80d296:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  80d29d:	e8 51 da ff ff       	call   80acf3 <htons>
  80d2a2:	66 39 c7             	cmp    %ax,%di
  80d2a5:	75 3f                	jne    80d2e6 <etharp_arp_input+0x9f>
      (hdr->_hwlen_protolen != htons((ETHARP_HWADDR_LEN << 8) | sizeof(struct ip_addr))) ||
  80d2a7:	0f b7 7e 12          	movzwl 0x12(%esi),%edi
  80d2ab:	c7 04 24 04 06 00 00 	movl   $0x604,(%esp)
  80d2b2:	e8 3c da ff ff       	call   80acf3 <htons>
  }

  hdr = p->payload;

  /* RFC 826 "Packet Reception": */
  if ((hdr->hwtype != htons(HWTYPE_ETHERNET)) ||
  80d2b7:	66 39 c7             	cmp    %ax,%di
  80d2ba:	75 2a                	jne    80d2e6 <etharp_arp_input+0x9f>
      (hdr->_hwlen_protolen != htons((ETHARP_HWADDR_LEN << 8) | sizeof(struct ip_addr))) ||
      (hdr->proto != htons(ETHTYPE_IP)) ||
  80d2bc:	0f b7 7e 10          	movzwl 0x10(%esi),%edi
  80d2c0:	c7 04 24 00 08 00 00 	movl   $0x800,(%esp)
  80d2c7:	e8 27 da ff ff       	call   80acf3 <htons>
  }

  hdr = p->payload;

  /* RFC 826 "Packet Reception": */
  if ((hdr->hwtype != htons(HWTYPE_ETHERNET)) ||
  80d2cc:	66 39 c7             	cmp    %ax,%di
  80d2cf:	75 15                	jne    80d2e6 <etharp_arp_input+0x9f>
      (hdr->_hwlen_protolen != htons((ETHARP_HWADDR_LEN << 8) | sizeof(struct ip_addr))) ||
      (hdr->proto != htons(ETHTYPE_IP)) ||
      (hdr->ethhdr.type != htons(ETHTYPE_ARP)))  {
  80d2d1:	0f b7 7e 0c          	movzwl 0xc(%esi),%edi
  80d2d5:	c7 04 24 06 08 00 00 	movl   $0x806,(%esp)
  80d2dc:	e8 12 da ff ff       	call   80acf3 <htons>
  }

  hdr = p->payload;

  /* RFC 826 "Packet Reception": */
  if ((hdr->hwtype != htons(HWTYPE_ETHERNET)) ||
  80d2e1:	66 39 c7             	cmp    %ax,%di
  80d2e4:	74 0f                	je     80d2f5 <etharp_arp_input+0xae>
    LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | 1,
      ("etharp_arp_input: packet dropped, wrong hw type, hwlen, proto, protolen or ethernet type (%"U16_F"/%"U16_F"/%"U16_F"/%"U16_F"/%"U16_F")\n",
      hdr->hwtype, ARPH_HWLEN(hdr), hdr->proto, ARPH_PROTOLEN(hdr), hdr->ethhdr.type));
    ETHARP_STATS_INC(etharp.proterr);
    ETHARP_STATS_INC(etharp.drop);
    pbuf_free(p);
  80d2e6:	89 1c 24             	mov    %ebx,(%esp)
  80d2e9:	e8 0f ac ff ff       	call   807efd <pbuf_free>
    return;
  80d2ee:	66 90                	xchg   %ax,%ax
  80d2f0:	e9 45 01 00 00       	jmp    80d43a <etharp_arp_input+0x1f3>
  autoip_arp_reply(netif, hdr);
#endif /* LWIP_AUTOIP */

  /* Copy struct ip_addr2 to aligned ip_addr, to support compilers without
   * structure packing (not using structure copy which breaks strict-aliasing rules). */
  SMEMCPY(&sipaddr, &hdr->sipaddr, sizeof(sipaddr));
  80d2f5:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  80d2fc:	00 
  80d2fd:	8d 46 1c             	lea    0x1c(%esi),%eax
  80d300:	89 44 24 04          	mov    %eax,0x4(%esp)
  80d304:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80d307:	89 04 24             	mov    %eax,(%esp)
  80d30a:	e8 52 40 ff ff       	call   801361 <memcpy>
  SMEMCPY(&dipaddr, &hdr->dipaddr, sizeof(dipaddr));
  80d30f:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  80d316:	00 
  80d317:	8d 46 26             	lea    0x26(%esi),%eax
  80d31a:	89 44 24 04          	mov    %eax,0x4(%esp)
  80d31e:	8d 45 e0             	lea    -0x20(%ebp),%eax
  80d321:	89 04 24             	mov    %eax,(%esp)
  80d324:	e8 38 40 ff ff       	call   801361 <memcpy>

  /* this interface is not configured? */
  if (netif->ip_addr.addr == 0) {
  80d329:	8b 55 08             	mov    0x8(%ebp),%edx
  80d32c:	8b 42 04             	mov    0x4(%edx),%eax

  /* ARP message directed to us? */
  if (for_us) {
    /* add IP address in ARP cache; assume requester wants to talk to us.
     * can result in directly sending the queued packets for this host. */
    update_arp_entry(netif, &sipaddr, &(hdr->shwaddr), ETHARP_TRY_HARD);
  80d32f:	bf 00 00 00 00       	mov    $0x0,%edi
   * structure packing (not using structure copy which breaks strict-aliasing rules). */
  SMEMCPY(&sipaddr, &hdr->sipaddr, sizeof(sipaddr));
  SMEMCPY(&dipaddr, &hdr->dipaddr, sizeof(dipaddr));

  /* this interface is not configured? */
  if (netif->ip_addr.addr == 0) {
  80d334:	85 c0                	test   %eax,%eax
  80d336:	74 21                	je     80d359 <etharp_arp_input+0x112>
    for_us = 0;
  } else {
    /* ARP packet directed to us? */
    for_us = ip_addr_cmp(&dipaddr, &(netif->ip_addr));
  80d338:	3b 45 e0             	cmp    -0x20(%ebp),%eax
  }

  /* ARP message directed to us? */
  if (for_us) {
  80d33b:	0f 94 c0             	sete   %al
  80d33e:	89 c7                	mov    %eax,%edi
  80d340:	75 17                	jne    80d359 <etharp_arp_input+0x112>
    /* add IP address in ARP cache; assume requester wants to talk to us.
     * can result in directly sending the queued packets for this host. */
    update_arp_entry(netif, &sipaddr, &(hdr->shwaddr), ETHARP_TRY_HARD);
  80d342:	8d 4e 16             	lea    0x16(%esi),%ecx
  80d345:	8d 55 e4             	lea    -0x1c(%ebp),%edx
  80d348:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  80d34f:	8b 45 08             	mov    0x8(%ebp),%eax
  80d352:	e8 36 fd ff ff       	call   80d08d <update_arp_entry>
  80d357:	eb 15                	jmp    80d36e <etharp_arp_input+0x127>
  /* ARP message not directed to us? */
  } else {
    /* update the source IP address in the cache, if present */
    update_arp_entry(netif, &sipaddr, &(hdr->shwaddr), 0);
  80d359:	8d 4e 16             	lea    0x16(%esi),%ecx
  80d35c:	8d 55 e4             	lea    -0x1c(%ebp),%edx
  80d35f:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80d366:	8b 45 08             	mov    0x8(%ebp),%eax
  80d369:	e8 1f fd ff ff       	call   80d08d <update_arp_entry>
  }

  /* now act on the message itself */
  switch (htons(hdr->opcode)) {
  80d36e:	0f b7 46 14          	movzwl 0x14(%esi),%eax
  80d372:	89 04 24             	mov    %eax,(%esp)
  80d375:	e8 79 d9 ff ff       	call   80acf3 <htons>
  80d37a:	66 83 f8 01          	cmp    $0x1,%ax
  80d37e:	74 15                	je     80d395 <etharp_arp_input+0x14e>
  80d380:	66 83 f8 02          	cmp    $0x2,%ax
  80d384:	0f 85 a8 00 00 00    	jne    80d432 <etharp_arp_input+0x1eb>
  80d38a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  80d390:	e9 8b 00 00 00       	jmp    80d420 <etharp_arp_input+0x1d9>
     * reply. In any case, we time-stamp any existing ARP entry,
     * and possiby send out an IP packet that was queued on it. */

    LWIP_DEBUGF (ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_arp_input: incoming ARP request\n"));
    /* ARP request for our address? */
    if (for_us) {
  80d395:	89 fa                	mov    %edi,%edx
  80d397:	84 d2                	test   %dl,%dl
  80d399:	0f 84 93 00 00 00    	je     80d432 <etharp_arp_input+0x1eb>

      LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_arp_input: replying to ARP request for our IP address\n"));
      /* Re-use pbuf to send ARP reply.
         Since we are re-using an existing pbuf, we can't call etharp_raw since
         that would allocate a new pbuf. */
      hdr->opcode = htons(ARP_REPLY);
  80d39f:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  80d3a6:	e8 48 d9 ff ff       	call   80acf3 <htons>
  80d3ab:	66 89 46 14          	mov    %ax,0x14(%esi)

      hdr->dipaddr = hdr->sipaddr;
  80d3af:	8b 46 1c             	mov    0x1c(%esi),%eax
  80d3b2:	89 46 26             	mov    %eax,0x26(%esi)
      hdr->sipaddr = *(struct ip_addr2 *)&netif->ip_addr;
  80d3b5:	8b 55 08             	mov    0x8(%ebp),%edx
  80d3b8:	8b 42 04             	mov    0x4(%edx),%eax
  80d3bb:	89 46 1c             	mov    %eax,0x1c(%esi)

      LWIP_ASSERT("netif->hwaddr_len must be the same as ETHARP_HWADDR_LEN for etharp!",
  80d3be:	ba 06 00 00 00       	mov    $0x6,%edx
  80d3c3:	8b 45 08             	mov    0x8(%ebp),%eax
  80d3c6:	80 78 24 06          	cmpb   $0x6,0x24(%eax)
  80d3ca:	74 1c                	je     80d3e8 <etharp_arp_input+0x1a1>
  80d3cc:	c7 44 24 08 9c 40 81 	movl   $0x81409c,0x8(%esp)
  80d3d3:	00 
  80d3d4:	c7 44 24 04 c7 02 00 	movl   $0x2c7,0x4(%esp)
  80d3db:	00 
  80d3dc:	c7 04 24 85 41 81 00 	movl   $0x814185,(%esp)
  80d3e3:	e8 b4 35 ff ff       	call   80099c <_panic>
  80d3e8:	8b 7d 0c             	mov    0xc(%ebp),%edi
       * link layer. (See RFC3927 Section 2.5) */
      ethdst_hwaddr = ((netif->autoip != NULL) && (netif->autoip->state != AUTOIP_STATE_OFF)) ? (u8_t*)(ethbroadcast.addr) : hdr->shwaddr.addr;
#endif /* LWIP_AUTOIP */

      while(i > 0) {
        i--;
  80d3eb:	83 ea 01             	sub    $0x1,%edx
        hdr->dhwaddr.addr[i] = hdr->shwaddr.addr[i];
  80d3ee:	0f b6 c2             	movzbl %dl,%eax
  80d3f1:	0f b6 4c 06 16       	movzbl 0x16(%esi,%eax,1),%ecx
  80d3f6:	88 4c 06 20          	mov    %cl,0x20(%esi,%eax,1)
#if LWIP_AUTOIP
        hdr->ethhdr.dest.addr[i] = ethdst_hwaddr[i];
#else  /* LWIP_AUTOIP */
        hdr->ethhdr.dest.addr[i] = hdr->shwaddr.addr[i];
  80d3fa:	88 0c 06             	mov    %cl,(%esi,%eax,1)
#endif /* LWIP_AUTOIP */
        hdr->shwaddr.addr[i] = ethaddr->addr[i];
  80d3fd:	0f b6 0c 07          	movzbl (%edi,%eax,1),%ecx
  80d401:	88 4c 06 16          	mov    %cl,0x16(%esi,%eax,1)
        hdr->ethhdr.src.addr[i] = ethaddr->addr[i];
  80d405:	0f b6 0c 07          	movzbl (%edi,%eax,1),%ecx
  80d409:	88 4c 06 06          	mov    %cl,0x6(%esi,%eax,1)
      /* If we are using Link-Local, ARP packets must be broadcast on the
       * link layer. (See RFC3927 Section 2.5) */
      ethdst_hwaddr = ((netif->autoip != NULL) && (netif->autoip->state != AUTOIP_STATE_OFF)) ? (u8_t*)(ethbroadcast.addr) : hdr->shwaddr.addr;
#endif /* LWIP_AUTOIP */

      while(i > 0) {
  80d40d:	84 d2                	test   %dl,%dl
  80d40f:	75 da                	jne    80d3eb <etharp_arp_input+0x1a4>

      /* hwtype, hwaddr_len, proto, protolen and the type in the ethernet header
         are already correct, we tested that before */

      /* return ARP reply */
      netif->linkoutput(netif, p);
  80d411:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  80d415:	8b 55 08             	mov    0x8(%ebp),%edx
  80d418:	89 14 24             	mov    %edx,(%esp)
  80d41b:	ff 52 18             	call   *0x18(%edx)
  80d41e:	eb 12                	jmp    80d432 <etharp_arp_input+0x1eb>
#if (LWIP_DHCP && DHCP_DOES_ARP_CHECK)
    /* DHCP wants to know about ARP replies from any host with an
     * IP address also offered to us by the DHCP server. We do not
     * want to take a duplicate IP address on a single network.
     * @todo How should we handle redundant (fail-over) interfaces? */
    dhcp_arp_reply(netif, &sipaddr);
  80d420:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80d423:	89 44 24 04          	mov    %eax,0x4(%esp)
  80d427:	8b 45 08             	mov    0x8(%ebp),%eax
  80d42a:	89 04 24             	mov    %eax,(%esp)
  80d42d:	e8 75 90 ff ff       	call   8064a7 <dhcp_arp_reply>
    LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_arp_input: ARP unknown opcode type %"S16_F"\n", htons(hdr->opcode)));
    ETHARP_STATS_INC(etharp.err);
    break;
  }
  /* free ARP packet */
  pbuf_free(p);
  80d432:	89 1c 24             	mov    %ebx,(%esp)
  80d435:	e8 c3 aa ff ff       	call   807efd <pbuf_free>
}
  80d43a:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  80d43d:	8b 75 f8             	mov    -0x8(%ebp),%esi
  80d440:	8b 7d fc             	mov    -0x4(%ebp),%edi
  80d443:	89 ec                	mov    %ebp,%esp
  80d445:	5d                   	pop    %ebp
  80d446:	c3                   	ret    

0080d447 <ethernet_input>:
 * @param p the recevied packet, p->payload pointing to the ethernet header
 * @param netif the network interface on which the packet was received
 */
err_t
ethernet_input(struct pbuf *p, struct netif *netif)
{
  80d447:	55                   	push   %ebp
  80d448:	89 e5                	mov    %esp,%ebp
  80d44a:	83 ec 18             	sub    $0x18,%esp
  80d44d:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  80d450:	89 75 fc             	mov    %esi,-0x4(%ebp)
  80d453:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80d456:	8b 75 0c             	mov    0xc(%ebp),%esi
     (unsigned)ethhdr->dest.addr[3], (unsigned)ethhdr->dest.addr[4], (unsigned)ethhdr->dest.addr[5],
     (unsigned)ethhdr->src.addr[0], (unsigned)ethhdr->src.addr[1], (unsigned)ethhdr->src.addr[2],
     (unsigned)ethhdr->src.addr[3], (unsigned)ethhdr->src.addr[4], (unsigned)ethhdr->src.addr[5],
     (unsigned)htons(ethhdr->type)));

  switch (htons(ethhdr->type)) {
  80d459:	8b 43 04             	mov    0x4(%ebx),%eax
  80d45c:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  80d460:	89 04 24             	mov    %eax,(%esp)
  80d463:	e8 8b d8 ff ff       	call   80acf3 <htons>
  80d468:	66 3d 00 08          	cmp    $0x800,%ax
  80d46c:	74 0c                	je     80d47a <ethernet_input+0x33>
  80d46e:	66 3d 06 08          	cmp    $0x806,%ax
  80d472:	75 65                	jne    80d4d9 <ethernet_input+0x92>
  80d474:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  80d478:	eb 4a                	jmp    80d4c4 <ethernet_input+0x7d>
    /* IP packet? */
    case ETHTYPE_IP:
#if ETHARP_TRUST_IP_MAC
      /* update ARP table */
      etharp_ip_input(netif, p);
  80d47a:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  80d47e:	89 34 24             	mov    %esi,(%esp)
  80d481:	e8 73 fd ff ff       	call   80d1f9 <etharp_ip_input>
#endif /* ETHARP_TRUST_IP_MAC */
      /* skip Ethernet header */
      if(pbuf_header(p, -(s16_t)sizeof(struct eth_hdr))) {
  80d486:	c7 44 24 04 f2 ff ff 	movl   $0xfffffff2,0x4(%esp)
  80d48d:	ff 
  80d48e:	89 1c 24             	mov    %ebx,(%esp)
  80d491:	e8 fd a6 ff ff       	call   807b93 <pbuf_header>
  80d496:	84 c0                	test   %al,%al
  80d498:	74 1c                	je     80d4b6 <ethernet_input+0x6f>
        LWIP_ASSERT("Can't move over header in packet", 0);
  80d49a:	c7 44 24 08 64 41 81 	movl   $0x814164,0x8(%esp)
  80d4a1:	00 
  80d4a2:	c7 44 24 04 7e 04 00 	movl   $0x47e,0x4(%esp)
  80d4a9:	00 
  80d4aa:	c7 04 24 85 41 81 00 	movl   $0x814185,(%esp)
  80d4b1:	e8 e6 34 ff ff       	call   80099c <_panic>
        pbuf_free(p);
        p = NULL;
      } else {
        /* pass to IP layer */
        ip_input(p, netif);
  80d4b6:	89 74 24 04          	mov    %esi,0x4(%esp)
  80d4ba:	89 1c 24             	mov    %ebx,(%esp)
  80d4bd:	e8 f2 c6 ff ff       	call   809bb4 <ip_input>
      }
      break;
  80d4c2:	eb 1d                	jmp    80d4e1 <ethernet_input+0x9a>
      
    case ETHTYPE_ARP:
      /* pass p to ARP module */
      etharp_arp_input(netif, (struct eth_addr*)(netif->hwaddr), p);
  80d4c4:	89 5c 24 08          	mov    %ebx,0x8(%esp)
  80d4c8:	8d 46 25             	lea    0x25(%esi),%eax
  80d4cb:	89 44 24 04          	mov    %eax,0x4(%esp)
  80d4cf:	89 34 24             	mov    %esi,(%esp)
  80d4d2:	e8 70 fd ff ff       	call   80d247 <etharp_arp_input>
      break;
  80d4d7:	eb 08                	jmp    80d4e1 <ethernet_input+0x9a>
#endif /* PPPOE_SUPPORT */

    default:
      ETHARP_STATS_INC(etharp.proterr);
      ETHARP_STATS_INC(etharp.drop);
      pbuf_free(p);
  80d4d9:	89 1c 24             	mov    %ebx,(%esp)
  80d4dc:	e8 1c aa ff ff       	call   807efd <pbuf_free>
  }

  /* This means the pbuf is freed or consumed,
     so the caller doesn't have to free it again */
  return ERR_OK;
}
  80d4e1:	b8 00 00 00 00       	mov    $0x0,%eax
  80d4e6:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  80d4e9:	8b 75 fc             	mov    -0x4(%ebp),%esi
  80d4ec:	89 ec                	mov    %ebp,%esp
  80d4ee:	5d                   	pop    %ebp
  80d4ef:	c3                   	ret    

0080d4f0 <sys_init>:
enum { thread_hash_size = 257 };
static LIST_HEAD(thread_list, sys_thread) threads[thread_hash_size];

void
sys_init(void)
{
  80d4f0:	55                   	push   %ebp
  80d4f1:	89 e5                	mov    %esp,%ebp
  80d4f3:	56                   	push   %esi
  80d4f4:	53                   	push   %ebx
  80d4f5:	b8 00 8f b3 00       	mov    $0xb38f00,%eax

enum { thread_hash_size = 257 };
static LIST_HEAD(thread_list, sys_thread) threads[thread_hash_size];

void
sys_init(void)
  80d4fa:	be 00 a3 b3 00       	mov    $0xb3a300,%esi
{
    int i = 0;
    for (i = 0; i < NSEM; i++) {
	sems[i].freed = 1;
  80d4ff:	c7 00 01 00 00 00    	movl   $0x1,(%eax)
  80d505:	89 c1                	mov    %eax,%ecx
	LIST_INSERT_HEAD(&sem_free, &sems[i], link);
  80d507:	8b 15 00 a3 b3 00    	mov    0xb3a300,%edx
  80d50d:	89 50 0c             	mov    %edx,0xc(%eax)
  80d510:	85 d2                	test   %edx,%edx
  80d512:	74 06                	je     80d51a <sys_init+0x2a>
  80d514:	8d 58 0c             	lea    0xc(%eax),%ebx
  80d517:	89 5a 10             	mov    %ebx,0x10(%edx)
  80d51a:	89 0d 00 a3 b3 00    	mov    %ecx,0xb3a300
  80d520:	c7 40 10 00 a3 b3 00 	movl   $0xb3a300,0x10(%eax)
  80d527:	83 c0 14             	add    $0x14,%eax

void
sys_init(void)
{
    int i = 0;
    for (i = 0; i < NSEM; i++) {
  80d52a:	39 f0                	cmp    %esi,%eax
  80d52c:	75 d1                	jne    80d4ff <sys_init+0xf>
  80d52e:	b8 20 a3 b3 00       	mov    $0xb3a320,%eax

enum { thread_hash_size = 257 };
static LIST_HEAD(thread_list, sys_thread) threads[thread_hash_size];

void
sys_init(void)
  80d533:	be 20 f1 b3 00       	mov    $0xb3f120,%esi
	sems[i].freed = 1;
	LIST_INSERT_HEAD(&sem_free, &sems[i], link);
    }

    for (i = 0; i < NMBOX; i++) {
	mboxes[i].freed = 1;
  80d538:	c7 00 01 00 00 00    	movl   $0x1,(%eax)
  80d53e:	89 c1                	mov    %eax,%ecx
	LIST_INSERT_HEAD(&mbox_free, &mboxes[i], link);
  80d540:	8b 15 20 f1 b3 00    	mov    0xb3f120,%edx
  80d546:	89 90 94 00 00 00    	mov    %edx,0x94(%eax)
  80d54c:	85 d2                	test   %edx,%edx
  80d54e:	74 0c                	je     80d55c <sys_init+0x6c>
  80d550:	8d 98 94 00 00 00    	lea    0x94(%eax),%ebx
  80d556:	89 9a 98 00 00 00    	mov    %ebx,0x98(%edx)
  80d55c:	89 0d 20 f1 b3 00    	mov    %ecx,0xb3f120
  80d562:	c7 80 98 00 00 00 20 	movl   $0xb3f120,0x98(%eax)
  80d569:	f1 b3 00 
  80d56c:	05 9c 00 00 00       	add    $0x9c,%eax
    for (i = 0; i < NSEM; i++) {
	sems[i].freed = 1;
	LIST_INSERT_HEAD(&sem_free, &sems[i], link);
    }

    for (i = 0; i < NMBOX; i++) {
  80d571:	39 f0                	cmp    %esi,%eax
  80d573:	75 c3                	jne    80d538 <sys_init+0x48>
	mboxes[i].freed = 1;
	LIST_INSERT_HEAD(&mbox_free, &mboxes[i], link);
    }
}
  80d575:	5b                   	pop    %ebx
  80d576:	5e                   	pop    %esi
  80d577:	5d                   	pop    %ebp
  80d578:	c3                   	ret    

0080d579 <lwip_core_lock>:
    return &t->tmo;
}

void
lwip_core_lock(void)
{
  80d579:	55                   	push   %ebp
  80d57a:	89 e5                	mov    %esp,%ebp
}
  80d57c:	5d                   	pop    %ebp
  80d57d:	c3                   	ret    

0080d57e <lwip_core_unlock>:

void
lwip_core_unlock(void)
{
  80d57e:	55                   	push   %ebp
  80d57f:	89 e5                	mov    %esp,%ebp
}
  80d581:	5d                   	pop    %ebp
  80d582:	c3                   	ret    

0080d583 <sys_sem_free>:
    return se - &sems[0];
}

void
sys_sem_free(sys_sem_t sem)
{
  80d583:	55                   	push   %ebp
  80d584:	89 e5                	mov    %esp,%ebp
  80d586:	56                   	push   %esi
  80d587:	53                   	push   %ebx
  80d588:	83 ec 10             	sub    $0x10,%esp
  80d58b:	8b 45 08             	mov    0x8(%ebp),%eax
    assert(!sems[sem].freed);
  80d58e:	8d 14 80             	lea    (%eax,%eax,4),%edx
  80d591:	83 3c 95 00 8f b3 00 	cmpl   $0x0,0xb38f00(,%edx,4)
  80d598:	00 
  80d599:	74 24                	je     80d5bf <sys_sem_free+0x3c>
  80d59b:	c7 44 24 0c 07 42 81 	movl   $0x814207,0xc(%esp)
  80d5a2:	00 
  80d5a3:	c7 44 24 08 50 2d 81 	movl   $0x812d50,0x8(%esp)
  80d5aa:	00 
  80d5ab:	c7 44 24 04 98 00 00 	movl   $0x98,0x4(%esp)
  80d5b2:	00 
  80d5b3:	c7 04 24 18 42 81 00 	movl   $0x814218,(%esp)
  80d5ba:	e8 dd 33 ff ff       	call   80099c <_panic>
    sems[sem].freed = 1;
  80d5bf:	b9 00 8f b3 00       	mov    $0xb38f00,%ecx
  80d5c4:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
  80d5cb:	8d 1c 02             	lea    (%edx,%eax,1),%ebx
  80d5ce:	c7 04 99 01 00 00 00 	movl   $0x1,(%ecx,%ebx,4)
    sems[sem].gen++;
  80d5d5:	c1 e3 02             	shl    $0x2,%ebx
  80d5d8:	8b 74 0b 04          	mov    0x4(%ebx,%ecx,1),%esi
  80d5dc:	83 c6 01             	add    $0x1,%esi
  80d5df:	89 74 0b 04          	mov    %esi,0x4(%ebx,%ecx,1)
    LIST_INSERT_HEAD(&sem_free, &sems[sem], link);
  80d5e3:	8d 04 02             	lea    (%edx,%eax,1),%eax
  80d5e6:	8d 04 85 00 8f b3 00 	lea    0xb38f00(,%eax,4),%eax
  80d5ed:	8b 15 00 a3 b3 00    	mov    0xb3a300,%edx
  80d5f3:	89 50 0c             	mov    %edx,0xc(%eax)
  80d5f6:	85 d2                	test   %edx,%edx
  80d5f8:	74 06                	je     80d600 <sys_sem_free+0x7d>
  80d5fa:	8d 48 0c             	lea    0xc(%eax),%ecx
  80d5fd:	89 4a 10             	mov    %ecx,0x10(%edx)
  80d600:	a3 00 a3 b3 00       	mov    %eax,0xb3a300
  80d605:	c7 40 10 00 a3 b3 00 	movl   $0xb3a300,0x10(%eax)
}
  80d60c:	83 c4 10             	add    $0x10,%esp
  80d60f:	5b                   	pop    %ebx
  80d610:	5e                   	pop    %esi
  80d611:	5d                   	pop    %ebp
  80d612:	c3                   	ret    

0080d613 <sys_mbox_free>:
    return i;
}

void
sys_mbox_free(sys_mbox_t mbox)
{
  80d613:	55                   	push   %ebp
  80d614:	89 e5                	mov    %esp,%ebp
  80d616:	56                   	push   %esi
  80d617:	53                   	push   %ebx
  80d618:	83 ec 10             	sub    $0x10,%esp
  80d61b:	8b 75 08             	mov    0x8(%ebp),%esi
    assert(!mboxes[mbox].freed);
  80d61e:	69 c6 9c 00 00 00    	imul   $0x9c,%esi,%eax
  80d624:	83 b8 20 a3 b3 00 00 	cmpl   $0x0,0xb3a320(%eax)
  80d62b:	74 24                	je     80d651 <sys_mbox_free+0x3e>
  80d62d:	c7 44 24 0c 35 42 81 	movl   $0x814235,0xc(%esp)
  80d634:	00 
  80d635:	c7 44 24 08 50 2d 81 	movl   $0x812d50,0x8(%esp)
  80d63c:	00 
  80d63d:	c7 44 24 04 62 00 00 	movl   $0x62,0x4(%esp)
  80d644:	00 
  80d645:	c7 04 24 18 42 81 00 	movl   $0x814218,(%esp)
  80d64c:	e8 4b 33 ff ff       	call   80099c <_panic>
    sys_sem_free(mboxes[mbox].queued_msg);
  80d651:	69 de 9c 00 00 00    	imul   $0x9c,%esi,%ebx
  80d657:	8b 83 ac a3 b3 00    	mov    0xb3a3ac(%ebx),%eax
  80d65d:	89 04 24             	mov    %eax,(%esp)
  80d660:	e8 1e ff ff ff       	call   80d583 <sys_sem_free>
    sys_sem_free(mboxes[mbox].free_msg);
  80d665:	8b 83 b0 a3 b3 00    	mov    0xb3a3b0(%ebx),%eax
  80d66b:	89 04 24             	mov    %eax,(%esp)
  80d66e:	e8 10 ff ff ff       	call   80d583 <sys_sem_free>
    LIST_INSERT_HEAD(&mbox_free, &mboxes[mbox], link);
  80d673:	81 c3 20 a3 b3 00    	add    $0xb3a320,%ebx
  80d679:	a1 20 f1 b3 00       	mov    0xb3f120,%eax
  80d67e:	89 83 94 00 00 00    	mov    %eax,0x94(%ebx)
  80d684:	85 c0                	test   %eax,%eax
  80d686:	74 0c                	je     80d694 <sys_mbox_free+0x81>
  80d688:	8d 93 94 00 00 00    	lea    0x94(%ebx),%edx
  80d68e:	89 90 98 00 00 00    	mov    %edx,0x98(%eax)
  80d694:	89 1d 20 f1 b3 00    	mov    %ebx,0xb3f120
  80d69a:	c7 83 98 00 00 00 20 	movl   $0xb3f120,0x98(%ebx)
  80d6a1:	f1 b3 00 
    mboxes[mbox].freed = 1;
  80d6a4:	69 f6 9c 00 00 00    	imul   $0x9c,%esi,%esi
  80d6aa:	c7 86 20 a3 b3 00 01 	movl   $0x1,0xb3a320(%esi)
  80d6b1:	00 00 00 
}
  80d6b4:	83 c4 10             	add    $0x10,%esp
  80d6b7:	5b                   	pop    %ebx
  80d6b8:	5e                   	pop    %esi
  80d6b9:	5d                   	pop    %ebp
  80d6ba:	c3                   	ret    

0080d6bb <sys_arch_timeouts>:
    lwip_core_unlock();
}

struct sys_timeouts *
sys_arch_timeouts(void)
{
  80d6bb:	55                   	push   %ebp
  80d6bc:	89 e5                	mov    %esp,%ebp
  80d6be:	57                   	push   %edi
  80d6bf:	56                   	push   %esi
  80d6c0:	53                   	push   %ebx
  80d6c1:	83 ec 1c             	sub    $0x1c,%esp
    thread_id_t tid = thread_id();
  80d6c4:	e8 0a 08 00 00       	call   80ded3 <thread_id>
  80d6c9:	89 c6                	mov    %eax,%esi

    struct sys_thread *t;
    LIST_FOREACH(t, &threads[tid % thread_hash_size], link)
  80d6cb:	ba 01 ff 00 ff       	mov    $0xff00ff01,%edx
  80d6d0:	f7 e2                	mul    %edx
  80d6d2:	c1 ea 08             	shr    $0x8,%edx
  80d6d5:	89 d0                	mov    %edx,%eax
  80d6d7:	c1 e0 08             	shl    $0x8,%eax
  80d6da:	8d 14 10             	lea    (%eax,%edx,1),%edx
  80d6dd:	89 f0                	mov    %esi,%eax
  80d6df:	29 d0                	sub    %edx,%eax
  80d6e1:	8d 3c 85 40 f1 b3 00 	lea    0xb3f140(,%eax,4),%edi
  80d6e8:	8b 1f                	mov    (%edi),%ebx
  80d6ea:	85 db                	test   %ebx,%ebx
  80d6ec:	74 24                	je     80d712 <sys_arch_timeouts+0x57>
	if (t->tid == tid)
  80d6ee:	3b 33                	cmp    (%ebx),%esi
  80d6f0:	75 14                	jne    80d706 <sys_arch_timeouts+0x4b>
  80d6f2:	e9 b4 00 00 00       	jmp    80d7ab <sys_arch_timeouts+0xf0>
  80d6f7:	3b 33                	cmp    (%ebx),%esi
  80d6f9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  80d700:	0f 84 a5 00 00 00    	je     80d7ab <sys_arch_timeouts+0xf0>
sys_arch_timeouts(void)
{
    thread_id_t tid = thread_id();

    struct sys_thread *t;
    LIST_FOREACH(t, &threads[tid % thread_hash_size], link)
  80d706:	8b 5b 08             	mov    0x8(%ebx),%ebx
  80d709:	85 db                	test   %ebx,%ebx
  80d70b:	90                   	nop
  80d70c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  80d710:	75 e5                	jne    80d6f7 <sys_arch_timeouts+0x3c>
	if (t->tid == tid)
	    goto out;

    t = malloc(sizeof(*t));
  80d712:	c7 04 24 10 00 00 00 	movl   $0x10,(%esp)
  80d719:	e8 35 56 ff ff       	call   802d53 <malloc>
  80d71e:	89 c3                	mov    %eax,%ebx
    if (t == 0)
  80d720:	85 c0                	test   %eax,%eax
  80d722:	75 1c                	jne    80d740 <sys_arch_timeouts+0x85>
	panic("sys_arch_timeouts: cannot malloc");
  80d724:	c7 44 24 08 98 42 81 	movl   $0x814298,0x8(%esp)
  80d72b:	00 
  80d72c:	c7 44 24 04 2c 01 00 	movl   $0x12c,0x4(%esp)
  80d733:	00 
  80d734:	c7 04 24 18 42 81 00 	movl   $0x814218,(%esp)
  80d73b:	e8 5c 32 ff ff       	call   80099c <_panic>

    int r = thread_onhalt(timeout_cleanup);
  80d740:	c7 04 24 b6 d7 80 00 	movl   $0x80d7b6,(%esp)
  80d747:	e8 da 07 00 00       	call   80df26 <thread_onhalt>
    if (r < 0)
  80d74c:	85 c0                	test   %eax,%eax
  80d74e:	79 28                	jns    80d778 <sys_arch_timeouts+0xbd>
	panic("thread_onhalt failed: %s", e2s(r));
  80d750:	89 04 24             	mov    %eax,(%esp)
  80d753:	e8 40 0b 00 00       	call   80e298 <e2s>
  80d758:	89 44 24 0c          	mov    %eax,0xc(%esp)
  80d75c:	c7 44 24 08 49 42 81 	movl   $0x814249,0x8(%esp)
  80d763:	00 
  80d764:	c7 44 24 04 30 01 00 	movl   $0x130,0x4(%esp)
  80d76b:	00 
  80d76c:	c7 04 24 18 42 81 00 	movl   $0x814218,(%esp)
  80d773:	e8 24 32 ff ff       	call   80099c <_panic>

    t->tid = tid;
  80d778:	89 33                	mov    %esi,(%ebx)
    memset(&t->tmo, 0, sizeof(t->tmo));
  80d77a:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  80d781:	00 
  80d782:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80d789:	00 
  80d78a:	8d 43 04             	lea    0x4(%ebx),%eax
  80d78d:	89 04 24             	mov    %eax,(%esp)
  80d790:	e8 f1 3a ff ff       	call   801286 <memset>
    LIST_INSERT_HEAD(&threads[tid % thread_hash_size], t, link);
  80d795:	8b 07                	mov    (%edi),%eax
  80d797:	89 43 08             	mov    %eax,0x8(%ebx)
  80d79a:	85 c0                	test   %eax,%eax
  80d79c:	74 08                	je     80d7a6 <sys_arch_timeouts+0xeb>
  80d79e:	8b 07                	mov    (%edi),%eax
  80d7a0:	8d 53 08             	lea    0x8(%ebx),%edx
  80d7a3:	89 50 0c             	mov    %edx,0xc(%eax)
  80d7a6:	89 1f                	mov    %ebx,(%edi)
  80d7a8:	89 7b 0c             	mov    %edi,0xc(%ebx)
  80d7ab:	8d 43 04             	lea    0x4(%ebx),%eax

out:
    return &t->tmo;
}
  80d7ae:	83 c4 1c             	add    $0x1c,%esp
  80d7b1:	5b                   	pop    %ebx
  80d7b2:	5e                   	pop    %esi
  80d7b3:	5f                   	pop    %edi
  80d7b4:	5d                   	pop    %ebp
  80d7b5:	c3                   	ret    

0080d7b6 <timeout_cleanup>:
    return tid;
}

static void
timeout_cleanup(thread_id_t tid)
{
  80d7b6:	55                   	push   %ebp
  80d7b7:	89 e5                	mov    %esp,%ebp
  80d7b9:	83 ec 18             	sub    $0x18,%esp
  80d7bc:	8b 4d 08             	mov    0x8(%ebp),%ecx
    lwip_core_lock();

    struct sys_thread *t;
    LIST_FOREACH(t, &threads[tid % thread_hash_size], link)
  80d7bf:	ba 01 ff 00 ff       	mov    $0xff00ff01,%edx
  80d7c4:	89 c8                	mov    %ecx,%eax
  80d7c6:	f7 e2                	mul    %edx
  80d7c8:	c1 ea 08             	shr    $0x8,%edx
  80d7cb:	89 d0                	mov    %edx,%eax
  80d7cd:	c1 e0 08             	shl    $0x8,%eax
  80d7d0:	8d 14 10             	lea    (%eax,%edx,1),%edx
  80d7d3:	89 c8                	mov    %ecx,%eax
  80d7d5:	29 d0                	sub    %edx,%eax
  80d7d7:	8b 04 85 40 f1 b3 00 	mov    0xb3f140(,%eax,4),%eax
  80d7de:	85 c0                	test   %eax,%eax
  80d7e0:	74 36                	je     80d818 <timeout_cleanup+0x62>
	if (t->tid == tid) {
  80d7e2:	39 08                	cmp    %ecx,(%eax)
  80d7e4:	75 2b                	jne    80d811 <timeout_cleanup+0x5b>
  80d7e6:	eb 0a                	jmp    80d7f2 <timeout_cleanup+0x3c>
  80d7e8:	39 08                	cmp    %ecx,(%eax)
  80d7ea:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  80d7f0:	75 1f                	jne    80d811 <timeout_cleanup+0x5b>
	    LIST_REMOVE(t, link);
  80d7f2:	8b 50 08             	mov    0x8(%eax),%edx
  80d7f5:	85 d2                	test   %edx,%edx
  80d7f7:	74 06                	je     80d7ff <timeout_cleanup+0x49>
  80d7f9:	8b 48 0c             	mov    0xc(%eax),%ecx
  80d7fc:	89 4a 0c             	mov    %ecx,0xc(%edx)
  80d7ff:	8b 50 0c             	mov    0xc(%eax),%edx
  80d802:	8b 48 08             	mov    0x8(%eax),%ecx
  80d805:	89 0a                	mov    %ecx,(%edx)
	    free(t);
  80d807:	89 04 24             	mov    %eax,(%esp)
  80d80a:	e8 71 54 ff ff       	call   802c80 <free>
	    goto done;
  80d80f:	eb 07                	jmp    80d818 <timeout_cleanup+0x62>
timeout_cleanup(thread_id_t tid)
{
    lwip_core_lock();

    struct sys_thread *t;
    LIST_FOREACH(t, &threads[tid % thread_hash_size], link)
  80d811:	8b 40 08             	mov    0x8(%eax),%eax
  80d814:	85 c0                	test   %eax,%eax
  80d816:	75 d0                	jne    80d7e8 <timeout_cleanup+0x32>
	}

    if (debug) cprintf("timeout_cleanup: bogus tid %ld\n", tid);
 done:
    lwip_core_unlock();
}
  80d818:	c9                   	leave  
  80d819:	c3                   	ret    

0080d81a <lwip_thread_entry>:
    void *arg;
};

static void
lwip_thread_entry(uint32_t arg)
{
  80d81a:	55                   	push   %ebp
  80d81b:	89 e5                	mov    %esp,%ebp
  80d81d:	53                   	push   %ebx
  80d81e:	83 ec 14             	sub    $0x14,%esp
  80d821:	8b 5d 08             	mov    0x8(%ebp),%ebx
    struct lwip_thread *lt = (struct lwip_thread *)arg;
    lwip_core_lock();
    lt->func(lt->arg);
  80d824:	8b 43 04             	mov    0x4(%ebx),%eax
  80d827:	89 04 24             	mov    %eax,(%esp)
  80d82a:	ff 13                	call   *(%ebx)
    lwip_core_unlock();
    free(lt);
  80d82c:	89 1c 24             	mov    %ebx,(%esp)
  80d82f:	e8 4c 54 ff ff       	call   802c80 <free>
}
  80d834:	83 c4 14             	add    $0x14,%esp
  80d837:	5b                   	pop    %ebx
  80d838:	5d                   	pop    %ebp
  80d839:	c3                   	ret    

0080d83a <sys_thread_new>:

sys_thread_t
sys_thread_new(char *name, void (* thread)(void *arg), void *arg, 
	       int stacksize, int prio)
{
  80d83a:	55                   	push   %ebp
  80d83b:	89 e5                	mov    %esp,%ebp
  80d83d:	53                   	push   %ebx
  80d83e:	83 ec 24             	sub    $0x24,%esp
  80d841:	8b 5d 14             	mov    0x14(%ebp),%ebx
    struct lwip_thread *lt = malloc(sizeof(*lt));
  80d844:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
  80d84b:	e8 03 55 ff ff       	call   802d53 <malloc>
    if (lt == 0)
  80d850:	85 c0                	test   %eax,%eax
  80d852:	75 1c                	jne    80d870 <sys_thread_new+0x36>
	panic("sys_thread_new: cannot allocate thread struct");
  80d854:	c7 44 24 08 bc 42 81 	movl   $0x8142bc,0x8(%esp)
  80d85b:	00 
  80d85c:	c7 44 24 04 fd 00 00 	movl   $0xfd,0x4(%esp)
  80d863:	00 
  80d864:	c7 04 24 18 42 81 00 	movl   $0x814218,(%esp)
  80d86b:	e8 2c 31 ff ff       	call   80099c <_panic>

    if (stacksize > PGSIZE)
  80d870:	81 fb 00 10 00 00    	cmp    $0x1000,%ebx
  80d876:	7e 20                	jle    80d898 <sys_thread_new+0x5e>
	panic("large stack %d", stacksize);
  80d878:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  80d87c:	c7 44 24 08 62 42 81 	movl   $0x814262,0x8(%esp)
  80d883:	00 
  80d884:	c7 44 24 04 00 01 00 	movl   $0x100,0x4(%esp)
  80d88b:	00 
  80d88c:	c7 04 24 18 42 81 00 	movl   $0x814218,(%esp)
  80d893:	e8 04 31 ff ff       	call   80099c <_panic>

    lt->func = thread;
  80d898:	8b 55 0c             	mov    0xc(%ebp),%edx
  80d89b:	89 10                	mov    %edx,(%eax)
    lt->arg = arg;
  80d89d:	8b 55 10             	mov    0x10(%ebp),%edx
  80d8a0:	89 50 04             	mov    %edx,0x4(%eax)

    thread_id_t tid;
    int r = thread_create(&tid, name, lwip_thread_entry, (uint32_t)lt);
  80d8a3:	89 44 24 0c          	mov    %eax,0xc(%esp)
  80d8a7:	c7 44 24 08 1a d8 80 	movl   $0x80d81a,0x8(%esp)
  80d8ae:	00 
  80d8af:	8b 45 08             	mov    0x8(%ebp),%eax
  80d8b2:	89 44 24 04          	mov    %eax,0x4(%esp)
  80d8b6:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80d8b9:	89 04 24             	mov    %eax,(%esp)
  80d8bc:	e8 d6 07 00 00       	call   80e097 <thread_create>

    if (r < 0)
  80d8c1:	85 c0                	test   %eax,%eax
  80d8c3:	79 28                	jns    80d8ed <sys_thread_new+0xb3>
	panic("lwip: sys_thread_new: cannot create: %s\n", e2s(r));
  80d8c5:	89 04 24             	mov    %eax,(%esp)
  80d8c8:	e8 cb 09 00 00       	call   80e298 <e2s>
  80d8cd:	89 44 24 0c          	mov    %eax,0xc(%esp)
  80d8d1:	c7 44 24 08 ec 42 81 	movl   $0x8142ec,0x8(%esp)
  80d8d8:	00 
  80d8d9:	c7 44 24 04 09 01 00 	movl   $0x109,0x4(%esp)
  80d8e0:	00 
  80d8e1:	c7 04 24 18 42 81 00 	movl   $0x814218,(%esp)
  80d8e8:	e8 af 30 ff ff       	call   80099c <_panic>

    return tid;
}
  80d8ed:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80d8f0:	83 c4 24             	add    $0x24,%esp
  80d8f3:	5b                   	pop    %ebx
  80d8f4:	5d                   	pop    %ebp
  80d8f5:	c3                   	ret    

0080d8f6 <sys_arch_sem_wait>:
    }
}

u32_t
sys_arch_sem_wait(sys_sem_t sem, u32_t tm_msec)
{
  80d8f6:	55                   	push   %ebp
  80d8f7:	89 e5                	mov    %esp,%ebp
  80d8f9:	57                   	push   %edi
  80d8fa:	56                   	push   %esi
  80d8fb:	53                   	push   %ebx
  80d8fc:	83 ec 3c             	sub    $0x3c,%esp
    assert(!sems[sem].freed);
  80d8ff:	8b 55 08             	mov    0x8(%ebp),%edx
  80d902:	8d 04 92             	lea    (%edx,%edx,4),%eax
  80d905:	83 3c 85 00 8f b3 00 	cmpl   $0x0,0xb38f00(,%eax,4)
  80d90c:	00 
  80d90d:	74 24                	je     80d933 <sys_arch_sem_wait+0x3d>
  80d90f:	c7 44 24 0c 07 42 81 	movl   $0x814207,0xc(%esp)
  80d916:	00 
  80d917:	c7 44 24 08 50 2d 81 	movl   $0x812d50,0x8(%esp)
  80d91e:	00 
  80d91f:	c7 44 24 04 ac 00 00 	movl   $0xac,0x4(%esp)
  80d926:	00 
  80d927:	c7 04 24 18 42 81 00 	movl   $0x814218,(%esp)
  80d92e:	e8 69 30 ff ff       	call   80099c <_panic>
    u32_t waited = 0;

    int gen = sems[sem].gen;
  80d933:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80d936:	8d 04 89             	lea    (%ecx,%ecx,4),%eax
  80d939:	8b 04 85 04 8f b3 00 	mov    0xb38f04(,%eax,4),%eax
  80d940:	89 45 dc             	mov    %eax,-0x24(%ebp)

    while (tm_msec == 0 || waited < tm_msec) {
  80d943:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  80d947:	0f 94 45 d7          	sete   -0x29(%ebp)
  80d94b:	0f 95 45 e3          	setne  -0x1d(%ebp)
  80d94f:	80 7d d7 00          	cmpb   $0x0,-0x29(%ebp)
  80d953:	75 0a                	jne    80d95f <sys_arch_sem_wait+0x69>
  80d955:	80 7d e3 00          	cmpb   $0x0,-0x1d(%ebp)
  80d959:	0f 84 d7 00 00 00    	je     80da36 <sys_arch_sem_wait+0x140>
	if (sems[sem].counter > 0) {
  80d95f:	8b 55 08             	mov    0x8(%ebp),%edx
  80d962:	8d 04 92             	lea    (%edx,%edx,4),%eax
  80d965:	0f b7 04 85 08 8f b3 	movzwl 0xb38f08(,%eax,4),%eax
  80d96c:	00 
  80d96d:	bf 00 00 00 00       	mov    $0x0,%edi
  80d972:	66 85 c0             	test   %ax,%ax
  80d975:	75 17                	jne    80d98e <sys_arch_sem_wait+0x98>
	    sems[sem].counter--;
	    return waited;
 	} else if (tm_msec == SYS_ARCH_NOWAIT) {
  80d977:	83 7d 0c fe          	cmpl   $0xfffffffe,0xc(%ebp)
  80d97b:	75 27                	jne    80d9a4 <sys_arch_sem_wait+0xae>
  80d97d:	e9 b4 00 00 00       	jmp    80da36 <sys_arch_sem_wait+0x140>
    u32_t waited = 0;

    int gen = sems[sem].gen;

    while (tm_msec == 0 || waited < tm_msec) {
	if (sems[sem].counter > 0) {
  80d982:	0f b7 83 08 8f b3 00 	movzwl 0xb38f08(%ebx),%eax
  80d989:	66 85 c0             	test   %ax,%ax
  80d98c:	74 31                	je     80d9bf <sys_arch_sem_wait+0xc9>
	    sems[sem].counter--;
  80d98e:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80d991:	8d 14 89             	lea    (%ecx,%ecx,4),%edx
  80d994:	83 e8 01             	sub    $0x1,%eax
  80d997:	66 89 04 95 08 8f b3 	mov    %ax,0xb38f08(,%edx,4)
  80d99e:	00 
	    return waited;
  80d99f:	e9 97 00 00 00       	jmp    80da3b <sys_arch_sem_wait+0x145>
	    uint32_t a = sys_time_msec();
	    uint32_t sleep_until = tm_msec ? a + (tm_msec - waited) : ~0;
	    sems[sem].waiters = 1;
	    uint32_t cur_v = sems[sem].v;
	    lwip_core_unlock();
	    thread_wait(&sems[sem].v, cur_v, sleep_until);
  80d9a4:	8b 55 08             	mov    0x8(%ebp),%edx
  80d9a7:	8d 04 92             	lea    (%edx,%edx,4),%eax
  80d9aa:	8d 04 85 08 8f b3 00 	lea    0xb38f08(,%eax,4),%eax
  80d9b1:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80d9b4:	bf 00 00 00 00       	mov    $0x0,%edi
 	} else if (tm_msec == SYS_ARCH_NOWAIT) {
	    return SYS_ARCH_TIMEOUT;
	} else {
	    uint32_t a = sys_time_msec();
	    uint32_t sleep_until = tm_msec ? a + (tm_msec - waited) : ~0;
	    sems[sem].waiters = 1;
  80d9b9:	8d 1c 92             	lea    (%edx,%edx,4),%ebx
  80d9bc:	c1 e3 02             	shl    $0x2,%ebx
	    sems[sem].counter--;
	    return waited;
 	} else if (tm_msec == SYS_ARCH_NOWAIT) {
	    return SYS_ARCH_TIMEOUT;
	} else {
	    uint32_t a = sys_time_msec();
  80d9bf:	e8 fb 3b ff ff       	call   8015bf <sys_time_msec>
  80d9c4:	89 45 e4             	mov    %eax,-0x1c(%ebp)
	    uint32_t sleep_until = tm_msec ? a + (tm_msec - waited) : ~0;
  80d9c7:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  80d9cc:	80 7d e3 00          	cmpb   $0x0,-0x1d(%ebp)
  80d9d0:	74 08                	je     80d9da <sys_arch_sem_wait+0xe4>
  80d9d2:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80d9d5:	03 45 0c             	add    0xc(%ebp),%eax
  80d9d8:	29 f8                	sub    %edi,%eax
	    sems[sem].waiters = 1;
  80d9da:	be 00 8f b3 00       	mov    $0xb38f00,%esi
  80d9df:	66 c7 44 33 0a 01 00 	movw   $0x1,0xa(%ebx,%esi,1)
	    uint32_t cur_v = sems[sem].v;
	    lwip_core_unlock();
	    thread_wait(&sems[sem].v, cur_v, sleep_until);
  80d9e6:	89 44 24 08          	mov    %eax,0x8(%esp)
  80d9ea:	8b 44 33 08          	mov    0x8(%ebx,%esi,1),%eax
  80d9ee:	89 44 24 04          	mov    %eax,0x4(%esp)
  80d9f2:	8b 4d d8             	mov    -0x28(%ebp),%ecx
  80d9f5:	89 0c 24             	mov    %ecx,(%esp)
  80d9f8:	e8 e2 07 00 00       	call   80e1df <thread_wait>
	    lwip_core_lock();
	    if (gen != sems[sem].gen) {
  80d9fd:	8b 45 dc             	mov    -0x24(%ebp),%eax
  80da00:	39 44 33 04          	cmp    %eax,0x4(%ebx,%esi,1)
  80da04:	74 13                	je     80da19 <sys_arch_sem_wait+0x123>
		cprintf("sys_arch_sem_wait: sem freed under waiter!\n");
  80da06:	c7 04 24 18 43 81 00 	movl   $0x814318,(%esp)
  80da0d:	e8 4f 30 ff ff       	call   800a61 <cprintf>
  80da12:	bf ff ff ff ff       	mov    $0xffffffff,%edi
		return SYS_ARCH_TIMEOUT;
  80da17:	eb 22                	jmp    80da3b <sys_arch_sem_wait+0x145>
	    }
	    uint32_t b = sys_time_msec();
  80da19:	e8 a1 3b ff ff       	call   8015bf <sys_time_msec>
	    waited += (b - a);
  80da1e:	2b 45 e4             	sub    -0x1c(%ebp),%eax
  80da21:	01 c7                	add    %eax,%edi
    assert(!sems[sem].freed);
    u32_t waited = 0;

    int gen = sems[sem].gen;

    while (tm_msec == 0 || waited < tm_msec) {
  80da23:	39 7d 0c             	cmp    %edi,0xc(%ebp)
  80da26:	0f 87 56 ff ff ff    	ja     80d982 <sys_arch_sem_wait+0x8c>
  80da2c:	80 7d d7 00          	cmpb   $0x0,-0x29(%ebp)
  80da30:	0f 85 4c ff ff ff    	jne    80d982 <sys_arch_sem_wait+0x8c>
  80da36:	bf ff ff ff ff       	mov    $0xffffffff,%edi
	    waited += (b - a);
	}
    }

    return SYS_ARCH_TIMEOUT;
}
  80da3b:	89 f8                	mov    %edi,%eax
  80da3d:	83 c4 3c             	add    $0x3c,%esp
  80da40:	5b                   	pop    %ebx
  80da41:	5e                   	pop    %esi
  80da42:	5f                   	pop    %edi
  80da43:	5d                   	pop    %ebp
  80da44:	c3                   	ret    

0080da45 <sys_sem_new>:
    return ERR_OK;
}

sys_sem_t
sys_sem_new(u8_t count)
{
  80da45:	55                   	push   %ebp
  80da46:	89 e5                	mov    %esp,%ebp
  80da48:	53                   	push   %ebx
  80da49:	83 ec 14             	sub    $0x14,%esp
  80da4c:	0f b6 4d 08          	movzbl 0x8(%ebp),%ecx
    struct sys_sem_entry *se = LIST_FIRST(&sem_free);
  80da50:	a1 00 a3 b3 00       	mov    0xb3a300,%eax
    if (!se) {
  80da55:	85 c0                	test   %eax,%eax
  80da57:	75 13                	jne    80da6c <sys_sem_new+0x27>
	cprintf("lwip: sys_sem_new: out of semaphores\n");
  80da59:	c7 04 24 44 43 81 00 	movl   $0x814344,(%esp)
  80da60:	e8 fc 2f ff ff       	call   800a61 <cprintf>
  80da65:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
	return SYS_SEM_NULL;
  80da6a:	eb 5d                	jmp    80dac9 <sys_sem_new+0x84>
    }
    LIST_REMOVE(se, link);
  80da6c:	8b 50 0c             	mov    0xc(%eax),%edx
  80da6f:	85 d2                	test   %edx,%edx
  80da71:	74 06                	je     80da79 <sys_sem_new+0x34>
  80da73:	8b 58 10             	mov    0x10(%eax),%ebx
  80da76:	89 5a 10             	mov    %ebx,0x10(%edx)
  80da79:	8b 50 10             	mov    0x10(%eax),%edx
  80da7c:	8b 58 0c             	mov    0xc(%eax),%ebx
  80da7f:	89 1a                	mov    %ebx,(%edx)
    assert(se->freed);
  80da81:	83 38 00             	cmpl   $0x0,(%eax)
  80da84:	75 24                	jne    80daaa <sys_sem_new+0x65>
  80da86:	c7 44 24 0c 71 42 81 	movl   $0x814271,0xc(%esp)
  80da8d:	00 
  80da8e:	c7 44 24 08 50 2d 81 	movl   $0x812d50,0x8(%esp)
  80da95:	00 
  80da96:	c7 44 24 04 8d 00 00 	movl   $0x8d,0x4(%esp)
  80da9d:	00 
  80da9e:	c7 04 24 18 42 81 00 	movl   $0x814218,(%esp)
  80daa5:	e8 f2 2e ff ff       	call   80099c <_panic>
    se->freed = 0;
  80daaa:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    se->counter = count;
  80dab0:	0f b6 c9             	movzbl %cl,%ecx
  80dab3:	66 89 48 08          	mov    %cx,0x8(%eax)
    se->gen++;
  80dab7:	83 40 04 01          	addl   $0x1,0x4(%eax)
    return se - &sems[0];
  80dabb:	2d 00 8f b3 00       	sub    $0xb38f00,%eax
  80dac0:	c1 f8 02             	sar    $0x2,%eax
  80dac3:	69 c0 cd cc cc cc    	imul   $0xcccccccd,%eax,%eax
}
  80dac9:	83 c4 14             	add    $0x14,%esp
  80dacc:	5b                   	pop    %ebx
  80dacd:	5d                   	pop    %ebp
  80dace:	c3                   	ret    

0080dacf <sys_mbox_new>:
    }
}

sys_mbox_t
sys_mbox_new(int size)
{
  80dacf:	55                   	push   %ebp
  80dad0:	89 e5                	mov    %esp,%ebp
  80dad2:	56                   	push   %esi
  80dad3:	53                   	push   %ebx
  80dad4:	83 ec 10             	sub    $0x10,%esp
    assert(size < MBOXSLOTS);
  80dad7:	83 7d 08 1f          	cmpl   $0x1f,0x8(%ebp)
  80dadb:	7e 24                	jle    80db01 <sys_mbox_new+0x32>
  80dadd:	c7 44 24 0c 7b 42 81 	movl   $0x81427b,0xc(%esp)
  80dae4:	00 
  80dae5:	c7 44 24 08 50 2d 81 	movl   $0x812d50,0x8(%esp)
  80daec:	00 
  80daed:	c7 44 24 04 45 00 00 	movl   $0x45,0x4(%esp)
  80daf4:	00 
  80daf5:	c7 04 24 18 42 81 00 	movl   $0x814218,(%esp)
  80dafc:	e8 9b 2e ff ff       	call   80099c <_panic>
    struct sys_mbox_entry *mbe = LIST_FIRST(&mbox_free);
  80db01:	8b 1d 20 f1 b3 00    	mov    0xb3f120,%ebx
    if (!mbe) {
  80db07:	85 db                	test   %ebx,%ebx
  80db09:	75 16                	jne    80db21 <sys_mbox_new+0x52>
	cprintf("lwip: sys_mbox_new: out of mailboxes\n");
  80db0b:	c7 04 24 6c 43 81 00 	movl   $0x81436c,(%esp)
  80db12:	e8 4a 2f ff ff       	call   800a61 <cprintf>
  80db17:	be ff ff ff ff       	mov    $0xffffffff,%esi
	return SYS_MBOX_NULL;
  80db1c:	e9 bd 00 00 00       	jmp    80dbde <sys_mbox_new+0x10f>
    }
    LIST_REMOVE(mbe, link);
  80db21:	8b 83 94 00 00 00    	mov    0x94(%ebx),%eax
  80db27:	85 c0                	test   %eax,%eax
  80db29:	74 0c                	je     80db37 <sys_mbox_new+0x68>
  80db2b:	8b 93 98 00 00 00    	mov    0x98(%ebx),%edx
  80db31:	89 90 98 00 00 00    	mov    %edx,0x98(%eax)
  80db37:	8b 83 98 00 00 00    	mov    0x98(%ebx),%eax
  80db3d:	8b 93 94 00 00 00    	mov    0x94(%ebx),%edx
  80db43:	89 10                	mov    %edx,(%eax)
    assert(mbe->freed);
  80db45:	83 3b 00             	cmpl   $0x0,(%ebx)
  80db48:	75 24                	jne    80db6e <sys_mbox_new+0x9f>
  80db4a:	c7 44 24 0c 8c 42 81 	movl   $0x81428c,0xc(%esp)
  80db51:	00 
  80db52:	c7 44 24 08 50 2d 81 	movl   $0x812d50,0x8(%esp)
  80db59:	00 
  80db5a:	c7 44 24 04 4c 00 00 	movl   $0x4c,0x4(%esp)
  80db61:	00 
  80db62:	c7 04 24 18 42 81 00 	movl   $0x814218,(%esp)
  80db69:	e8 2e 2e ff ff       	call   80099c <_panic>
    mbe->freed = 0;
  80db6e:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)

    int i = mbe - &mboxes[0];
  80db74:	89 de                	mov    %ebx,%esi
  80db76:	81 ee 20 a3 b3 00    	sub    $0xb3a320,%esi
  80db7c:	c1 fe 02             	sar    $0x2,%esi
  80db7f:	69 f6 97 6f f9 96    	imul   $0x96f96f97,%esi,%esi
    mbe->head = -1;
  80db85:	c7 43 04 ff ff ff ff 	movl   $0xffffffff,0x4(%ebx)
    mbe->nextq = 0;
  80db8c:	c7 43 08 00 00 00 00 	movl   $0x0,0x8(%ebx)
    mbe->queued_msg = sys_sem_new(0);
  80db93:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80db9a:	e8 a6 fe ff ff       	call   80da45 <sys_sem_new>
  80db9f:	89 83 8c 00 00 00    	mov    %eax,0x8c(%ebx)
    mbe->free_msg = sys_sem_new(MBOXSLOTS);
  80dba5:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
  80dbac:	e8 94 fe ff ff       	call   80da45 <sys_sem_new>
  80dbb1:	89 83 90 00 00 00    	mov    %eax,0x90(%ebx)

    if (mbe->queued_msg == SYS_SEM_NULL ||
  80dbb7:	83 bb 8c 00 00 00 ff 	cmpl   $0xffffffff,0x8c(%ebx)
  80dbbe:	74 05                	je     80dbc5 <sys_mbox_new+0xf6>
  80dbc0:	83 f8 ff             	cmp    $0xffffffff,%eax
  80dbc3:	75 19                	jne    80dbde <sys_mbox_new+0x10f>
	mbe->free_msg == SYS_SEM_NULL)
    {
	sys_mbox_free(i);
  80dbc5:	89 34 24             	mov    %esi,(%esp)
  80dbc8:	e8 46 fa ff ff       	call   80d613 <sys_mbox_free>
	cprintf("lwip: sys_mbox_new: can't get semaphore\n");
  80dbcd:	c7 04 24 94 43 81 00 	movl   $0x814394,(%esp)
  80dbd4:	e8 88 2e ff ff       	call   800a61 <cprintf>
  80dbd9:	be ff ff ff ff       	mov    $0xffffffff,%esi
	return SYS_MBOX_NULL;
    }
    return i;
}
  80dbde:	89 f0                	mov    %esi,%eax
  80dbe0:	83 c4 10             	add    $0x10,%esp
  80dbe3:	5b                   	pop    %ebx
  80dbe4:	5e                   	pop    %esi
  80dbe5:	5d                   	pop    %ebp
  80dbe6:	c3                   	ret    

0080dbe7 <sys_sem_signal>:
    LIST_INSERT_HEAD(&sem_free, &sems[sem], link);
}

void
sys_sem_signal(sys_sem_t sem)
{
  80dbe7:	55                   	push   %ebp
  80dbe8:	89 e5                	mov    %esp,%ebp
  80dbea:	83 ec 18             	sub    $0x18,%esp
  80dbed:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  80dbf0:	89 75 fc             	mov    %esi,-0x4(%ebp)
  80dbf3:	8b 45 08             	mov    0x8(%ebp),%eax
    assert(!sems[sem].freed);
  80dbf6:	8d 14 80             	lea    (%eax,%eax,4),%edx
  80dbf9:	83 3c 95 00 8f b3 00 	cmpl   $0x0,0xb38f00(,%edx,4)
  80dc00:	00 
  80dc01:	74 24                	je     80dc27 <sys_sem_signal+0x40>
  80dc03:	c7 44 24 0c 07 42 81 	movl   $0x814207,0xc(%esp)
  80dc0a:	00 
  80dc0b:	c7 44 24 08 50 2d 81 	movl   $0x812d50,0x8(%esp)
  80dc12:	00 
  80dc13:	c7 44 24 04 a1 00 00 	movl   $0xa1,0x4(%esp)
  80dc1a:	00 
  80dc1b:	c7 04 24 18 42 81 00 	movl   $0x814218,(%esp)
  80dc22:	e8 75 2d ff ff       	call   80099c <_panic>
    sems[sem].counter++;
  80dc27:	ba 00 8f b3 00       	mov    $0xb38f00,%edx
  80dc2c:	8d 0c 85 00 00 00 00 	lea    0x0(,%eax,4),%ecx
  80dc33:	8d 1c 01             	lea    (%ecx,%eax,1),%ebx
  80dc36:	c1 e3 02             	shl    $0x2,%ebx
  80dc39:	0f b7 74 13 08       	movzwl 0x8(%ebx,%edx,1),%esi
  80dc3e:	83 c6 01             	add    $0x1,%esi
  80dc41:	66 89 74 13 08       	mov    %si,0x8(%ebx,%edx,1)
    if (sems[sem].waiters) {
  80dc46:	01 c1                	add    %eax,%ecx
  80dc48:	66 83 7c 8a 0a 00    	cmpw   $0x0,0xa(%edx,%ecx,4)
  80dc4e:	74 19                	je     80dc69 <sys_sem_signal+0x82>
	sems[sem].waiters = 0;
  80dc50:	66 c7 04 8d 0a 8f b3 	movw   $0x0,0xb38f0a(,%ecx,4)
  80dc57:	00 00 00 
	thread_wakeup(&sems[sem].v);
  80dc5a:	8d 04 8d 08 8f b3 00 	lea    0xb38f08(,%ecx,4),%eax
  80dc61:	89 04 24             	mov    %eax,(%esp)
  80dc64:	e8 76 02 00 00       	call   80dedf <thread_wakeup>
    }
}
  80dc69:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  80dc6c:	8b 75 fc             	mov    -0x4(%ebp),%esi
  80dc6f:	89 ec                	mov    %ebp,%esp
  80dc71:	5d                   	pop    %ebp
  80dc72:	c3                   	ret    

0080dc73 <sys_arch_mbox_fetch>:
    return SYS_ARCH_TIMEOUT;
}

u32_t
sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t tm_msec)
{
  80dc73:	55                   	push   %ebp
  80dc74:	89 e5                	mov    %esp,%ebp
  80dc76:	83 ec 28             	sub    $0x28,%esp
  80dc79:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  80dc7c:	89 75 f8             	mov    %esi,-0x8(%ebp)
  80dc7f:	89 7d fc             	mov    %edi,-0x4(%ebp)
  80dc82:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80dc85:	8b 7d 0c             	mov    0xc(%ebp),%edi
    assert(!mboxes[mbox].freed);
  80dc88:	69 c3 9c 00 00 00    	imul   $0x9c,%ebx,%eax
  80dc8e:	83 b8 20 a3 b3 00 00 	cmpl   $0x0,0xb3a320(%eax)
  80dc95:	74 24                	je     80dcbb <sys_arch_mbox_fetch+0x48>
  80dc97:	c7 44 24 0c 35 42 81 	movl   $0x814235,0xc(%esp)
  80dc9e:	00 
  80dc9f:	c7 44 24 08 50 2d 81 	movl   $0x812d50,0x8(%esp)
  80dca6:	00 
  80dca7:	c7 44 24 04 ce 00 00 	movl   $0xce,0x4(%esp)
  80dcae:	00 
  80dcaf:	c7 04 24 18 42 81 00 	movl   $0x814218,(%esp)
  80dcb6:	e8 e1 2c ff ff       	call   80099c <_panic>

    u32_t waited = sys_arch_sem_wait(mboxes[mbox].queued_msg, tm_msec);
  80dcbb:	8b 45 10             	mov    0x10(%ebp),%eax
  80dcbe:	89 44 24 04          	mov    %eax,0x4(%esp)
  80dcc2:	69 c3 9c 00 00 00    	imul   $0x9c,%ebx,%eax
  80dcc8:	8b 80 ac a3 b3 00    	mov    0xb3a3ac(%eax),%eax
  80dcce:	89 04 24             	mov    %eax,(%esp)
  80dcd1:	e8 20 fc ff ff       	call   80d8f6 <sys_arch_sem_wait>
  80dcd6:	89 c6                	mov    %eax,%esi
    if (waited == SYS_ARCH_TIMEOUT)
  80dcd8:	83 f8 ff             	cmp    $0xffffffff,%eax
  80dcdb:	0f 84 85 00 00 00    	je     80dd66 <sys_arch_mbox_fetch+0xf3>
	return waited;

    int slot = mboxes[mbox].head;
  80dce1:	69 c3 9c 00 00 00    	imul   $0x9c,%ebx,%eax
  80dce7:	8b 80 24 a3 b3 00    	mov    0xb3a324(%eax),%eax
    if (slot == -1)
  80dced:	83 f8 ff             	cmp    $0xffffffff,%eax
  80dcf0:	75 1c                	jne    80dd0e <sys_arch_mbox_fetch+0x9b>
	panic("lwip: sys_arch_mbox_fetch: no message");
  80dcf2:	c7 44 24 08 c0 43 81 	movl   $0x8143c0,0x8(%esp)
  80dcf9:	00 
  80dcfa:	c7 44 24 04 d6 00 00 	movl   $0xd6,0x4(%esp)
  80dd01:	00 
  80dd02:	c7 04 24 18 42 81 00 	movl   $0x814218,(%esp)
  80dd09:	e8 8e 2c ff ff       	call   80099c <_panic>
    if (msg)
  80dd0e:	85 ff                	test   %edi,%edi
  80dd10:	74 0e                	je     80dd20 <sys_arch_mbox_fetch+0xad>
	*msg = mboxes[mbox].msg[slot];
  80dd12:	6b d3 27             	imul   $0x27,%ebx,%edx
  80dd15:	01 c2                	add    %eax,%edx
  80dd17:	8b 14 95 2c a3 b3 00 	mov    0xb3a32c(,%edx,4),%edx
  80dd1e:	89 17                	mov    %edx,(%edi)

    mboxes[mbox].head = (slot + 1) % MBOXSLOTS;
  80dd20:	8d 48 01             	lea    0x1(%eax),%ecx
  80dd23:	89 ca                	mov    %ecx,%edx
  80dd25:	c1 fa 1f             	sar    $0x1f,%edx
  80dd28:	c1 ea 1b             	shr    $0x1b,%edx
  80dd2b:	8d 04 11             	lea    (%ecx,%edx,1),%eax
  80dd2e:	83 e0 1f             	and    $0x1f,%eax
  80dd31:	29 d0                	sub    %edx,%eax
  80dd33:	ba 20 a3 b3 00       	mov    $0xb3a320,%edx
  80dd38:	69 cb 9c 00 00 00    	imul   $0x9c,%ebx,%ecx
  80dd3e:	89 44 11 04          	mov    %eax,0x4(%ecx,%edx,1)
    if (mboxes[mbox].head == mboxes[mbox].nextq)
  80dd42:	3b 44 11 08          	cmp    0x8(%ecx,%edx,1),%eax
  80dd46:	75 0a                	jne    80dd52 <sys_arch_mbox_fetch+0xdf>
	mboxes[mbox].head = -1;
  80dd48:	c7 81 24 a3 b3 00 ff 	movl   $0xffffffff,0xb3a324(%ecx)
  80dd4f:	ff ff ff 

    sys_sem_signal(mboxes[mbox].free_msg);
  80dd52:	69 db 9c 00 00 00    	imul   $0x9c,%ebx,%ebx
  80dd58:	8b 83 b0 a3 b3 00    	mov    0xb3a3b0(%ebx),%eax
  80dd5e:	89 04 24             	mov    %eax,(%esp)
  80dd61:	e8 81 fe ff ff       	call   80dbe7 <sys_sem_signal>
    return waited;
}
  80dd66:	89 f0                	mov    %esi,%eax
  80dd68:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  80dd6b:	8b 75 f8             	mov    -0x8(%ebp),%esi
  80dd6e:	8b 7d fc             	mov    -0x4(%ebp),%edi
  80dd71:	89 ec                	mov    %ebp,%esp
  80dd73:	5d                   	pop    %ebp
  80dd74:	c3                   	ret    

0080dd75 <sys_arch_mbox_tryfetch>:

u32_t 
sys_arch_mbox_tryfetch(sys_mbox_t mbox, void **msg)
{
  80dd75:	55                   	push   %ebp
  80dd76:	89 e5                	mov    %esp,%ebp
  80dd78:	83 ec 18             	sub    $0x18,%esp
    return sys_arch_mbox_fetch(mbox, msg, SYS_ARCH_NOWAIT);
  80dd7b:	c7 44 24 08 fe ff ff 	movl   $0xfffffffe,0x8(%esp)
  80dd82:	ff 
  80dd83:	8b 45 0c             	mov    0xc(%ebp),%eax
  80dd86:	89 44 24 04          	mov    %eax,0x4(%esp)
  80dd8a:	8b 45 08             	mov    0x8(%ebp),%eax
  80dd8d:	89 04 24             	mov    %eax,(%esp)
  80dd90:	e8 de fe ff ff       	call   80dc73 <sys_arch_mbox_fetch>
}
  80dd95:	c9                   	leave  
  80dd96:	c3                   	ret    

0080dd97 <sys_mbox_trypost>:
    assert(sys_mbox_trypost(mbox, msg) == ERR_OK);
}

err_t 
sys_mbox_trypost(sys_mbox_t mbox, void *msg)
{
  80dd97:	55                   	push   %ebp
  80dd98:	89 e5                	mov    %esp,%ebp
  80dd9a:	83 ec 28             	sub    $0x28,%esp
  80dd9d:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  80dda0:	89 75 f8             	mov    %esi,-0x8(%ebp)
  80dda3:	89 7d fc             	mov    %edi,-0x4(%ebp)
  80dda6:	8b 75 08             	mov    0x8(%ebp),%esi
    assert(!mboxes[mbox].freed);
  80dda9:	69 c6 9c 00 00 00    	imul   $0x9c,%esi,%eax
  80ddaf:	83 b8 20 a3 b3 00 00 	cmpl   $0x0,0xb3a320(%eax)
  80ddb6:	74 24                	je     80dddc <sys_mbox_trypost+0x45>
  80ddb8:	c7 44 24 0c 35 42 81 	movl   $0x814235,0xc(%esp)
  80ddbf:	00 
  80ddc0:	c7 44 24 08 50 2d 81 	movl   $0x812d50,0x8(%esp)
  80ddc7:	00 
  80ddc8:	c7 44 24 04 72 00 00 	movl   $0x72,0x4(%esp)
  80ddcf:	00 
  80ddd0:	c7 04 24 18 42 81 00 	movl   $0x814218,(%esp)
  80ddd7:	e8 c0 2b ff ff       	call   80099c <_panic>

    sys_arch_sem_wait(mboxes[mbox].free_msg, 0);
  80dddc:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80dde3:	00 
  80dde4:	69 de 9c 00 00 00    	imul   $0x9c,%esi,%ebx
  80ddea:	8b 83 b0 a3 b3 00    	mov    0xb3a3b0(%ebx),%eax
  80ddf0:	89 04 24             	mov    %eax,(%esp)
  80ddf3:	e8 fe fa ff ff       	call   80d8f6 <sys_arch_sem_wait>
    if (mboxes[mbox].nextq == mboxes[mbox].head)
  80ddf8:	b9 20 a3 b3 00       	mov    $0xb3a320,%ecx
  80ddfd:	8b 54 0b 08          	mov    0x8(%ebx,%ecx,1),%edx
  80de01:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  80de06:	3b 54 0b 04          	cmp    0x4(%ebx,%ecx,1),%edx
  80de0a:	74 4c                	je     80de58 <sys_mbox_trypost+0xc1>
	return ERR_MEM;

    int slot = mboxes[mbox].nextq;
    mboxes[mbox].nextq = (slot + 1) % MBOXSLOTS;
  80de0c:	89 c8                	mov    %ecx,%eax
  80de0e:	89 d9                	mov    %ebx,%ecx
  80de10:	8d 7a 01             	lea    0x1(%edx),%edi
  80de13:	89 fb                	mov    %edi,%ebx
  80de15:	c1 fb 1f             	sar    $0x1f,%ebx
  80de18:	c1 eb 1b             	shr    $0x1b,%ebx
  80de1b:	01 df                	add    %ebx,%edi
  80de1d:	83 e7 1f             	and    $0x1f,%edi
  80de20:	29 df                	sub    %ebx,%edi
  80de22:	89 7c 01 08          	mov    %edi,0x8(%ecx,%eax,1)
    mboxes[mbox].msg[slot] = msg;
  80de26:	6b de 27             	imul   $0x27,%esi,%ebx
  80de29:	01 d3                	add    %edx,%ebx
  80de2b:	8b 7d 0c             	mov    0xc(%ebp),%edi
  80de2e:	89 7c 98 0c          	mov    %edi,0xc(%eax,%ebx,4)

    if (mboxes[mbox].head == -1)
  80de32:	83 7c 01 04 ff       	cmpl   $0xffffffff,0x4(%ecx,%eax,1)
  80de37:	75 06                	jne    80de3f <sys_mbox_trypost+0xa8>
	mboxes[mbox].head = slot;
  80de39:	89 91 24 a3 b3 00    	mov    %edx,0xb3a324(%ecx)

    sys_sem_signal(mboxes[mbox].queued_msg);
  80de3f:	69 f6 9c 00 00 00    	imul   $0x9c,%esi,%esi
  80de45:	8b 86 ac a3 b3 00    	mov    0xb3a3ac(%esi),%eax
  80de4b:	89 04 24             	mov    %eax,(%esp)
  80de4e:	e8 94 fd ff ff       	call   80dbe7 <sys_sem_signal>
  80de53:	b8 00 00 00 00       	mov    $0x0,%eax

    return ERR_OK;
}
  80de58:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  80de5b:	8b 75 f8             	mov    -0x8(%ebp),%esi
  80de5e:	8b 7d fc             	mov    -0x4(%ebp),%edi
  80de61:	89 ec                	mov    %ebp,%esp
  80de63:	5d                   	pop    %ebp
  80de64:	c3                   	ret    

0080de65 <sys_mbox_post>:
    mboxes[mbox].freed = 1;
}

void
sys_mbox_post(sys_mbox_t mbox, void *msg)
{
  80de65:	55                   	push   %ebp
  80de66:	89 e5                	mov    %esp,%ebp
  80de68:	83 ec 18             	sub    $0x18,%esp
    assert(sys_mbox_trypost(mbox, msg) == ERR_OK);
  80de6b:	8b 45 0c             	mov    0xc(%ebp),%eax
  80de6e:	89 44 24 04          	mov    %eax,0x4(%esp)
  80de72:	8b 45 08             	mov    0x8(%ebp),%eax
  80de75:	89 04 24             	mov    %eax,(%esp)
  80de78:	e8 1a ff ff ff       	call   80dd97 <sys_mbox_trypost>
  80de7d:	84 c0                	test   %al,%al
  80de7f:	74 24                	je     80dea5 <sys_mbox_post+0x40>
  80de81:	c7 44 24 0c e8 43 81 	movl   $0x8143e8,0xc(%esp)
  80de88:	00 
  80de89:	c7 44 24 08 50 2d 81 	movl   $0x812d50,0x8(%esp)
  80de90:	00 
  80de91:	c7 44 24 04 6c 00 00 	movl   $0x6c,0x4(%esp)
  80de98:	00 
  80de99:	c7 04 24 18 42 81 00 	movl   $0x814218,(%esp)
  80dea0:	e8 f7 2a ff ff       	call   80099c <_panic>
}
  80dea5:	c9                   	leave  
  80dea6:	c3                   	ret    
	...

0080deb0 <thread_init>:

static struct thread_queue thread_queue;
static struct thread_queue kill_queue;

void
thread_init(void) {
  80deb0:	55                   	push   %ebp
  80deb1:	89 e5                	mov    %esp,%ebp
};

static inline void 
threadq_init(struct thread_queue *tq)
{
    tq->tq_first = 0;
  80deb3:	c7 05 4c f5 b3 00 00 	movl   $0x0,0xb3f54c
  80deba:	00 00 00 
    tq->tq_last = 0;
  80debd:	c7 05 50 f5 b3 00 00 	movl   $0x0,0xb3f550
  80dec4:	00 00 00 
    threadq_init(&thread_queue);
    max_tid = 0;
  80dec7:	c7 05 44 f5 b3 00 00 	movl   $0x0,0xb3f544
  80dece:	00 00 00 
}
  80ded1:	5d                   	pop    %ebp
  80ded2:	c3                   	ret    

0080ded3 <thread_id>:

uint32_t
thread_id(void) {
  80ded3:	55                   	push   %ebp
  80ded4:	89 e5                	mov    %esp,%ebp
  80ded6:	a1 48 f5 b3 00       	mov    0xb3f548,%eax
  80dedb:	8b 00                	mov    (%eax),%eax
    return cur_tc->tc_tid;
}
  80dedd:	5d                   	pop    %ebp
  80dede:	c3                   	ret    

0080dedf <thread_wakeup>:

void
thread_wakeup(volatile uint32_t *addr) {
  80dedf:	55                   	push   %ebp
  80dee0:	89 e5                	mov    %esp,%ebp
  80dee2:	8b 55 08             	mov    0x8(%ebp),%edx
    struct thread_context *tc = thread_queue.tq_first;
  80dee5:	a1 4c f5 b3 00       	mov    0xb3f54c,%eax
    while (tc) {
  80deea:	85 c0                	test   %eax,%eax
  80deec:	74 10                	je     80defe <thread_wakeup+0x1f>
	if (tc->tc_wait_addr == addr)
  80deee:	39 50 48             	cmp    %edx,0x48(%eax)
  80def1:	75 04                	jne    80def7 <thread_wakeup+0x18>
	    tc->tc_wakeup = 1;
  80def3:	c6 40 4c 01          	movb   $0x1,0x4c(%eax)
	tc = tc->tc_queue_link;
  80def7:	8b 40 64             	mov    0x64(%eax),%eax
}

void
thread_wakeup(volatile uint32_t *addr) {
    struct thread_context *tc = thread_queue.tq_first;
    while (tc) {
  80defa:	85 c0                	test   %eax,%eax
  80defc:	75 f0                	jne    80deee <thread_wakeup+0xf>
	if (tc->tc_wait_addr == addr)
	    tc->tc_wakeup = 1;
	tc = tc->tc_queue_link;
    }
}
  80defe:	5d                   	pop    %ebp
  80deff:	90                   	nop
  80df00:	c3                   	ret    

0080df01 <thread_wakeups_pending>:
    cur_tc->tc_wakeup = 0;
}

int
thread_wakeups_pending(void)
{
  80df01:	55                   	push   %ebp
  80df02:	89 e5                	mov    %esp,%ebp
    struct thread_context *tc = thread_queue.tq_first;
  80df04:	8b 15 4c f5 b3 00    	mov    0xb3f54c,%edx
    int n = 0;
    while (tc) {
  80df0a:	b8 00 00 00 00       	mov    $0x0,%eax
  80df0f:	85 d2                	test   %edx,%edx
  80df11:	74 11                	je     80df24 <thread_wakeups_pending+0x23>
	if (tc->tc_wakeup)
  80df13:	0f b6 4a 4c          	movzbl 0x4c(%edx),%ecx
	    ++n;
  80df17:	80 f9 01             	cmp    $0x1,%cl
  80df1a:	83 d8 ff             	sbb    $0xffffffff,%eax
	tc = tc->tc_queue_link;
  80df1d:	8b 52 64             	mov    0x64(%edx),%edx
int
thread_wakeups_pending(void)
{
    struct thread_context *tc = thread_queue.tq_first;
    int n = 0;
    while (tc) {
  80df20:	85 d2                	test   %edx,%edx
  80df22:	75 ef                	jne    80df13 <thread_wakeups_pending+0x12>
	if (tc->tc_wakeup)
	    ++n;
	tc = tc->tc_queue_link;
    }
    return n;
}
  80df24:	5d                   	pop    %ebp
  80df25:	c3                   	ret    

0080df26 <thread_onhalt>:

int
thread_onhalt(void (*fun)(thread_id_t)) {
  80df26:	55                   	push   %ebp
  80df27:	89 e5                	mov    %esp,%ebp
    if (cur_tc->tc_nonhalt >= THREAD_NUM_ONHALT)
  80df29:	8b 15 48 f5 b3 00    	mov    0xb3f548,%edx
  80df2f:	8b 4a 60             	mov    0x60(%edx),%ecx
  80df32:	b8 fc ff ff ff       	mov    $0xfffffffc,%eax
  80df37:	83 f9 03             	cmp    $0x3,%ecx
  80df3a:	7f 12                	jg     80df4e <thread_onhalt+0x28>
	return -E_NO_MEM;

    cur_tc->tc_onhalt[cur_tc->tc_nonhalt++] = fun;
  80df3c:	8b 45 08             	mov    0x8(%ebp),%eax
  80df3f:	89 44 8a 50          	mov    %eax,0x50(%edx,%ecx,4)
  80df43:	83 c1 01             	add    $0x1,%ecx
  80df46:	89 4a 60             	mov    %ecx,0x60(%edx)
  80df49:	b8 00 00 00 00       	mov    $0x0,%eax
    return 0;
}
  80df4e:	5d                   	pop    %ebp
  80df4f:	c3                   	ret    

0080df50 <thread_yield>:
    // when yield has no thread to run, it will return here!
    exit();
}

void
thread_yield(void) {
  80df50:	55                   	push   %ebp
  80df51:	89 e5                	mov    %esp,%ebp
  80df53:	53                   	push   %ebx
  80df54:	83 ec 14             	sub    $0x14,%esp
}

static inline struct thread_context *
threadq_pop(struct thread_queue *tq)
{
    if (!tq->tq_first)
  80df57:	8b 1d 4c f5 b3 00    	mov    0xb3f54c,%ebx
  80df5d:	85 db                	test   %ebx,%ebx
  80df5f:	74 69                	je     80dfca <thread_yield+0x7a>
	return 0;

    struct thread_context *tc = tq->tq_first;
    tq->tq_first = tc->tc_queue_link;
  80df61:	8b 43 64             	mov    0x64(%ebx),%eax
  80df64:	a3 4c f5 b3 00       	mov    %eax,0xb3f54c
    tc->tc_queue_link = 0;
  80df69:	c7 43 64 00 00 00 00 	movl   $0x0,0x64(%ebx)
    struct thread_context *next_tc = threadq_pop(&thread_queue);

    if (!next_tc)
	return;

    if (cur_tc) {
  80df70:	a1 48 f5 b3 00       	mov    0xb3f548,%eax
  80df75:	85 c0                	test   %eax,%eax
  80df77:	74 3e                	je     80dfb7 <thread_yield+0x67>
	if (jos_setjmp(&cur_tc->tc_jb) != 0)
  80df79:	83 c0 30             	add    $0x30,%eax
  80df7c:	89 04 24             	mov    %eax,(%esp)
  80df7f:	e8 cc 02 00 00       	call   80e250 <jos_setjmp>
  80df84:	85 c0                	test   %eax,%eax
  80df86:	75 42                	jne    80dfca <thread_yield+0x7a>
	    return;
	threadq_push(&thread_queue, cur_tc);
  80df88:	a1 48 f5 b3 00       	mov    0xb3f548,%eax
}

static inline void
threadq_push(struct thread_queue *tq, struct thread_context *tc)
{
    tc->tc_queue_link = 0;
  80df8d:	c7 40 64 00 00 00 00 	movl   $0x0,0x64(%eax)
    if (!tq->tq_first) {
  80df94:	83 3d 4c f5 b3 00 00 	cmpl   $0x0,0xb3f54c
  80df9b:	75 0c                	jne    80dfa9 <thread_yield+0x59>
	tq->tq_first = tc;
  80df9d:	a3 4c f5 b3 00       	mov    %eax,0xb3f54c
	tq->tq_last = tc;
  80dfa2:	a3 50 f5 b3 00       	mov    %eax,0xb3f550
  80dfa7:	eb 0e                	jmp    80dfb7 <thread_yield+0x67>
    } else {
	tq->tq_last->tc_queue_link = tc;
  80dfa9:	8b 15 50 f5 b3 00    	mov    0xb3f550,%edx
  80dfaf:	89 42 64             	mov    %eax,0x64(%edx)
	tq->tq_last = tc;
  80dfb2:	a3 50 f5 b3 00       	mov    %eax,0xb3f550
    }

    cur_tc = next_tc;
  80dfb7:	89 1d 48 f5 b3 00    	mov    %ebx,0xb3f548
    jos_longjmp(&cur_tc->tc_jb, 1);
  80dfbd:	8d 43 30             	lea    0x30(%ebx),%eax
  80dfc0:	ba 01 00 00 00       	mov    $0x1,%edx
  80dfc5:	e8 b6 02 00 00       	call   80e280 <jos_longjmp>
}
  80dfca:	83 c4 14             	add    $0x14,%esp
  80dfcd:	5b                   	pop    %ebx
  80dfce:	5d                   	pop    %ebp
  80dfcf:	c3                   	ret    

0080dfd0 <thread_halt>:
    free(tc->tc_stack_bottom);
    free(tc);
}

void
thread_halt() {
  80dfd0:	55                   	push   %ebp
  80dfd1:	89 e5                	mov    %esp,%ebp
  80dfd3:	56                   	push   %esi
  80dfd4:	53                   	push   %ebx
  80dfd5:	83 ec 10             	sub    $0x10,%esp
}

static inline struct thread_context *
threadq_pop(struct thread_queue *tq)
{
    if (!tq->tq_first)
  80dfd8:	8b 1d 54 f5 b3 00    	mov    0xb3f554,%ebx
  80dfde:	85 db                	test   %ebx,%ebx
  80dfe0:	0f 84 88 00 00 00    	je     80e06e <thread_halt+0x9e>
	return 0;

    struct thread_context *tc = tq->tq_first;
    tq->tq_first = tc->tc_queue_link;
  80dfe6:	8b 43 64             	mov    0x64(%ebx),%eax
  80dfe9:	a3 54 f5 b3 00       	mov    %eax,0xb3f554
    tc->tc_queue_link = 0;
  80dfee:	c7 43 64 00 00 00 00 	movl   $0x0,0x64(%ebx)
static void
thread_clean(struct thread_context *tc) {
    if (!tc) return;

    int i;
    for (i = 0; i < tc->tc_nonhalt; i++)
  80dff5:	83 7b 60 00          	cmpl   $0x0,0x60(%ebx)
  80dff9:	7e 16                	jle    80e011 <thread_halt+0x41>
  80dffb:	be 00 00 00 00       	mov    $0x0,%esi
	tc->tc_onhalt[i](tc->tc_tid);
  80e000:	8b 03                	mov    (%ebx),%eax
  80e002:	89 04 24             	mov    %eax,(%esp)
  80e005:	ff 54 b3 50          	call   *0x50(%ebx,%esi,4)
static void
thread_clean(struct thread_context *tc) {
    if (!tc) return;

    int i;
    for (i = 0; i < tc->tc_nonhalt; i++)
  80e009:	83 c6 01             	add    $0x1,%esi
  80e00c:	3b 73 60             	cmp    0x60(%ebx),%esi
  80e00f:	7c ef                	jl     80e000 <thread_halt+0x30>
	tc->tc_onhalt[i](tc->tc_tid);
    free(tc->tc_stack_bottom);
  80e011:	8b 43 04             	mov    0x4(%ebx),%eax
  80e014:	89 04 24             	mov    %eax,(%esp)
  80e017:	e8 64 4c ff ff       	call   802c80 <free>
    free(tc);
  80e01c:	89 1c 24             	mov    %ebx,(%esp)
  80e01f:	e8 5c 4c ff ff       	call   802c80 <free>
thread_halt() {
    // right now the kill_queue will never be more than one
    // clean up a thread if one is on the queue
    thread_clean(threadq_pop(&kill_queue));

    threadq_push(&kill_queue, cur_tc);
  80e024:	a1 48 f5 b3 00       	mov    0xb3f548,%eax
}

static inline void
threadq_push(struct thread_queue *tq, struct thread_context *tc)
{
    tc->tc_queue_link = 0;
  80e029:	c7 40 64 00 00 00 00 	movl   $0x0,0x64(%eax)
    if (!tq->tq_first) {
  80e030:	83 3d 54 f5 b3 00 00 	cmpl   $0x0,0xb3f554
  80e037:	75 0c                	jne    80e045 <thread_halt+0x75>
	tq->tq_first = tc;
  80e039:	a3 54 f5 b3 00       	mov    %eax,0xb3f554
	tq->tq_last = tc;
  80e03e:	a3 58 f5 b3 00       	mov    %eax,0xb3f558
  80e043:	eb 0e                	jmp    80e053 <thread_halt+0x83>
    } else {
	tq->tq_last->tc_queue_link = tc;
  80e045:	8b 15 58 f5 b3 00    	mov    0xb3f558,%edx
  80e04b:	89 42 64             	mov    %eax,0x64(%edx)
	tq->tq_last = tc;
  80e04e:	a3 58 f5 b3 00       	mov    %eax,0xb3f558
    cur_tc = NULL;
  80e053:	c7 05 48 f5 b3 00 00 	movl   $0x0,0xb3f548
  80e05a:	00 00 00 
    thread_yield();
  80e05d:	e8 ee fe ff ff       	call   80df50 <thread_yield>
    // WHAT IF THERE ARE NO MORE THREADS? HOW DO WE STOP?
    // when yield has no thread to run, it will return here!
    exit();
  80e062:	e8 19 29 ff ff       	call   800980 <exit>
}
  80e067:	83 c4 10             	add    $0x10,%esp
  80e06a:	5b                   	pop    %ebx
  80e06b:	5e                   	pop    %esi
  80e06c:	5d                   	pop    %ebp
  80e06d:	c3                   	ret    
thread_halt() {
    // right now the kill_queue will never be more than one
    // clean up a thread if one is on the queue
    thread_clean(threadq_pop(&kill_queue));

    threadq_push(&kill_queue, cur_tc);
  80e06e:	a1 48 f5 b3 00       	mov    0xb3f548,%eax
}

static inline void
threadq_push(struct thread_queue *tq, struct thread_context *tc)
{
    tc->tc_queue_link = 0;
  80e073:	c7 40 64 00 00 00 00 	movl   $0x0,0x64(%eax)
  80e07a:	eb bd                	jmp    80e039 <thread_halt+0x69>

0080e07c <thread_entry>:
    strncpy(tc->tc_name, name, name_size - 1);
    tc->tc_name[name_size - 1] = 0;
}

static void
thread_entry(void) {
  80e07c:	55                   	push   %ebp
  80e07d:	89 e5                	mov    %esp,%ebp
  80e07f:	83 ec 18             	sub    $0x18,%esp
    cur_tc->tc_entry(cur_tc->tc_arg);
  80e082:	a1 48 f5 b3 00       	mov    0xb3f548,%eax
  80e087:	8b 50 2c             	mov    0x2c(%eax),%edx
  80e08a:	89 14 24             	mov    %edx,(%esp)
  80e08d:	ff 50 28             	call   *0x28(%eax)
    thread_halt();
  80e090:	e8 3b ff ff ff       	call   80dfd0 <thread_halt>
}
  80e095:	c9                   	leave  
  80e096:	c3                   	ret    

0080e097 <thread_create>:

int
thread_create(thread_id_t *tid, const char *name, 
		void (*entry)(uint32_t), uint32_t arg) {
  80e097:	55                   	push   %ebp
  80e098:	89 e5                	mov    %esp,%ebp
  80e09a:	57                   	push   %edi
  80e09b:	56                   	push   %esi
  80e09c:	53                   	push   %ebx
  80e09d:	83 ec 1c             	sub    $0x1c,%esp
  80e0a0:	8b 7d 08             	mov    0x8(%ebp),%edi
    struct thread_context *tc = malloc(sizeof(struct thread_context));
  80e0a3:	c7 04 24 68 00 00 00 	movl   $0x68,(%esp)
  80e0aa:	e8 a4 4c ff ff       	call   802d53 <malloc>
  80e0af:	89 c3                	mov    %eax,%ebx
    if (!tc)
  80e0b1:	b8 fc ff ff ff       	mov    $0xfffffffc,%eax
  80e0b6:	85 db                	test   %ebx,%ebx
  80e0b8:	0f 84 19 01 00 00    	je     80e1d7 <thread_create+0x140>
	return -E_NO_MEM;

    memset(tc, 0, sizeof(struct thread_context));
  80e0be:	c7 44 24 08 68 00 00 	movl   $0x68,0x8(%esp)
  80e0c5:	00 
  80e0c6:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80e0cd:	00 
  80e0ce:	89 1c 24             	mov    %ebx,(%esp)
  80e0d1:	e8 b0 31 ff ff       	call   801286 <memset>
}

static void
thread_set_name(struct thread_context *tc, const char *name)
{
    strncpy(tc->tc_name, name, name_size - 1);
  80e0d6:	c7 44 24 08 1f 00 00 	movl   $0x1f,0x8(%esp)
  80e0dd:	00 
  80e0de:	8b 45 0c             	mov    0xc(%ebp),%eax
  80e0e1:	89 44 24 04          	mov    %eax,0x4(%esp)
  80e0e5:	8d 43 08             	lea    0x8(%ebx),%eax
  80e0e8:	89 04 24             	mov    %eax,(%esp)
  80e0eb:	e8 5a 30 ff ff       	call   80114a <strncpy>
    tc->tc_name[name_size - 1] = 0;
  80e0f0:	c6 43 27 00          	movb   $0x0,0x27(%ebx)
    return 0;
}

static thread_id_t
alloc_tid(void) {
    int tid = max_tid++;
  80e0f4:	a1 44 f5 b3 00       	mov    0xb3f544,%eax
  80e0f9:	8d 50 01             	lea    0x1(%eax),%edx
  80e0fc:	89 15 44 f5 b3 00    	mov    %edx,0xb3f544
    if (max_tid == (uint32_t)~0)
  80e102:	83 fa ff             	cmp    $0xffffffff,%edx
  80e105:	75 1c                	jne    80e123 <thread_create+0x8c>
	panic("alloc_tid: no more thread ids");
  80e107:	c7 44 24 08 0e 44 81 	movl   $0x81440e,0x8(%esp)
  80e10e:	00 
  80e10f:	c7 44 24 04 54 00 00 	movl   $0x54,0x4(%esp)
  80e116:	00 
  80e117:	c7 04 24 2c 44 81 00 	movl   $0x81442c,(%esp)
  80e11e:	e8 79 28 ff ff       	call   80099c <_panic>
	return -E_NO_MEM;

    memset(tc, 0, sizeof(struct thread_context));
    
    thread_set_name(tc, name);
    tc->tc_tid = alloc_tid();
  80e123:	89 03                	mov    %eax,(%ebx)

    tc->tc_stack_bottom = malloc(stack_size);
  80e125:	c7 04 24 00 10 00 00 	movl   $0x1000,(%esp)
  80e12c:	e8 22 4c ff ff       	call   802d53 <malloc>
  80e131:	89 43 04             	mov    %eax,0x4(%ebx)
    if (!tc->tc_stack_bottom) {
  80e134:	85 c0                	test   %eax,%eax
  80e136:	75 12                	jne    80e14a <thread_create+0xb3>
	free(tc);
  80e138:	89 1c 24             	mov    %ebx,(%esp)
  80e13b:	e8 40 4b ff ff       	call   802c80 <free>
  80e140:	b8 fc ff ff ff       	mov    $0xfffffffc,%eax
	return -E_NO_MEM;
  80e145:	e9 8d 00 00 00       	jmp    80e1d7 <thread_create+0x140>
    }

    void *stacktop = tc->tc_stack_bottom + stack_size;
    // Terminate stack unwinding
    stacktop = stacktop - 4;
  80e14a:	8d b0 fc 0f 00 00    	lea    0xffc(%eax),%esi
    memset(stacktop, 0, 4);
  80e150:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  80e157:	00 
  80e158:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80e15f:	00 
  80e160:	89 34 24             	mov    %esi,(%esp)
  80e163:	e8 1e 31 ff ff       	call   801286 <memset>
    
    memset(&tc->tc_jb, 0, sizeof(tc->tc_jb));
  80e168:	c7 44 24 08 18 00 00 	movl   $0x18,0x8(%esp)
  80e16f:	00 
  80e170:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80e177:	00 
  80e178:	8d 43 30             	lea    0x30(%ebx),%eax
  80e17b:	89 04 24             	mov    %eax,(%esp)
  80e17e:	e8 03 31 ff ff       	call   801286 <memset>
    tc->tc_jb.jb_esp = (uint32_t)stacktop;
  80e183:	89 73 34             	mov    %esi,0x34(%ebx)
    tc->tc_jb.jb_eip = (uint32_t)&thread_entry;
  80e186:	c7 43 30 7c e0 80 00 	movl   $0x80e07c,0x30(%ebx)
    tc->tc_entry = entry;
  80e18d:	8b 45 10             	mov    0x10(%ebp),%eax
  80e190:	89 43 28             	mov    %eax,0x28(%ebx)
    tc->tc_arg = arg;
  80e193:	8b 45 14             	mov    0x14(%ebp),%eax
  80e196:	89 43 2c             	mov    %eax,0x2c(%ebx)
  80e199:	c7 43 64 00 00 00 00 	movl   $0x0,0x64(%ebx)
    if (!tq->tq_first) {
  80e1a0:	83 3d 4c f5 b3 00 00 	cmpl   $0x0,0xb3f54c
  80e1a7:	75 0e                	jne    80e1b7 <thread_create+0x120>
	tq->tq_first = tc;
  80e1a9:	89 1d 4c f5 b3 00    	mov    %ebx,0xb3f54c
	tq->tq_last = tc;
  80e1af:	89 1d 50 f5 b3 00    	mov    %ebx,0xb3f550
  80e1b5:	eb 0e                	jmp    80e1c5 <thread_create+0x12e>
    } else {
	tq->tq_last->tc_queue_link = tc;
  80e1b7:	a1 50 f5 b3 00       	mov    0xb3f550,%eax
  80e1bc:	89 58 64             	mov    %ebx,0x64(%eax)
	tq->tq_last = tc;
  80e1bf:	89 1d 50 f5 b3 00    	mov    %ebx,0xb3f550

    threadq_push(&thread_queue, tc);

    if (tid)
  80e1c5:	b8 00 00 00 00       	mov    $0x0,%eax
  80e1ca:	85 ff                	test   %edi,%edi
  80e1cc:	74 09                	je     80e1d7 <thread_create+0x140>
	*tid = tc->tc_tid;
  80e1ce:	8b 03                	mov    (%ebx),%eax
  80e1d0:	89 07                	mov    %eax,(%edi)
  80e1d2:	b8 00 00 00 00       	mov    $0x0,%eax
    return 0;
}
  80e1d7:	83 c4 1c             	add    $0x1c,%esp
  80e1da:	5b                   	pop    %ebx
  80e1db:	5e                   	pop    %esi
  80e1dc:	5f                   	pop    %edi
  80e1dd:	5d                   	pop    %ebp
  80e1de:	c3                   	ret    

0080e1df <thread_wait>:
	tc = tc->tc_queue_link;
    }
}

void
thread_wait(volatile uint32_t *addr, uint32_t val, uint32_t msec) {
  80e1df:	55                   	push   %ebp
  80e1e0:	89 e5                	mov    %esp,%ebp
  80e1e2:	57                   	push   %edi
  80e1e3:	56                   	push   %esi
  80e1e4:	53                   	push   %ebx
  80e1e5:	83 ec 0c             	sub    $0xc,%esp
  80e1e8:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80e1eb:	8b 7d 10             	mov    0x10(%ebp),%edi
    uint32_t s = sys_time_msec();
  80e1ee:	e8 cc 33 ff ff       	call   8015bf <sys_time_msec>
  80e1f3:	89 c6                	mov    %eax,%esi
    uint32_t p = s;

    cur_tc->tc_wait_addr = addr;
  80e1f5:	a1 48 f5 b3 00       	mov    0xb3f548,%eax
  80e1fa:	89 58 48             	mov    %ebx,0x48(%eax)
    cur_tc->tc_wakeup = 0;
  80e1fd:	c6 40 4c 00          	movb   $0x0,0x4c(%eax)

    while (p < msec) {
  80e201:	39 fe                	cmp    %edi,%esi
  80e203:	72 06                	jb     80e20b <thread_wait+0x2c>
  80e205:	eb 2d                	jmp    80e234 <thread_wait+0x55>
	if (p < s)
  80e207:	39 c6                	cmp    %eax,%esi
  80e209:	77 29                	ja     80e234 <thread_wait+0x55>
	    break;
	if (addr && *addr != val)
  80e20b:	85 db                	test   %ebx,%ebx
  80e20d:	8d 76 00             	lea    0x0(%esi),%esi
  80e210:	74 07                	je     80e219 <thread_wait+0x3a>
  80e212:	8b 03                	mov    (%ebx),%eax
  80e214:	3b 45 0c             	cmp    0xc(%ebp),%eax
  80e217:	75 1b                	jne    80e234 <thread_wait+0x55>
	    break;
	if (cur_tc->tc_wakeup)
  80e219:	a1 48 f5 b3 00       	mov    0xb3f548,%eax
  80e21e:	0f b6 40 4c          	movzbl 0x4c(%eax),%eax
  80e222:	84 c0                	test   %al,%al
  80e224:	75 0e                	jne    80e234 <thread_wait+0x55>
	    break;

	thread_yield();
  80e226:	e8 25 fd ff ff       	call   80df50 <thread_yield>
	p = sys_time_msec();
  80e22b:	e8 8f 33 ff ff       	call   8015bf <sys_time_msec>
    uint32_t p = s;

    cur_tc->tc_wait_addr = addr;
    cur_tc->tc_wakeup = 0;

    while (p < msec) {
  80e230:	39 c7                	cmp    %eax,%edi
  80e232:	77 d3                	ja     80e207 <thread_wait+0x28>

	thread_yield();
	p = sys_time_msec();
    }

    cur_tc->tc_wait_addr = 0;
  80e234:	a1 48 f5 b3 00       	mov    0xb3f548,%eax
  80e239:	c7 40 48 00 00 00 00 	movl   $0x0,0x48(%eax)
    cur_tc->tc_wakeup = 0;
  80e240:	c6 40 4c 00          	movb   $0x0,0x4c(%eax)
}
  80e244:	83 c4 0c             	add    $0xc,%esp
  80e247:	5b                   	pop    %ebx
  80e248:	5e                   	pop    %esi
  80e249:	5f                   	pop    %edi
  80e24a:	5d                   	pop    %ebp
  80e24b:	c3                   	ret    
  80e24c:	00 00                	add    %al,(%eax)
	...

0080e250 <jos_setjmp>:
#define ENTRY(x) \
        .text; _ALIGN_TEXT; .globl x; .type x,@function; x:


ENTRY(jos_setjmp)
	movl	4(%esp), %ecx	// jos_jmp_buf
  80e250:	8b 4c 24 04          	mov    0x4(%esp),%ecx

	movl	0(%esp), %edx	// %eip as pushed by call
  80e254:	8b 14 24             	mov    (%esp),%edx
	movl	%edx,  0(%ecx)
  80e257:	89 11                	mov    %edx,(%ecx)

	leal	4(%esp), %edx	// where %esp will point when we return
  80e259:	8d 54 24 04          	lea    0x4(%esp),%edx
	movl	%edx,  4(%ecx)
  80e25d:	89 51 04             	mov    %edx,0x4(%ecx)

	movl	%ebp,  8(%ecx)
  80e260:	89 69 08             	mov    %ebp,0x8(%ecx)
	movl	%ebx, 12(%ecx)
  80e263:	89 59 0c             	mov    %ebx,0xc(%ecx)
	movl	%esi, 16(%ecx)
  80e266:	89 71 10             	mov    %esi,0x10(%ecx)
	movl	%edi, 20(%ecx)
  80e269:	89 79 14             	mov    %edi,0x14(%ecx)

	movl	$0, %eax
  80e26c:	b8 00 00 00 00       	mov    $0x0,%eax
	ret
  80e271:	c3                   	ret    
  80e272:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  80e279:	8d bc 27 00 00 00 00 	lea    0x0(%edi,%eiz,1),%edi

0080e280 <jos_longjmp>:

ENTRY(jos_longjmp)
	// %eax is the jos_jmp_buf*
	// %edx is the return value

	movl	 0(%eax), %ecx	// %eip
  80e280:	8b 08                	mov    (%eax),%ecx
	movl	 4(%eax), %esp
  80e282:	8b 60 04             	mov    0x4(%eax),%esp
	movl	 8(%eax), %ebp
  80e285:	8b 68 08             	mov    0x8(%eax),%ebp
	movl	12(%eax), %ebx
  80e288:	8b 58 0c             	mov    0xc(%eax),%ebx
	movl	16(%eax), %esi
  80e28b:	8b 70 10             	mov    0x10(%eax),%esi
	movl	20(%eax), %edi
  80e28e:	8b 78 14             	mov    0x14(%eax),%edi

	movl	%edx, %eax
  80e291:	89 d0                	mov    %edx,%eax
	jmp	*%ecx
  80e293:	ff e1                	jmp    *%ecx
  80e295:	00 00                	add    %al,(%eax)
	...

0080e298 <e2s>:
	int err = errno;
	cprintf("%s: %s\n", s, e2s(err));
}

const char *
e2s(int err) {
  80e298:	55                   	push   %ebp
  80e299:	89 e5                	mov    %esp,%ebp
  80e29b:	8b 45 08             	mov    0x8(%ebp),%eax
  80e29e:	8b 04 85 a0 90 81 00 	mov    0x8190a0(,%eax,4),%eax
	return sys_errlist[err];
}
  80e2a5:	5d                   	pop    %ebp
  80e2a6:	c3                   	ret    

0080e2a7 <perror>:
  [ENSRQUERYDOMAINTOOLONG] = "ENSRQUERYDOMAINTOOLONG",  /* Domain name is too long */
  [ENSRCNAMELOOP] = "ENSRCNAMELOOP" /* Domain name is too long */
};

void
perror(const char *s) {
  80e2a7:	55                   	push   %ebp
  80e2a8:	89 e5                	mov    %esp,%ebp
  80e2aa:	83 ec 18             	sub    $0x18,%esp
	int err = errno;
	cprintf("%s: %s\n", s, e2s(err));
  80e2ad:	a1 a0 f5 b3 00       	mov    0xb3f5a0,%eax
  80e2b2:	89 04 24             	mov    %eax,(%esp)
  80e2b5:	e8 de ff ff ff       	call   80e298 <e2s>
  80e2ba:	89 44 24 08          	mov    %eax,0x8(%esp)
  80e2be:	8b 45 08             	mov    0x8(%ebp),%eax
  80e2c1:	89 44 24 04          	mov    %eax,0x4(%esp)
  80e2c5:	c7 04 24 47 44 81 00 	movl   $0x814447,(%esp)
  80e2cc:	e8 90 27 ff ff       	call   800a61 <cprintf>
}
  80e2d1:	c9                   	leave  
  80e2d2:	c3                   	ret    
	...

0080e2e0 <jif_init>:
 *
 */

err_t
jif_init(struct netif *netif)
{
  80e2e0:	55                   	push   %ebp
  80e2e1:	89 e5                	mov    %esp,%ebp
  80e2e3:	83 ec 38             	sub    $0x38,%esp
  80e2e6:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  80e2e9:	89 75 f8             	mov    %esi,-0x8(%ebp)
  80e2ec:	89 7d fc             	mov    %edi,-0x4(%ebp)
  80e2ef:	8b 5d 08             	mov    0x8(%ebp),%ebx
    struct jif *jif;
    envid_t *output_envid; 

    jif = mem_malloc(sizeof(struct jif));
  80e2f2:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
  80e2f9:	e8 62 8e ff ff       	call   807160 <mem_malloc>
  80e2fe:	89 c6                	mov    %eax,%esi

    if (jif == NULL) {
  80e300:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  80e305:	85 f6                	test   %esi,%esi
  80e307:	0f 84 8a 00 00 00    	je     80e397 <jif_init+0xb7>
	LWIP_DEBUGF(NETIF_DEBUG, ("jif_init: out of memory\n"));
	return ERR_MEM;
    }

    output_envid = (envid_t *)netif->state;
  80e30d:	8b 7b 1c             	mov    0x1c(%ebx),%edi

    netif->state = jif;
  80e310:	89 73 1c             	mov    %esi,0x1c(%ebx)
    netif->output = jif_output;
  80e313:	c7 43 14 b9 e4 80 00 	movl   $0x80e4b9,0x14(%ebx)
    netif->linkoutput = low_level_output;
  80e31a:	c7 43 18 a4 e3 80 00 	movl   $0x80e3a4,0x18(%ebx)
    memcpy(&netif->name[0], "en", 2);
  80e321:	c7 44 24 08 02 00 00 	movl   $0x2,0x8(%esp)
  80e328:	00 
  80e329:	c7 44 24 04 83 2d 81 	movl   $0x812d83,0x4(%esp)
  80e330:	00 
  80e331:	8d 43 2f             	lea    0x2f(%ebx),%eax
  80e334:	89 04 24             	mov    %eax,(%esp)
  80e337:	e8 25 30 ff ff       	call   801361 <memcpy>

    jif->ethaddr = (struct eth_addr *)&(netif->hwaddr[0]);
  80e33c:	8d 43 25             	lea    0x25(%ebx),%eax
  80e33f:	89 06                	mov    %eax,(%esi)
    jif->envid = *output_envid; 
  80e341:	8b 07                	mov    (%edi),%eax
  80e343:	89 46 04             	mov    %eax,0x4(%esi)
static void
low_level_init(struct netif *netif)
{
    int r;

    netif->hwaddr_len = 6;
  80e346:	c6 43 24 06          	movb   $0x6,0x24(%ebx)
    netif->mtu = 1500;
  80e34a:	66 c7 43 2c dc 05    	movw   $0x5dc,0x2c(%ebx)
    netif->flags = NETIF_FLAG_BROADCAST;
  80e350:	c6 43 2e 02          	movb   $0x2,0x2e(%ebx)

    // MAC address is hardcoded to eliminate a system call
    netif->hwaddr[0] = 0x52;
  80e354:	c6 43 25 52          	movb   $0x52,0x25(%ebx)
    netif->hwaddr[1] = 0x54;
  80e358:	c6 43 26 54          	movb   $0x54,0x26(%ebx)
    netif->hwaddr[2] = 0x00;
  80e35c:	c6 43 27 00          	movb   $0x0,0x27(%ebx)
    netif->hwaddr[3] = 0x12;
  80e360:	c6 43 28 12          	movb   $0x12,0x28(%ebx)
    netif->hwaddr[4] = 0x34;
  80e364:	c6 43 29 34          	movb   $0x34,0x29(%ebx)
    netif->hwaddr[5] = 0x56;
  80e368:	c6 43 2a 56          	movb   $0x56,0x2a(%ebx)
    etharp_init();

    // qemu user-net is dumb; if the host OS does not send and ARP request
    // first, the qemu will send packets destined for the host using the mac
    // addr 00:00:00:00:00; do a arp request for the user-net NAT at 10.0.2.2
    uint32_t ipaddr = inet_addr("10.0.2.2");
  80e36c:	c7 04 24 29 25 81 00 	movl   $0x812529,(%esp)
  80e373:	e8 98 cb ff ff       	call   80af10 <inet_addr>
  80e378:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    etharp_query(netif, (struct ip_addr *) &ipaddr, 0);
  80e37b:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80e382:	00 
  80e383:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80e386:	89 44 24 04          	mov    %eax,0x4(%esp)
  80e38a:	89 1c 24             	mov    %ebx,(%esp)
  80e38d:	e8 25 e9 ff ff       	call   80ccb7 <etharp_query>
  80e392:	b8 00 00 00 00       	mov    $0x0,%eax

    return ERR_OK;
}
  80e397:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  80e39a:	8b 75 f8             	mov    -0x8(%ebp),%esi
  80e39d:	8b 7d fc             	mov    -0x4(%ebp),%edi
  80e3a0:	89 ec                	mov    %ebp,%esp
  80e3a2:	5d                   	pop    %ebp
  80e3a3:	c3                   	ret    

0080e3a4 <low_level_output>:
 * might be chained.
 *
 */
static err_t
low_level_output(struct netif *netif, struct pbuf *p)
{
  80e3a4:	55                   	push   %ebp
  80e3a5:	89 e5                	mov    %esp,%ebp
  80e3a7:	57                   	push   %edi
  80e3a8:	56                   	push   %esi
  80e3a9:	53                   	push   %ebx
  80e3aa:	83 ec 2c             	sub    $0x2c,%esp
  80e3ad:	8b 5d 0c             	mov    0xc(%ebp),%ebx
    int r = sys_page_alloc(0, (void *)PKTMAP, PTE_U|PTE_W|PTE_P);
  80e3b0:	c7 44 24 08 07 00 00 	movl   $0x7,0x8(%esp)
  80e3b7:	00 
  80e3b8:	c7 44 24 04 00 00 00 	movl   $0x10000000,0x4(%esp)
  80e3bf:	10 
  80e3c0:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80e3c7:	e8 ba 34 ff ff       	call   801886 <sys_page_alloc>
    if (r < 0)
  80e3cc:	85 c0                	test   %eax,%eax
  80e3ce:	79 1c                	jns    80e3ec <low_level_output+0x48>
	panic("jif: could not allocate page of memory");
  80e3d0:	c7 44 24 08 40 49 81 	movl   $0x814940,0x8(%esp)
  80e3d7:	00 
  80e3d8:	c7 44 24 04 55 00 00 	movl   $0x55,0x4(%esp)
  80e3df:	00 
  80e3e0:	c7 04 24 29 49 81 00 	movl   $0x814929,(%esp)
  80e3e7:	e8 b0 25 ff ff       	call   80099c <_panic>
    struct jif_pkt *pkt = (struct jif_pkt *)PKTMAP;

    struct jif *jif;
    jif = netif->state;
  80e3ec:	8b 45 08             	mov    0x8(%ebp),%eax
  80e3ef:	8b 78 1c             	mov    0x1c(%eax),%edi

    char *txbuf = pkt->jp_data;
    int txsize = 0;
    struct pbuf *q;
    for (q = p; q != NULL; q = q->next) {
  80e3f2:	be 00 00 00 00       	mov    $0x0,%esi
  80e3f7:	85 db                	test   %ebx,%ebx
  80e3f9:	74 74                	je     80e46f <low_level_output+0xcb>
	/* Send the data from the pbuf to the interface, one pbuf at a
	   time. The size of the data in each pbuf is kept in the ->len
	   variable. */

	if (txsize + q->len > 2000)
  80e3fb:	0f b7 43 0a          	movzwl 0xa(%ebx),%eax
  80e3ff:	0f b7 d0             	movzwl %ax,%edx
  80e402:	81 fa d0 07 00 00    	cmp    $0x7d0,%edx
  80e408:	7e 38                	jle    80e442 <low_level_output+0x9e>
  80e40a:	eb 12                	jmp    80e41e <low_level_output+0x7a>
  80e40c:	0f b7 43 0a          	movzwl 0xa(%ebx),%eax
  80e410:	0f b7 d0             	movzwl %ax,%edx
  80e413:	8d 0c 16             	lea    (%esi,%edx,1),%ecx
  80e416:	81 f9 d0 07 00 00    	cmp    $0x7d0,%ecx
  80e41c:	7e 29                	jle    80e447 <low_level_output+0xa3>
	    panic("oversized packet, fragment %d txsize %d\n", q->len, txsize);
  80e41e:	89 74 24 10          	mov    %esi,0x10(%esp)
  80e422:	89 54 24 0c          	mov    %edx,0xc(%esp)
  80e426:	c7 44 24 08 68 49 81 	movl   $0x814968,0x8(%esp)
  80e42d:	00 
  80e42e:	c7 44 24 04 64 00 00 	movl   $0x64,0x4(%esp)
  80e435:	00 
  80e436:	c7 04 24 29 49 81 00 	movl   $0x814929,(%esp)
  80e43d:	e8 5a 25 ff ff       	call   80099c <_panic>
  80e442:	be 00 00 00 00       	mov    $0x0,%esi
	memcpy(&txbuf[txsize], q->payload, q->len);
  80e447:	8d 96 04 00 00 10    	lea    0x10000004(%esi),%edx
  80e44d:	0f b7 c0             	movzwl %ax,%eax
  80e450:	89 44 24 08          	mov    %eax,0x8(%esp)
  80e454:	8b 43 04             	mov    0x4(%ebx),%eax
  80e457:	89 44 24 04          	mov    %eax,0x4(%esp)
  80e45b:	89 14 24             	mov    %edx,(%esp)
  80e45e:	e8 fe 2e ff ff       	call   801361 <memcpy>
	txsize += q->len;
  80e463:	0f b7 43 0a          	movzwl 0xa(%ebx),%eax
  80e467:	01 c6                	add    %eax,%esi
    jif = netif->state;

    char *txbuf = pkt->jp_data;
    int txsize = 0;
    struct pbuf *q;
    for (q = p; q != NULL; q = q->next) {
  80e469:	8b 1b                	mov    (%ebx),%ebx
  80e46b:	85 db                	test   %ebx,%ebx
  80e46d:	75 9d                	jne    80e40c <low_level_output+0x68>
	    panic("oversized packet, fragment %d txsize %d\n", q->len, txsize);
	memcpy(&txbuf[txsize], q->payload, q->len);
	txsize += q->len;
    }

    pkt->jp_len = txsize;
  80e46f:	89 35 00 00 00 10    	mov    %esi,0x10000000

    ipc_send(jif->envid, NSREQ_OUTPUT, (void *)pkt, PTE_P|PTE_W|PTE_U);
  80e475:	c7 44 24 0c 07 00 00 	movl   $0x7,0xc(%esp)
  80e47c:	00 
  80e47d:	c7 44 24 08 00 00 00 	movl   $0x10000000,0x8(%esp)
  80e484:	10 
  80e485:	c7 44 24 04 0b 00 00 	movl   $0xb,0x4(%esp)
  80e48c:	00 
  80e48d:	8b 47 04             	mov    0x4(%edi),%eax
  80e490:	89 04 24             	mov    %eax,(%esp)
  80e493:	e8 18 39 ff ff       	call   801db0 <ipc_send>
    sys_page_unmap(0, (void *)pkt);
  80e498:	c7 44 24 04 00 00 00 	movl   $0x10000000,0x4(%esp)
  80e49f:	10 
  80e4a0:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80e4a7:	e8 1e 33 ff ff       	call   8017ca <sys_page_unmap>

    return ERR_OK;
}
  80e4ac:	b8 00 00 00 00       	mov    $0x0,%eax
  80e4b1:	83 c4 2c             	add    $0x2c,%esp
  80e4b4:	5b                   	pop    %ebx
  80e4b5:	5e                   	pop    %esi
  80e4b6:	5f                   	pop    %edi
  80e4b7:	5d                   	pop    %ebp
  80e4b8:	c3                   	ret    

0080e4b9 <jif_output>:
 */

static err_t
jif_output(struct netif *netif, struct pbuf *p,
      struct ip_addr *ipaddr)
{
  80e4b9:	55                   	push   %ebp
  80e4ba:	89 e5                	mov    %esp,%ebp
  80e4bc:	83 ec 18             	sub    $0x18,%esp
    /* resolve hardware address, then send (or queue) packet */
    return etharp_output(netif, p, ipaddr);
  80e4bf:	8b 45 10             	mov    0x10(%ebp),%eax
  80e4c2:	89 44 24 08          	mov    %eax,0x8(%esp)
  80e4c6:	8b 45 0c             	mov    0xc(%ebp),%eax
  80e4c9:	89 44 24 04          	mov    %eax,0x4(%esp)
  80e4cd:	8b 45 08             	mov    0x8(%ebp),%eax
  80e4d0:	89 04 24             	mov    %eax,(%esp)
  80e4d3:	e8 f4 e9 ff ff       	call   80cecc <etharp_output>
}
  80e4d8:	c9                   	leave  
  80e4d9:	c3                   	ret    

0080e4da <jif_input>:
 *
 */

void
jif_input(struct netif *netif, void *va)
{
  80e4da:	55                   	push   %ebp
  80e4db:	89 e5                	mov    %esp,%ebp
  80e4dd:	57                   	push   %edi
  80e4de:	56                   	push   %esi
  80e4df:	53                   	push   %ebx
  80e4e0:	83 ec 2c             	sub    $0x2c,%esp
    struct jif *jif;
    struct eth_hdr *ethhdr;
    struct pbuf *p;

    jif = netif->state;
  80e4e3:	8b 45 08             	mov    0x8(%ebp),%eax
  80e4e6:	8b 40 1c             	mov    0x1c(%eax),%eax
  80e4e9:	89 45 d8             	mov    %eax,-0x28(%ebp)
 *
 */
static struct pbuf *
low_level_input(void *va)
{
    struct jif_pkt *pkt = (struct jif_pkt *)va;
  80e4ec:	8b 5d 0c             	mov    0xc(%ebp),%ebx
    s16_t len = pkt->jp_len;
  80e4ef:	0f b7 33             	movzwl (%ebx),%esi

    struct pbuf *p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
  80e4f2:	c7 44 24 08 03 00 00 	movl   $0x3,0x8(%esp)
  80e4f9:	00 
  80e4fa:	0f b7 c6             	movzwl %si,%eax
  80e4fd:	89 44 24 04          	mov    %eax,0x4(%esp)
  80e501:	c7 04 24 03 00 00 00 	movl   $0x3,(%esp)
  80e508:	e8 ac 9c ff ff       	call   8081b9 <pbuf_alloc>
  80e50d:	89 45 dc             	mov    %eax,-0x24(%ebp)
    if (p == 0)
  80e510:	85 c0                	test   %eax,%eax
  80e512:	0f 84 ca 00 00 00    	je     80e5e2 <jif_input+0x108>
	return 0;

    /* We iterate over the pbuf chain until we have read the entire
     * packet into the pbuf. */
    void *rxbuf = (void *) pkt->jp_data;
  80e518:	83 c3 04             	add    $0x4,%ebx
  80e51b:	89 5d e4             	mov    %ebx,-0x1c(%ebp)
  80e51e:	89 c3                	mov    %eax,%ebx
  80e520:	bf 00 00 00 00       	mov    $0x0,%edi
    struct pbuf *q;
    for (q = p; q != NULL; q = q->next) {
	/* Read enough bytes to fill this pbuf in the chain. The
	 * available data in the pbuf is given by the q->len
	 * variable. */
	int bytes = q->len;
  80e525:	0f bf f6             	movswl %si,%esi
  80e528:	89 75 e0             	mov    %esi,-0x20(%ebp)
  80e52b:	0f b7 43 0a          	movzwl 0xa(%ebx),%eax
  80e52f:	8b 75 e0             	mov    -0x20(%ebp),%esi
  80e532:	29 fe                	sub    %edi,%esi
  80e534:	39 c6                	cmp    %eax,%esi
  80e536:	0f 4f f0             	cmovg  %eax,%esi
	if (bytes > (len - copied))
	    bytes = len - copied;
	memcpy(q->payload, rxbuf + copied, bytes);
  80e539:	89 74 24 08          	mov    %esi,0x8(%esp)
  80e53d:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  80e540:	01 f8                	add    %edi,%eax
  80e542:	89 44 24 04          	mov    %eax,0x4(%esp)
  80e546:	8b 43 04             	mov    0x4(%ebx),%eax
  80e549:	89 04 24             	mov    %eax,(%esp)
  80e54c:	e8 10 2e ff ff       	call   801361 <memcpy>
	copied += bytes;
  80e551:	01 f7                	add    %esi,%edi
    /* We iterate over the pbuf chain until we have read the entire
     * packet into the pbuf. */
    void *rxbuf = (void *) pkt->jp_data;
    int copied = 0;
    struct pbuf *q;
    for (q = p; q != NULL; q = q->next) {
  80e553:	8b 1b                	mov    (%ebx),%ebx
  80e555:	85 db                	test   %ebx,%ebx
  80e557:	75 d2                	jne    80e52b <jif_input+0x51>
  80e559:	eb 61                	jmp    80e5bc <jif_input+0xe2>
    ethhdr = p->payload;

    switch (htons(ethhdr->type)) {
    case ETHTYPE_IP:
	/* update ARP table */
	etharp_ip_input(netif, p);
  80e55b:	8b 55 dc             	mov    -0x24(%ebp),%edx
  80e55e:	89 54 24 04          	mov    %edx,0x4(%esp)
  80e562:	8b 45 08             	mov    0x8(%ebp),%eax
  80e565:	89 04 24             	mov    %eax,(%esp)
  80e568:	e8 8c ec ff ff       	call   80d1f9 <etharp_ip_input>
	/* skip Ethernet header */
	pbuf_header(p, -(int)sizeof(struct eth_hdr));
  80e56d:	c7 44 24 04 f2 ff ff 	movl   $0xfffffff2,0x4(%esp)
  80e574:	ff 
  80e575:	8b 55 dc             	mov    -0x24(%ebp),%edx
  80e578:	89 14 24             	mov    %edx,(%esp)
  80e57b:	e8 13 96 ff ff       	call   807b93 <pbuf_header>
	/* pass to network layer */
	netif->input(p, netif);
  80e580:	8b 45 08             	mov    0x8(%ebp),%eax
  80e583:	89 44 24 04          	mov    %eax,0x4(%esp)
  80e587:	8b 55 dc             	mov    -0x24(%ebp),%edx
  80e58a:	89 14 24             	mov    %edx,(%esp)
  80e58d:	ff 50 10             	call   *0x10(%eax)
	break;
  80e590:	eb 50                	jmp    80e5e2 <jif_input+0x108>
      
    case ETHTYPE_ARP:
	/* pass p to ARP module  */
	etharp_arp_input(netif, jif->ethaddr, p);
  80e592:	8b 45 dc             	mov    -0x24(%ebp),%eax
  80e595:	89 44 24 08          	mov    %eax,0x8(%esp)
  80e599:	8b 55 d8             	mov    -0x28(%ebp),%edx
  80e59c:	8b 02                	mov    (%edx),%eax
  80e59e:	89 44 24 04          	mov    %eax,0x4(%esp)
  80e5a2:	8b 45 08             	mov    0x8(%ebp),%eax
  80e5a5:	89 04 24             	mov    %eax,(%esp)
  80e5a8:	e8 9a ec ff ff       	call   80d247 <etharp_arp_input>
	break;
  80e5ad:	eb 33                	jmp    80e5e2 <jif_input+0x108>

    default:
	pbuf_free(p);
  80e5af:	8b 55 dc             	mov    -0x24(%ebp),%edx
  80e5b2:	89 14 24             	mov    %edx,(%esp)
  80e5b5:	e8 43 99 ff ff       	call   807efd <pbuf_free>
  80e5ba:	eb 26                	jmp    80e5e2 <jif_input+0x108>
    /* no packet could be read, silently ignore this */
    if (p == NULL) return;
    /* points to packet payload, which starts with an Ethernet header */
    ethhdr = p->payload;

    switch (htons(ethhdr->type)) {
  80e5bc:	8b 55 dc             	mov    -0x24(%ebp),%edx
  80e5bf:	8b 42 04             	mov    0x4(%edx),%eax
  80e5c2:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  80e5c6:	89 04 24             	mov    %eax,(%esp)
  80e5c9:	e8 25 c7 ff ff       	call   80acf3 <htons>
  80e5ce:	66 3d 00 08          	cmp    $0x800,%ax
  80e5d2:	74 87                	je     80e55b <jif_input+0x81>
  80e5d4:	66 3d 06 08          	cmp    $0x806,%ax
  80e5d8:	75 d5                	jne    80e5af <jif_input+0xd5>
  80e5da:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  80e5e0:	eb b0                	jmp    80e592 <jif_input+0xb8>
	break;

    default:
	pbuf_free(p);
    }
}
  80e5e2:	83 c4 2c             	add    $0x2c,%esp
  80e5e5:	5b                   	pop    %ebx
  80e5e6:	5e                   	pop    %esi
  80e5e7:	5f                   	pop    %edi
  80e5e8:	5d                   	pop    %ebp
  80e5e9:	c3                   	ret    
  80e5ea:	00 00                	add    %al,(%eax)
  80e5ec:	00 00                	add    %al,(%eax)
	...

0080e5f0 <netconn_type>:
 * @param conn the netconn of which to get the type
 * @return the netconn_type of conn
 */
enum netconn_type
netconn_type(struct netconn *conn)
{
  80e5f0:	55                   	push   %ebp
  80e5f1:	89 e5                	mov    %esp,%ebp
  80e5f3:	83 ec 18             	sub    $0x18,%esp
  80e5f6:	8b 45 08             	mov    0x8(%ebp),%eax
  LWIP_ERROR("netconn_type: invalid conn", (conn != NULL), return NETCONN_INVALID;);
  80e5f9:	85 c0                	test   %eax,%eax
  80e5fb:	75 1c                	jne    80e619 <netconn_type+0x29>
  80e5fd:	c7 44 24 08 91 49 81 	movl   $0x814991,0x8(%esp)
  80e604:	00 
  80e605:	c7 44 24 04 84 00 00 	movl   $0x84,0x4(%esp)
  80e60c:	00 
  80e60d:	c7 04 24 ac 49 81 00 	movl   $0x8149ac,(%esp)
  80e614:	e8 83 23 ff ff       	call   80099c <_panic>
  80e619:	8b 00                	mov    (%eax),%eax
  return conn->type;
}
  80e61b:	c9                   	leave  
  80e61c:	c3                   	ret    

0080e61d <netconn_close>:
 * @param conn the TCP netconn to close
 * @return ERR_OK if the netconn was closed, any other err_t on error
 */
err_t
netconn_close(struct netconn *conn)
{
  80e61d:	55                   	push   %ebp
  80e61e:	89 e5                	mov    %esp,%ebp
  80e620:	53                   	push   %ebx
  80e621:	83 ec 34             	sub    $0x34,%esp
  80e624:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct api_msg msg;

  LWIP_ERROR("netconn_close: invalid conn",  (conn != NULL), return ERR_ARG;);
  80e627:	85 db                	test   %ebx,%ebx
  80e629:	75 1c                	jne    80e647 <netconn_close+0x2a>
  80e62b:	c7 44 24 08 c3 49 81 	movl   $0x8149c3,0x8(%esp)
  80e632:	00 
  80e633:	c7 44 24 04 ed 01 00 	movl   $0x1ed,0x4(%esp)
  80e63a:	00 
  80e63b:	c7 04 24 ac 49 81 00 	movl   $0x8149ac,(%esp)
  80e642:	e8 55 23 ff ff       	call   80099c <_panic>

  msg.function = do_close;
  80e647:	c7 45 e4 2f f0 80 00 	movl   $0x80f02f,-0x1c(%ebp)
  msg.msg.conn = conn;
  80e64e:	89 5d e8             	mov    %ebx,-0x18(%ebp)
  tcpip_apimsg(&msg);
  80e651:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80e654:	89 04 24             	mov    %eax,(%esp)
  80e657:	e8 ab 6b ff ff       	call   805207 <tcpip_apimsg>
  80e65c:	0f b6 43 0c          	movzbl 0xc(%ebx),%eax
  return conn->err;
}
  80e660:	83 c4 34             	add    $0x34,%esp
  80e663:	5b                   	pop    %ebx
  80e664:	5d                   	pop    %ebp
  80e665:	c3                   	ret    

0080e666 <netconn_write>:
 * - NETCONN_MORE (0x02) for TCP connection, PSH flag will be set on last segment sent
 * @return ERR_OK if data was sent, any other err_t on error
 */
err_t
netconn_write(struct netconn *conn, const void *dataptr, int size, u8_t apiflags)
{
  80e666:	55                   	push   %ebp
  80e667:	89 e5                	mov    %esp,%ebp
  80e669:	53                   	push   %ebx
  80e66a:	83 ec 34             	sub    $0x34,%esp
  80e66d:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80e670:	0f b6 45 14          	movzbl 0x14(%ebp),%eax
  struct api_msg msg;

  LWIP_ERROR("netconn_write: invalid conn",  (conn != NULL), return ERR_ARG;);
  80e674:	85 db                	test   %ebx,%ebx
  80e676:	75 1c                	jne    80e694 <netconn_write+0x2e>
  80e678:	c7 44 24 08 df 49 81 	movl   $0x8149df,0x8(%esp)
  80e67f:	00 
  80e680:	c7 44 24 04 d3 01 00 	movl   $0x1d3,0x4(%esp)
  80e687:	00 
  80e688:	c7 04 24 ac 49 81 00 	movl   $0x8149ac,(%esp)
  80e68f:	e8 08 23 ff ff       	call   80099c <_panic>
  LWIP_ERROR("netconn_write: invalid conn->type",  (conn->type == NETCONN_TCP), return ERR_VAL;);
  80e694:	83 3b 10             	cmpl   $0x10,(%ebx)
  80e697:	74 1c                	je     80e6b5 <netconn_write+0x4f>
  80e699:	c7 44 24 08 2c 4b 81 	movl   $0x814b2c,0x8(%esp)
  80e6a0:	00 
  80e6a1:	c7 44 24 04 d4 01 00 	movl   $0x1d4,0x4(%esp)
  80e6a8:	00 
  80e6a9:	c7 04 24 ac 49 81 00 	movl   $0x8149ac,(%esp)
  80e6b0:	e8 e7 22 ff ff       	call   80099c <_panic>

  msg.function = do_write;
  80e6b5:	c7 45 e4 ae f3 80 00 	movl   $0x80f3ae,-0x1c(%ebp)
  msg.msg.conn = conn;
  80e6bc:	89 5d e8             	mov    %ebx,-0x18(%ebp)
  msg.msg.msg.w.dataptr = dataptr;
  80e6bf:	8b 55 0c             	mov    0xc(%ebp),%edx
  80e6c2:	89 55 ec             	mov    %edx,-0x14(%ebp)
  msg.msg.msg.w.apiflags = apiflags;
  80e6c5:	88 45 f4             	mov    %al,-0xc(%ebp)
  msg.msg.msg.w.len = size;
  80e6c8:	8b 45 10             	mov    0x10(%ebp),%eax
  80e6cb:	89 45 f0             	mov    %eax,-0x10(%ebp)
  /* For locking the core: this _can_ be delayed on low memory/low send buffer,
     but if it is, this is done inside api_msg.c:do_write(), so we can use the
     non-blocking version here. */
  TCPIP_APIMSG(&msg);
  80e6ce:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80e6d1:	89 04 24             	mov    %eax,(%esp)
  80e6d4:	e8 2e 6b ff ff       	call   805207 <tcpip_apimsg>
  80e6d9:	0f b6 43 0c          	movzbl 0xc(%ebx),%eax
  return conn->err;
}
  80e6dd:	83 c4 34             	add    $0x34,%esp
  80e6e0:	5b                   	pop    %ebx
  80e6e1:	5d                   	pop    %ebp
  80e6e2:	c3                   	ret    

0080e6e3 <netconn_send>:
 * @param buf a netbuf containing the data to send
 * @return ERR_OK if data was sent, any other err_t on error
 */
err_t
netconn_send(struct netconn *conn, struct netbuf *buf)
{
  80e6e3:	55                   	push   %ebp
  80e6e4:	89 e5                	mov    %esp,%ebp
  80e6e6:	53                   	push   %ebx
  80e6e7:	83 ec 34             	sub    $0x34,%esp
  80e6ea:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct api_msg msg;

  LWIP_ERROR("netconn_send: invalid conn",  (conn != NULL), return ERR_ARG;);
  80e6ed:	85 db                	test   %ebx,%ebx
  80e6ef:	75 1c                	jne    80e70d <netconn_send+0x2a>
  80e6f1:	c7 44 24 08 fb 49 81 	movl   $0x8149fb,0x8(%esp)
  80e6f8:	00 
  80e6f9:	c7 44 24 04 b9 01 00 	movl   $0x1b9,0x4(%esp)
  80e700:	00 
  80e701:	c7 04 24 ac 49 81 00 	movl   $0x8149ac,(%esp)
  80e708:	e8 8f 22 ff ff       	call   80099c <_panic>

  LWIP_DEBUGF(API_LIB_DEBUG, ("netconn_send: sending %d bytes\n", buf->p->tot_len));
  msg.function = do_send;
  80e70d:	c7 45 e4 3c f4 80 00 	movl   $0x80f43c,-0x1c(%ebp)
  msg.msg.conn = conn;
  80e714:	89 5d e8             	mov    %ebx,-0x18(%ebp)
  msg.msg.msg.b = buf;
  80e717:	8b 45 0c             	mov    0xc(%ebp),%eax
  80e71a:	89 45 ec             	mov    %eax,-0x14(%ebp)
  TCPIP_APIMSG(&msg);
  80e71d:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80e720:	89 04 24             	mov    %eax,(%esp)
  80e723:	e8 df 6a ff ff       	call   805207 <tcpip_apimsg>
  80e728:	0f b6 43 0c          	movzbl 0xc(%ebx),%eax
  return conn->err;
}
  80e72c:	83 c4 34             	add    $0x34,%esp
  80e72f:	5b                   	pop    %ebx
  80e730:	5d                   	pop    %ebp
  80e731:	c3                   	ret    

0080e732 <netconn_sendto>:
 * @param port the remote port to which to send the data
 * @return ERR_OK if data was sent, any other err_t on error
 */
err_t
netconn_sendto(struct netconn *conn, struct netbuf *buf, struct ip_addr *addr, u16_t port)
{
  80e732:	55                   	push   %ebp
  80e733:	89 e5                	mov    %esp,%ebp
  80e735:	83 ec 18             	sub    $0x18,%esp
  80e738:	8b 55 0c             	mov    0xc(%ebp),%edx
  80e73b:	0f b7 4d 14          	movzwl 0x14(%ebp),%ecx
  if (buf != NULL) {
  80e73f:	b8 f7 ff ff ff       	mov    $0xfffffff7,%eax
  80e744:	85 d2                	test   %edx,%edx
  80e746:	74 19                	je     80e761 <netconn_sendto+0x2f>
    buf->addr = addr;
  80e748:	8b 45 10             	mov    0x10(%ebp),%eax
  80e74b:	89 42 08             	mov    %eax,0x8(%edx)
    buf->port = port;
  80e74e:	66 89 4a 0c          	mov    %cx,0xc(%edx)
    return netconn_send(conn, buf);
  80e752:	89 54 24 04          	mov    %edx,0x4(%esp)
  80e756:	8b 45 08             	mov    0x8(%ebp),%eax
  80e759:	89 04 24             	mov    %eax,(%esp)
  80e75c:	e8 82 ff ff ff       	call   80e6e3 <netconn_send>
  }
  return ERR_VAL;
}
  80e761:	c9                   	leave  
  80e762:	c3                   	ret    

0080e763 <netconn_listen_with_backlog>:
 * @return ERR_OK if the netconn was set to listen (UDP and RAW netconns
 *         don't return any error (yet?))
 */
err_t
netconn_listen_with_backlog(struct netconn *conn, u8_t backlog)
{
  80e763:	55                   	push   %ebp
  80e764:	89 e5                	mov    %esp,%ebp
  80e766:	53                   	push   %ebx
  80e767:	83 ec 34             	sub    $0x34,%esp
  80e76a:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct api_msg msg;

  /* This does no harm. If TCP_LISTEN_BACKLOG is off, backlog is unused. */
  LWIP_UNUSED_ARG(backlog);

  LWIP_ERROR("netconn_listen: invalid conn", (conn != NULL), return ERR_ARG;);
  80e76d:	85 db                	test   %ebx,%ebx
  80e76f:	75 1c                	jne    80e78d <netconn_listen_with_backlog+0x2a>
  80e771:	c7 44 24 08 16 4a 81 	movl   $0x814a16,0x8(%esp)
  80e778:	00 
  80e779:	c7 44 24 04 fa 00 00 	movl   $0xfa,0x4(%esp)
  80e780:	00 
  80e781:	c7 04 24 ac 49 81 00 	movl   $0x8149ac,(%esp)
  80e788:	e8 0f 22 ff ff       	call   80099c <_panic>

  msg.function = do_listen;
  80e78d:	c7 45 e4 ff f4 80 00 	movl   $0x80f4ff,-0x1c(%ebp)
  msg.msg.conn = conn;
  80e794:	89 5d e8             	mov    %ebx,-0x18(%ebp)
#if TCP_LISTEN_BACKLOG
  msg.msg.msg.lb.backlog = backlog;
#endif /* TCP_LISTEN_BACKLOG */
  TCPIP_APIMSG(&msg);
  80e797:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80e79a:	89 04 24             	mov    %eax,(%esp)
  80e79d:	e8 65 6a ff ff       	call   805207 <tcpip_apimsg>
  80e7a2:	0f b6 43 0c          	movzbl 0xc(%ebx),%eax
  return conn->err;
}
  80e7a6:	83 c4 34             	add    $0x34,%esp
  80e7a9:	5b                   	pop    %ebx
  80e7aa:	5d                   	pop    %ebp
  80e7ab:	c3                   	ret    

0080e7ac <netconn_disconnect>:
 * @param conn the netconn to disconnect
 * @return TODO: return value is not set here...
 */
err_t
netconn_disconnect(struct netconn *conn)
{
  80e7ac:	55                   	push   %ebp
  80e7ad:	89 e5                	mov    %esp,%ebp
  80e7af:	53                   	push   %ebx
  80e7b0:	83 ec 34             	sub    $0x34,%esp
  80e7b3:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct api_msg msg;

  LWIP_ERROR("netconn_disconnect: invalid conn", (conn != NULL), return ERR_ARG;);
  80e7b6:	85 db                	test   %ebx,%ebx
  80e7b8:	75 1c                	jne    80e7d6 <netconn_disconnect+0x2a>
  80e7ba:	c7 44 24 08 50 4b 81 	movl   $0x814b50,0x8(%esp)
  80e7c1:	00 
  80e7c2:	c7 44 24 04 e2 00 00 	movl   $0xe2,0x4(%esp)
  80e7c9:	00 
  80e7ca:	c7 04 24 ac 49 81 00 	movl   $0x8149ac,(%esp)
  80e7d1:	e8 c6 21 ff ff       	call   80099c <_panic>

  msg.function = do_disconnect;
  80e7d6:	c7 45 e4 c9 f6 80 00 	movl   $0x80f6c9,-0x1c(%ebp)
  msg.msg.conn = conn;
  80e7dd:	89 5d e8             	mov    %ebx,-0x18(%ebp)
  TCPIP_APIMSG(&msg);
  80e7e0:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80e7e3:	89 04 24             	mov    %eax,(%esp)
  80e7e6:	e8 1c 6a ff ff       	call   805207 <tcpip_apimsg>
  80e7eb:	0f b6 43 0c          	movzbl 0xc(%ebx),%eax
  return conn->err;
}
  80e7ef:	83 c4 34             	add    $0x34,%esp
  80e7f2:	5b                   	pop    %ebx
  80e7f3:	5d                   	pop    %ebp
  80e7f4:	c3                   	ret    

0080e7f5 <netconn_connect>:
 * @param port the remote port to connect to (no used for RAW)
 * @return ERR_OK if connected, return value of tcp_/udp_/raw_connect otherwise
 */
err_t
netconn_connect(struct netconn *conn, struct ip_addr *addr, u16_t port)
{
  80e7f5:	55                   	push   %ebp
  80e7f6:	89 e5                	mov    %esp,%ebp
  80e7f8:	53                   	push   %ebx
  80e7f9:	83 ec 34             	sub    $0x34,%esp
  80e7fc:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80e7ff:	0f b7 45 10          	movzwl 0x10(%ebp),%eax
  struct api_msg msg;

  LWIP_ERROR("netconn_connect: invalid conn", (conn != NULL), return ERR_ARG;);
  80e803:	85 db                	test   %ebx,%ebx
  80e805:	75 1c                	jne    80e823 <netconn_connect+0x2e>
  80e807:	c7 44 24 08 33 4a 81 	movl   $0x814a33,0x8(%esp)
  80e80e:	00 
  80e80f:	c7 44 24 04 cc 00 00 	movl   $0xcc,0x4(%esp)
  80e816:	00 
  80e817:	c7 04 24 ac 49 81 00 	movl   $0x8149ac,(%esp)
  80e81e:	e8 79 21 ff ff       	call   80099c <_panic>

  msg.function = do_connect;
  80e823:	c7 45 e4 00 f7 80 00 	movl   $0x80f700,-0x1c(%ebp)
  msg.msg.conn = conn;
  80e82a:	89 5d e8             	mov    %ebx,-0x18(%ebp)
  msg.msg.msg.bc.ipaddr = addr;
  80e82d:	8b 55 0c             	mov    0xc(%ebp),%edx
  80e830:	89 55 ec             	mov    %edx,-0x14(%ebp)
  msg.msg.msg.bc.port = port;
  80e833:	66 89 45 f0          	mov    %ax,-0x10(%ebp)
  /* This is the only function which need to not block tcpip_thread */
  tcpip_apimsg(&msg);
  80e837:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80e83a:	89 04 24             	mov    %eax,(%esp)
  80e83d:	e8 c5 69 ff ff       	call   805207 <tcpip_apimsg>
  80e842:	0f b6 43 0c          	movzbl 0xc(%ebx),%eax
  return conn->err;
}
  80e846:	83 c4 34             	add    $0x34,%esp
  80e849:	5b                   	pop    %ebx
  80e84a:	5d                   	pop    %ebp
  80e84b:	c3                   	ret    

0080e84c <netconn_bind>:
 * @param port the local port to bind the netconn to (not used for RAW)
 * @return ERR_OK if bound, any other err_t on failure
 */
err_t
netconn_bind(struct netconn *conn, struct ip_addr *addr, u16_t port)
{
  80e84c:	55                   	push   %ebp
  80e84d:	89 e5                	mov    %esp,%ebp
  80e84f:	53                   	push   %ebx
  80e850:	83 ec 34             	sub    $0x34,%esp
  80e853:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80e856:	0f b7 45 10          	movzwl 0x10(%ebp),%eax
  struct api_msg msg;

  LWIP_ERROR("netconn_bind: invalid conn", (conn != NULL), return ERR_ARG;);
  80e85a:	85 db                	test   %ebx,%ebx
  80e85c:	75 1c                	jne    80e87a <netconn_bind+0x2e>
  80e85e:	c7 44 24 08 51 4a 81 	movl   $0x814a51,0x8(%esp)
  80e865:	00 
  80e866:	c7 44 24 04 b5 00 00 	movl   $0xb5,0x4(%esp)
  80e86d:	00 
  80e86e:	c7 04 24 ac 49 81 00 	movl   $0x8149ac,(%esp)
  80e875:	e8 22 21 ff ff       	call   80099c <_panic>

  msg.function = do_bind;
  80e87a:	c7 45 e4 c8 f7 80 00 	movl   $0x80f7c8,-0x1c(%ebp)
  msg.msg.conn = conn;
  80e881:	89 5d e8             	mov    %ebx,-0x18(%ebp)
  msg.msg.msg.bc.ipaddr = addr;
  80e884:	8b 55 0c             	mov    0xc(%ebp),%edx
  80e887:	89 55 ec             	mov    %edx,-0x14(%ebp)
  msg.msg.msg.bc.port = port;
  80e88a:	66 89 45 f0          	mov    %ax,-0x10(%ebp)
  TCPIP_APIMSG(&msg);
  80e88e:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80e891:	89 04 24             	mov    %eax,(%esp)
  80e894:	e8 6e 69 ff ff       	call   805207 <tcpip_apimsg>
  80e899:	0f b6 43 0c          	movzbl 0xc(%ebx),%eax
  return conn->err;
}
  80e89d:	83 c4 34             	add    $0x34,%esp
  80e8a0:	5b                   	pop    %ebx
  80e8a1:	5d                   	pop    %ebp
  80e8a2:	c3                   	ret    

0080e8a3 <netconn_getaddr>:
 * @return ERR_CONN for invalid connections
 *         ERR_OK if the information was retrieved
 */
err_t
netconn_getaddr(struct netconn *conn, struct ip_addr *addr, u16_t *port, u8_t local)
{
  80e8a3:	55                   	push   %ebp
  80e8a4:	89 e5                	mov    %esp,%ebp
  80e8a6:	53                   	push   %ebx
  80e8a7:	83 ec 34             	sub    $0x34,%esp
  80e8aa:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80e8ad:	8b 55 0c             	mov    0xc(%ebp),%edx
  80e8b0:	8b 45 10             	mov    0x10(%ebp),%eax
  80e8b3:	0f b6 4d 14          	movzbl 0x14(%ebp),%ecx
  struct api_msg msg;

  LWIP_ERROR("netconn_getaddr: invalid conn", (conn != NULL), return ERR_ARG;);
  80e8b7:	85 db                	test   %ebx,%ebx
  80e8b9:	75 1c                	jne    80e8d7 <netconn_getaddr+0x34>
  80e8bb:	c7 44 24 08 6c 4a 81 	movl   $0x814a6c,0x8(%esp)
  80e8c2:	00 
  80e8c3:	c7 44 24 04 98 00 00 	movl   $0x98,0x4(%esp)
  80e8ca:	00 
  80e8cb:	c7 04 24 ac 49 81 00 	movl   $0x8149ac,(%esp)
  80e8d2:	e8 c5 20 ff ff       	call   80099c <_panic>
  LWIP_ERROR("netconn_getaddr: invalid addr", (addr != NULL), return ERR_ARG;);
  80e8d7:	85 d2                	test   %edx,%edx
  80e8d9:	75 1c                	jne    80e8f7 <netconn_getaddr+0x54>
  80e8db:	c7 44 24 08 8a 4a 81 	movl   $0x814a8a,0x8(%esp)
  80e8e2:	00 
  80e8e3:	c7 44 24 04 99 00 00 	movl   $0x99,0x4(%esp)
  80e8ea:	00 
  80e8eb:	c7 04 24 ac 49 81 00 	movl   $0x8149ac,(%esp)
  80e8f2:	e8 a5 20 ff ff       	call   80099c <_panic>
  LWIP_ERROR("netconn_getaddr: invalid port", (port != NULL), return ERR_ARG;);
  80e8f7:	85 c0                	test   %eax,%eax
  80e8f9:	75 1c                	jne    80e917 <netconn_getaddr+0x74>
  80e8fb:	c7 44 24 08 a8 4a 81 	movl   $0x814aa8,0x8(%esp)
  80e902:	00 
  80e903:	c7 44 24 04 9a 00 00 	movl   $0x9a,0x4(%esp)
  80e90a:	00 
  80e90b:	c7 04 24 ac 49 81 00 	movl   $0x8149ac,(%esp)
  80e912:	e8 85 20 ff ff       	call   80099c <_panic>

  msg.function = do_getaddr;
  80e917:	c7 45 e4 c0 ec 80 00 	movl   $0x80ecc0,-0x1c(%ebp)
  msg.msg.conn = conn;
  80e91e:	89 5d e8             	mov    %ebx,-0x18(%ebp)
  msg.msg.msg.ad.ipaddr = addr;
  80e921:	89 55 ec             	mov    %edx,-0x14(%ebp)
  msg.msg.msg.ad.port = port;
  80e924:	89 45 f0             	mov    %eax,-0x10(%ebp)
  msg.msg.msg.ad.local = local;
  80e927:	88 4d f4             	mov    %cl,-0xc(%ebp)
  TCPIP_APIMSG(&msg);
  80e92a:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80e92d:	89 04 24             	mov    %eax,(%esp)
  80e930:	e8 d2 68 ff ff       	call   805207 <tcpip_apimsg>
  80e935:	0f b6 43 0c          	movzbl 0xc(%ebx),%eax

  return conn->err;
}
  80e939:	83 c4 34             	add    $0x34,%esp
  80e93c:	5b                   	pop    %ebx
  80e93d:	5d                   	pop    %ebp
  80e93e:	c3                   	ret    

0080e93f <netconn_accept>:
 * @param conn the TCP listen netconn
 * @return the newly accepted netconn or NULL on timeout
 */
struct netconn *
netconn_accept(struct netconn *conn)
{
  80e93f:	55                   	push   %ebp
  80e940:	89 e5                	mov    %esp,%ebp
  80e942:	53                   	push   %ebx
  80e943:	83 ec 24             	sub    $0x24,%esp
  80e946:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct netconn *newconn;

  LWIP_ERROR("netconn_accept: invalid conn",       (conn != NULL),                      return NULL;);
  80e949:	85 db                	test   %ebx,%ebx
  80e94b:	75 1c                	jne    80e969 <netconn_accept+0x2a>
  80e94d:	c7 44 24 08 c6 4a 81 	movl   $0x814ac6,0x8(%esp)
  80e954:	00 
  80e955:	c7 44 24 04 10 01 00 	movl   $0x110,0x4(%esp)
  80e95c:	00 
  80e95d:	c7 04 24 ac 49 81 00 	movl   $0x8149ac,(%esp)
  80e964:	e8 33 20 ff ff       	call   80099c <_panic>
  LWIP_ERROR("netconn_accept: invalid acceptmbox", (conn->acceptmbox != SYS_MBOX_NULL), return NULL;);
  80e969:	8b 43 18             	mov    0x18(%ebx),%eax
  80e96c:	83 f8 ff             	cmp    $0xffffffff,%eax
  80e96f:	75 1c                	jne    80e98d <netconn_accept+0x4e>
  80e971:	c7 44 24 08 74 4b 81 	movl   $0x814b74,0x8(%esp)
  80e978:	00 
  80e979:	c7 44 24 04 11 01 00 	movl   $0x111,0x4(%esp)
  80e980:	00 
  80e981:	c7 04 24 ac 49 81 00 	movl   $0x8149ac,(%esp)
  80e988:	e8 0f 20 ff ff       	call   80099c <_panic>
#if LWIP_SO_RCVTIMEO
  if (sys_arch_mbox_fetch(conn->acceptmbox, (void *)&newconn, conn->recv_timeout) == SYS_ARCH_TIMEOUT) {
    newconn = NULL;
  } else
#else
  sys_arch_mbox_fetch(conn->acceptmbox, (void *)&newconn, 0);
  80e98d:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80e994:	00 
  80e995:	8d 55 f4             	lea    -0xc(%ebp),%edx
  80e998:	89 54 24 04          	mov    %edx,0x4(%esp)
  80e99c:	89 04 24             	mov    %eax,(%esp)
  80e99f:	e8 cf f2 ff ff       	call   80dc73 <sys_arch_mbox_fetch>
#endif /* LWIP_SO_RCVTIMEO*/
  {
    /* Register event with callback */
    API_EVENT(conn, NETCONN_EVT_RCVMINUS, 0);
  80e9a4:	8b 43 2c             	mov    0x2c(%ebx),%eax
  80e9a7:	85 c0                	test   %eax,%eax
  80e9a9:	74 15                	je     80e9c0 <netconn_accept+0x81>
  80e9ab:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80e9b2:	00 
  80e9b3:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  80e9ba:	00 
  80e9bb:	89 1c 24             	mov    %ebx,(%esp)
  80e9be:	ff d0                	call   *%eax
    }
#endif /* TCP_LISTEN_BACKLOG */
  }

  return newconn;
}
  80e9c0:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80e9c3:	83 c4 24             	add    $0x24,%esp
  80e9c6:	5b                   	pop    %ebx
  80e9c7:	5d                   	pop    %ebp
  80e9c8:	c3                   	ret    

0080e9c9 <netconn_recv>:
 * @param conn the netconn from which to receive data
 * @return a new netbuf containing received data or NULL on memory error or timeout
 */
struct netbuf *
netconn_recv(struct netconn *conn)
{
  80e9c9:	55                   	push   %ebp
  80e9ca:	89 e5                	mov    %esp,%ebp
  80e9cc:	53                   	push   %ebx
  80e9cd:	83 ec 34             	sub    $0x34,%esp
  80e9d0:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct api_msg msg;
  struct netbuf *buf = NULL;
  80e9d3:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
  struct pbuf *p;
  u16_t len;

  LWIP_ERROR("netconn_recv: invalid conn",  (conn != NULL), return NULL;);
  80e9da:	85 db                	test   %ebx,%ebx
  80e9dc:	75 1c                	jne    80e9fa <netconn_recv+0x31>
  80e9de:	c7 44 24 08 e3 4a 81 	movl   $0x814ae3,0x8(%esp)
  80e9e5:	00 
  80e9e6:	c7 44 24 04 3a 01 00 	movl   $0x13a,0x4(%esp)
  80e9ed:	00 
  80e9ee:	c7 04 24 ac 49 81 00 	movl   $0x8149ac,(%esp)
  80e9f5:	e8 a2 1f ff ff       	call   80099c <_panic>

  if (conn->recvmbox == SYS_MBOX_NULL) {
  80e9fa:	8b 43 14             	mov    0x14(%ebx),%eax
  80e9fd:	83 f8 ff             	cmp    $0xffffffff,%eax
  80ea00:	75 0e                	jne    80ea10 <netconn_recv+0x47>
    /* @todo: should calling netconn_recv on a TCP listen conn be fatal (ERR_CONN)?? */
    /* TCP listen conns don't have a recvmbox! */
    conn->err = ERR_CONN;
  80ea02:	c6 43 0c f8          	movb   $0xf8,0xc(%ebx)
  80ea06:	b8 00 00 00 00       	mov    $0x0,%eax
    return NULL;
  80ea0b:	e9 65 01 00 00       	jmp    80eb75 <netconn_recv+0x1ac>
  }

  if (ERR_IS_FATAL(conn->err)) {
  80ea10:	80 7b 0c fc          	cmpb   $0xfc,0xc(%ebx)
  80ea14:	0f 8c 56 01 00 00    	jl     80eb70 <netconn_recv+0x1a7>
    return NULL;
  }

  if (conn->type == NETCONN_TCP) {
  80ea1a:	83 3b 10             	cmpl   $0x10,(%ebx)
  80ea1d:	8d 76 00             	lea    0x0(%esi),%esi
  80ea20:	0f 85 fc 00 00 00    	jne    80eb22 <netconn_recv+0x159>
#if LWIP_TCP
    if (conn->state == NETCONN_LISTEN) {
  80ea26:	83 7b 04 02          	cmpl   $0x2,0x4(%ebx)
  80ea2a:	75 0e                	jne    80ea3a <netconn_recv+0x71>
      /* @todo: should calling netconn_recv on a TCP listen conn be fatal?? */
      conn->err = ERR_CONN;
  80ea2c:	c6 43 0c f8          	movb   $0xf8,0xc(%ebx)
  80ea30:	b8 00 00 00 00       	mov    $0x0,%eax
      return NULL;
  80ea35:	e9 3b 01 00 00       	jmp    80eb75 <netconn_recv+0x1ac>
    }

    buf = memp_malloc(MEMP_NETBUF);
  80ea3a:	c7 04 24 06 00 00 00 	movl   $0x6,(%esp)
  80ea41:	e8 72 8d ff ff       	call   8077b8 <memp_malloc>
  80ea46:	89 45 e0             	mov    %eax,-0x20(%ebp)

    if (buf == NULL) {
  80ea49:	85 c0                	test   %eax,%eax
  80ea4b:	75 09                	jne    80ea56 <netconn_recv+0x8d>
      conn->err = ERR_MEM;
  80ea4d:	c6 43 0c ff          	movb   $0xff,0xc(%ebx)
      return NULL;
  80ea51:	e9 1f 01 00 00       	jmp    80eb75 <netconn_recv+0x1ac>
    if (sys_arch_mbox_fetch(conn->recvmbox, (void *)&p, conn->recv_timeout)==SYS_ARCH_TIMEOUT) {
      conn->err = ERR_TIMEOUT;
      p = NULL;
    }
#else
    sys_arch_mbox_fetch(conn->recvmbox, (void *)&p, 0);
  80ea56:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80ea5d:	00 
  80ea5e:	8d 45 dc             	lea    -0x24(%ebp),%eax
  80ea61:	89 44 24 04          	mov    %eax,0x4(%esp)
  80ea65:	8b 43 14             	mov    0x14(%ebx),%eax
  80ea68:	89 04 24             	mov    %eax,(%esp)
  80ea6b:	e8 03 f2 ff ff       	call   80dc73 <sys_arch_mbox_fetch>
#endif /* LWIP_SO_RCVTIMEO*/

    if (p != NULL) {
  80ea70:	8b 55 dc             	mov    -0x24(%ebp),%edx
  80ea73:	b8 00 00 00 00       	mov    $0x0,%eax
  80ea78:	85 d2                	test   %edx,%edx
  80ea7a:	74 08                	je     80ea84 <netconn_recv+0xbb>
      len = p->tot_len;
  80ea7c:	0f b7 42 08          	movzwl 0x8(%edx),%eax
      SYS_ARCH_DEC(conn->recv_avail, len);
  80ea80:	66 29 43 20          	sub    %ax,0x20(%ebx)
    } else {
      len = 0;
    }

    /* Register event with callback */
    API_EVENT(conn, NETCONN_EVT_RCVMINUS, len);
  80ea84:	8b 53 2c             	mov    0x2c(%ebx),%edx
  80ea87:	85 d2                	test   %edx,%edx
  80ea89:	74 14                	je     80ea9f <netconn_recv+0xd6>
  80ea8b:	0f b7 c0             	movzwl %ax,%eax
  80ea8e:	89 44 24 08          	mov    %eax,0x8(%esp)
  80ea92:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  80ea99:	00 
  80ea9a:	89 1c 24             	mov    %ebx,(%esp)
  80ea9d:	ff d2                	call   *%edx

    /* If we are closed, we indicate that we no longer wish to use the socket */
    if (p == NULL) {
  80ea9f:	8b 45 dc             	mov    -0x24(%ebp),%eax
  80eaa2:	85 c0                	test   %eax,%eax
  80eaa4:	75 2b                	jne    80ead1 <netconn_recv+0x108>
      memp_free(MEMP_NETBUF, buf);
  80eaa6:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80eaa9:	89 44 24 04          	mov    %eax,0x4(%esp)
  80eaad:	c7 04 24 06 00 00 00 	movl   $0x6,(%esp)
  80eab4:	e8 bb 8c ff ff       	call   807774 <memp_free>
      /* Avoid to lose any previous error code */
      if (conn->err == ERR_OK) {
  80eab9:	80 7b 0c 00          	cmpb   $0x0,0xc(%ebx)
  80eabd:	0f 85 ad 00 00 00    	jne    80eb70 <netconn_recv+0x1a7>
        conn->err = ERR_CLSD;
  80eac3:	c6 43 0c f9          	movb   $0xf9,0xc(%ebx)
  80eac7:	b8 00 00 00 00       	mov    $0x0,%eax
  80eacc:	e9 a4 00 00 00       	jmp    80eb75 <netconn_recv+0x1ac>
      }
      return NULL;
    }

    buf->p = p;
  80ead1:	8b 55 e0             	mov    -0x20(%ebp),%edx
  80ead4:	89 02                	mov    %eax,(%edx)
    buf->ptr = p;
  80ead6:	8b 55 dc             	mov    -0x24(%ebp),%edx
  80ead9:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80eadc:	89 50 04             	mov    %edx,0x4(%eax)
    buf->port = 0;
  80eadf:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80eae2:	66 c7 40 0c 00 00    	movw   $0x0,0xc(%eax)
    buf->addr = NULL;
  80eae8:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80eaeb:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)

    /* Let the stack know that we have taken the data. */
    msg.function = do_recv;
  80eaf2:	c7 45 e4 fb f3 80 00 	movl   $0x80f3fb,-0x1c(%ebp)
    msg.msg.conn = conn;
  80eaf9:	89 5d e8             	mov    %ebx,-0x18(%ebp)
    if (buf != NULL) {
  80eafc:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80eaff:	85 c0                	test   %eax,%eax
  80eb01:	74 0c                	je     80eb0f <netconn_recv+0x146>
      msg.msg.msg.r.len = buf->p->tot_len;
  80eb03:	8b 00                	mov    (%eax),%eax
  80eb05:	0f b7 40 08          	movzwl 0x8(%eax),%eax
  80eb09:	66 89 45 ec          	mov    %ax,-0x14(%ebp)
  80eb0d:	eb 06                	jmp    80eb15 <netconn_recv+0x14c>
    } else {
      msg.msg.msg.r.len = 1;
  80eb0f:	66 c7 45 ec 01 00    	movw   $0x1,-0x14(%ebp)
    }
    TCPIP_APIMSG(&msg);
  80eb15:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80eb18:	89 04 24             	mov    %eax,(%esp)
  80eb1b:	e8 e7 66 ff ff       	call   805207 <tcpip_apimsg>
  80eb20:	eb 49                	jmp    80eb6b <netconn_recv+0x1a2>
#if LWIP_SO_RCVTIMEO
    if (sys_arch_mbox_fetch(conn->recvmbox, (void *)&buf, conn->recv_timeout)==SYS_ARCH_TIMEOUT) {
      buf = NULL;
    }
#else
    sys_arch_mbox_fetch(conn->recvmbox, (void *)&buf, 0);
  80eb22:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80eb29:	00 
  80eb2a:	8d 55 e0             	lea    -0x20(%ebp),%edx
  80eb2d:	89 54 24 04          	mov    %edx,0x4(%esp)
  80eb31:	89 04 24             	mov    %eax,(%esp)
  80eb34:	e8 3a f1 ff ff       	call   80dc73 <sys_arch_mbox_fetch>
#endif /* LWIP_SO_RCVTIMEO*/
    if (buf!=NULL) {
  80eb39:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80eb3c:	85 c0                	test   %eax,%eax
  80eb3e:	74 2b                	je     80eb6b <netconn_recv+0x1a2>
      SYS_ARCH_DEC(conn->recv_avail, buf->p->tot_len);
  80eb40:	8b 00                	mov    (%eax),%eax
  80eb42:	0f b7 40 08          	movzwl 0x8(%eax),%eax
  80eb46:	66 29 43 20          	sub    %ax,0x20(%ebx)
      /* Register event with callback */
      API_EVENT(conn, NETCONN_EVT_RCVMINUS, buf->p->tot_len);
  80eb4a:	8b 43 2c             	mov    0x2c(%ebx),%eax
  80eb4d:	85 c0                	test   %eax,%eax
  80eb4f:	74 1a                	je     80eb6b <netconn_recv+0x1a2>
  80eb51:	8b 55 e0             	mov    -0x20(%ebp),%edx
  80eb54:	8b 12                	mov    (%edx),%edx
  80eb56:	0f b7 52 08          	movzwl 0x8(%edx),%edx
  80eb5a:	89 54 24 08          	mov    %edx,0x8(%esp)
  80eb5e:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  80eb65:	00 
  80eb66:	89 1c 24             	mov    %ebx,(%esp)
  80eb69:	ff d0                	call   *%eax
#endif /* (LWIP_UDP || LWIP_RAW) */
  }

  LWIP_DEBUGF(API_LIB_DEBUG, ("netconn_recv: received %p (err %d)\n", (void *)buf, conn->err));

  return buf;
  80eb6b:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80eb6e:	eb 05                	jmp    80eb75 <netconn_recv+0x1ac>
  80eb70:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80eb75:	83 c4 34             	add    $0x34,%esp
  80eb78:	5b                   	pop    %ebx
  80eb79:	5d                   	pop    %ebp
  80eb7a:	c3                   	ret    

0080eb7b <netconn_delete>:
 * @param conn the netconn to delete
 * @return ERR_OK if the connection was deleted
 */
err_t
netconn_delete(struct netconn *conn)
{
  80eb7b:	55                   	push   %ebp
  80eb7c:	89 e5                	mov    %esp,%ebp
  80eb7e:	53                   	push   %ebx
  80eb7f:	83 ec 34             	sub    $0x34,%esp
  80eb82:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct api_msg msg;

  /* No ASSERT here because possible to get a (conn == NULL) if we got an accept error */
  if (conn == NULL) {
  80eb85:	85 db                	test   %ebx,%ebx
  80eb87:	74 24                	je     80ebad <netconn_delete+0x32>
    return ERR_OK;
  }

  msg.function = do_delconn;
  80eb89:	c7 45 e4 69 f8 80 00 	movl   $0x80f869,-0x1c(%ebp)
  msg.msg.conn = conn;
  80eb90:	89 5d e8             	mov    %ebx,-0x18(%ebp)
  tcpip_apimsg(&msg);
  80eb93:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80eb96:	89 04 24             	mov    %eax,(%esp)
  80eb99:	e8 69 66 ff ff       	call   805207 <tcpip_apimsg>

  conn->pcb.tcp = NULL;
  80eb9e:	c7 43 08 00 00 00 00 	movl   $0x0,0x8(%ebx)
  netconn_free(conn);
  80eba5:	89 1c 24             	mov    %ebx,(%esp)
  80eba8:	e8 74 0d 00 00       	call   80f921 <netconn_free>

  return ERR_OK;
}
  80ebad:	b8 00 00 00 00       	mov    $0x0,%eax
  80ebb2:	83 c4 34             	add    $0x34,%esp
  80ebb5:	5b                   	pop    %ebx
  80ebb6:	5d                   	pop    %ebp
  80ebb7:	c3                   	ret    

0080ebb8 <netconn_new_with_proto_and_callback>:
 * @return a newly allocated struct netconn or
 *         NULL on memory error
 */
struct netconn*
netconn_new_with_proto_and_callback(enum netconn_type t, u8_t proto, netconn_callback callback)
{
  80ebb8:	55                   	push   %ebp
  80ebb9:	89 e5                	mov    %esp,%ebp
  80ebbb:	56                   	push   %esi
  80ebbc:	53                   	push   %ebx
  80ebbd:	83 ec 30             	sub    $0x30,%esp
  80ebc0:	0f b6 75 0c          	movzbl 0xc(%ebp),%esi
  struct netconn *conn;
  struct api_msg msg;

  conn = netconn_alloc(t, callback);
  80ebc4:	8b 45 10             	mov    0x10(%ebp),%eax
  80ebc7:	89 44 24 04          	mov    %eax,0x4(%esp)
  80ebcb:	8b 45 08             	mov    0x8(%ebp),%eax
  80ebce:	89 04 24             	mov    %eax,(%esp)
  80ebd1:	e8 47 0f 00 00       	call   80fb1d <netconn_alloc>
  80ebd6:	89 c3                	mov    %eax,%ebx
  
  if (conn != NULL ) {
  80ebd8:	85 c0                	test   %eax,%eax
  80ebda:	0f 84 d6 00 00 00    	je     80ecb6 <netconn_new_with_proto_and_callback+0xfe>
    msg.function = do_newconn;
  80ebe0:	c7 45 e4 8a fc 80 00 	movl   $0x80fc8a,-0x1c(%ebp)
    msg.msg.msg.n.proto = proto;
  80ebe7:	89 f0                	mov    %esi,%eax
  80ebe9:	88 45 ec             	mov    %al,-0x14(%ebp)
    msg.msg.conn = conn;
  80ebec:	89 5d e8             	mov    %ebx,-0x18(%ebp)
    TCPIP_APIMSG(&msg);
  80ebef:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80ebf2:	89 04 24             	mov    %eax,(%esp)
  80ebf5:	e8 0d 66 ff ff       	call   805207 <tcpip_apimsg>

    if (conn->err != ERR_OK) {
  80ebfa:	80 7b 0c 00          	cmpb   $0x0,0xc(%ebx)
  80ebfe:	0f 84 b2 00 00 00    	je     80ecb6 <netconn_new_with_proto_and_callback+0xfe>
      LWIP_ASSERT("freeing conn without freeing pcb", conn->pcb.tcp == NULL);
  80ec04:	83 7b 08 00          	cmpl   $0x0,0x8(%ebx)
  80ec08:	74 1c                	je     80ec26 <netconn_new_with_proto_and_callback+0x6e>
  80ec0a:	c7 44 24 08 98 4b 81 	movl   $0x814b98,0x8(%esp)
  80ec11:	00 
  80ec12:	c7 44 24 04 52 00 00 	movl   $0x52,0x4(%esp)
  80ec19:	00 
  80ec1a:	c7 04 24 ac 49 81 00 	movl   $0x8149ac,(%esp)
  80ec21:	e8 76 1d ff ff       	call   80099c <_panic>
      LWIP_ASSERT("conn has no op_completed", conn->op_completed != SYS_SEM_NULL);
  80ec26:	8b 43 10             	mov    0x10(%ebx),%eax
  80ec29:	83 f8 ff             	cmp    $0xffffffff,%eax
  80ec2c:	75 1c                	jne    80ec4a <netconn_new_with_proto_and_callback+0x92>
  80ec2e:	c7 44 24 08 fe 4a 81 	movl   $0x814afe,0x8(%esp)
  80ec35:	00 
  80ec36:	c7 44 24 04 53 00 00 	movl   $0x53,0x4(%esp)
  80ec3d:	00 
  80ec3e:	c7 04 24 ac 49 81 00 	movl   $0x8149ac,(%esp)
  80ec45:	e8 52 1d ff ff       	call   80099c <_panic>
      LWIP_ASSERT("conn has no recvmbox", conn->recvmbox != SYS_MBOX_NULL);
  80ec4a:	83 7b 14 ff          	cmpl   $0xffffffff,0x14(%ebx)
  80ec4e:	75 1c                	jne    80ec6c <netconn_new_with_proto_and_callback+0xb4>
  80ec50:	c7 44 24 08 17 4b 81 	movl   $0x814b17,0x8(%esp)
  80ec57:	00 
  80ec58:	c7 44 24 04 54 00 00 	movl   $0x54,0x4(%esp)
  80ec5f:	00 
  80ec60:	c7 04 24 ac 49 81 00 	movl   $0x8149ac,(%esp)
  80ec67:	e8 30 1d ff ff       	call   80099c <_panic>
      LWIP_ASSERT("conn->acceptmbox shouldn't exist", conn->acceptmbox == SYS_MBOX_NULL);
  80ec6c:	83 7b 18 ff          	cmpl   $0xffffffff,0x18(%ebx)
  80ec70:	74 1c                	je     80ec8e <netconn_new_with_proto_and_callback+0xd6>
  80ec72:	c7 44 24 08 bc 4b 81 	movl   $0x814bbc,0x8(%esp)
  80ec79:	00 
  80ec7a:	c7 44 24 04 55 00 00 	movl   $0x55,0x4(%esp)
  80ec81:	00 
  80ec82:	c7 04 24 ac 49 81 00 	movl   $0x8149ac,(%esp)
  80ec89:	e8 0e 1d ff ff       	call   80099c <_panic>
      sys_sem_free(conn->op_completed);
  80ec8e:	89 04 24             	mov    %eax,(%esp)
  80ec91:	e8 ed e8 ff ff       	call   80d583 <sys_sem_free>
      sys_mbox_free(conn->recvmbox);
  80ec96:	8b 43 14             	mov    0x14(%ebx),%eax
  80ec99:	89 04 24             	mov    %eax,(%esp)
  80ec9c:	e8 72 e9 ff ff       	call   80d613 <sys_mbox_free>
      memp_free(MEMP_NETCONN, conn);
  80eca1:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  80eca5:	c7 04 24 07 00 00 00 	movl   $0x7,(%esp)
  80ecac:	e8 c3 8a ff ff       	call   807774 <memp_free>
  80ecb1:	bb 00 00 00 00       	mov    $0x0,%ebx
      return NULL;
    }
  }
  return conn;
}
  80ecb6:	89 d8                	mov    %ebx,%eax
  80ecb8:	83 c4 30             	add    $0x30,%esp
  80ecbb:	5b                   	pop    %ebx
  80ecbc:	5e                   	pop    %esi
  80ecbd:	5d                   	pop    %ebp
  80ecbe:	c3                   	ret    
	...

0080ecc0 <do_getaddr>:
 *
 * @param msg the api_msg_msg pointing to the connection
 */
void
do_getaddr(struct api_msg_msg *msg)
{
  80ecc0:	55                   	push   %ebp
  80ecc1:	89 e5                	mov    %esp,%ebp
  80ecc3:	83 ec 18             	sub    $0x18,%esp
  80ecc6:	8b 45 08             	mov    0x8(%ebp),%eax
  if (msg->conn->pcb.ip != NULL) {
  80ecc9:	8b 08                	mov    (%eax),%ecx
  80eccb:	8b 51 08             	mov    0x8(%ecx),%edx
  80ecce:	85 d2                	test   %edx,%edx
  80ecd0:	0f 84 9f 00 00 00    	je     80ed75 <do_getaddr+0xb5>
    *(msg->msg.ad.ipaddr) = (msg->msg.ad.local?msg->conn->pcb.ip->local_ip:msg->conn->pcb.ip->remote_ip);
  80ecd6:	8b 48 04             	mov    0x4(%eax),%ecx
  80ecd9:	80 78 0c 00          	cmpb   $0x0,0xc(%eax)
  80ecdd:	74 06                	je     80ece5 <do_getaddr+0x25>
  80ecdf:	8b 12                	mov    (%edx),%edx
  80ece1:	89 11                	mov    %edx,(%ecx)
  80ece3:	eb 05                	jmp    80ecea <do_getaddr+0x2a>
  80ece5:	8b 52 04             	mov    0x4(%edx),%edx
  80ece8:	89 11                	mov    %edx,(%ecx)
    
    switch (NETCONNTYPE_GROUP(msg->conn->type)) {
  80ecea:	8b 08                	mov    (%eax),%ecx
  80ecec:	8b 11                	mov    (%ecx),%edx
  80ecee:	81 e2 f0 00 00 00    	and    $0xf0,%edx
  80ecf4:	83 fa 20             	cmp    $0x20,%edx
  80ecf7:	74 2e                	je     80ed27 <do_getaddr+0x67>
  80ecf9:	83 fa 40             	cmp    $0x40,%edx
  80ecfc:	74 0c                	je     80ed0a <do_getaddr+0x4a>
  80ecfe:	83 fa 10             	cmp    $0x10,%edx
  80ed01:	75 76                	jne    80ed79 <do_getaddr+0xb9>
  80ed03:	90                   	nop
  80ed04:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  80ed08:	eb 4d                	jmp    80ed57 <do_getaddr+0x97>
#if LWIP_RAW
    case NETCONN_RAW:
      if (msg->msg.ad.local) {
  80ed0a:	80 78 0c 00          	cmpb   $0x0,0xc(%eax)
  80ed0e:	66 90                	xchg   %ax,%ax
  80ed10:	74 0f                	je     80ed21 <do_getaddr+0x61>
        *(msg->msg.ad.port) = msg->conn->pcb.raw->protocol;
  80ed12:	8b 50 08             	mov    0x8(%eax),%edx
  80ed15:	8b 49 08             	mov    0x8(%ecx),%ecx
  80ed18:	0f b6 49 10          	movzbl 0x10(%ecx),%ecx
  80ed1c:	66 89 0a             	mov    %cx,(%edx)
  80ed1f:	eb 58                	jmp    80ed79 <do_getaddr+0xb9>
      } else {
        /* return an error as connecting is only a helper for upper layers */
        msg->conn->err = ERR_CONN;
  80ed21:	c6 41 0c f8          	movb   $0xf8,0xc(%ecx)
  80ed25:	eb 52                	jmp    80ed79 <do_getaddr+0xb9>
      }
      break;
#endif /* LWIP_RAW */
#if LWIP_UDP
    case NETCONN_UDP:
      if (msg->msg.ad.local) {
  80ed27:	80 78 0c 00          	cmpb   $0x0,0xc(%eax)
  80ed2b:	74 0f                	je     80ed3c <do_getaddr+0x7c>
        *(msg->msg.ad.port) = msg->conn->pcb.udp->local_port;
  80ed2d:	8b 50 08             	mov    0x8(%eax),%edx
  80ed30:	8b 49 08             	mov    0x8(%ecx),%ecx
  80ed33:	0f b7 49 12          	movzwl 0x12(%ecx),%ecx
  80ed37:	66 89 0a             	mov    %cx,(%edx)
  80ed3a:	eb 3d                	jmp    80ed79 <do_getaddr+0xb9>
      } else {
        if ((msg->conn->pcb.udp->flags & UDP_FLAGS_CONNECTED) == 0) {
  80ed3c:	8b 51 08             	mov    0x8(%ecx),%edx
  80ed3f:	f6 42 10 04          	testb  $0x4,0x10(%edx)
  80ed43:	75 06                	jne    80ed4b <do_getaddr+0x8b>
          msg->conn->err = ERR_CONN;
  80ed45:	c6 41 0c f8          	movb   $0xf8,0xc(%ecx)
  80ed49:	eb 2e                	jmp    80ed79 <do_getaddr+0xb9>
        } else {
          *(msg->msg.ad.port) = msg->conn->pcb.udp->remote_port;
  80ed4b:	8b 48 08             	mov    0x8(%eax),%ecx
  80ed4e:	0f b7 52 14          	movzwl 0x14(%edx),%edx
  80ed52:	66 89 11             	mov    %dx,(%ecx)
  80ed55:	eb 22                	jmp    80ed79 <do_getaddr+0xb9>
      }
      break;
#endif /* LWIP_UDP */
#if LWIP_TCP
    case NETCONN_TCP:
      *(msg->msg.ad.port) = (msg->msg.ad.local?msg->conn->pcb.tcp->local_port:msg->conn->pcb.tcp->remote_port);
  80ed57:	8b 50 08             	mov    0x8(%eax),%edx
  80ed5a:	80 78 0c 00          	cmpb   $0x0,0xc(%eax)
  80ed5e:	74 09                	je     80ed69 <do_getaddr+0xa9>
  80ed60:	8b 49 08             	mov    0x8(%ecx),%ecx
  80ed63:	0f b7 49 1c          	movzwl 0x1c(%ecx),%ecx
  80ed67:	eb 07                	jmp    80ed70 <do_getaddr+0xb0>
  80ed69:	8b 49 08             	mov    0x8(%ecx),%ecx
  80ed6c:	0f b7 49 1e          	movzwl 0x1e(%ecx),%ecx
  80ed70:	66 89 0a             	mov    %cx,(%edx)
  80ed73:	eb 04                	jmp    80ed79 <do_getaddr+0xb9>
      break;
#endif /* LWIP_TCP */
    }
  } else {
    msg->conn->err = ERR_CONN;
  80ed75:	c6 41 0c f8          	movb   $0xf8,0xc(%ecx)
  }
  TCPIP_APIMSG_ACK(msg);
  80ed79:	8b 00                	mov    (%eax),%eax
  80ed7b:	8b 40 10             	mov    0x10(%eax),%eax
  80ed7e:	89 04 24             	mov    %eax,(%esp)
  80ed81:	e8 61 ee ff ff       	call   80dbe7 <sys_sem_signal>
}
  80ed86:	c9                   	leave  
  80ed87:	c3                   	ret    

0080ed88 <setup_tcp>:
 *
 * @param conn the TCP netconn to setup
 */
static void
setup_tcp(struct netconn *conn)
{
  80ed88:	55                   	push   %ebp
  80ed89:	89 e5                	mov    %esp,%ebp
  80ed8b:	53                   	push   %ebx
  80ed8c:	83 ec 14             	sub    $0x14,%esp
  struct tcp_pcb *pcb;

  pcb = conn->pcb.tcp;
  80ed8f:	8b 58 08             	mov    0x8(%eax),%ebx
  tcp_arg(pcb, conn);
  80ed92:	89 44 24 04          	mov    %eax,0x4(%esp)
  80ed96:	89 1c 24             	mov    %ebx,(%esp)
  80ed99:	e8 ca 9a ff ff       	call   808868 <tcp_arg>
  tcp_recv(pcb, recv_tcp);
  80ed9e:	c7 44 24 04 f0 f5 80 	movl   $0x80f5f0,0x4(%esp)
  80eda5:	00 
  80eda6:	89 1c 24             	mov    %ebx,(%esp)
  80eda9:	e8 c8 9a ff ff       	call   808876 <tcp_recv>
  tcp_sent(pcb, sent_tcp);
  80edae:	c7 44 24 04 fc f2 80 	movl   $0x80f2fc,0x4(%esp)
  80edb5:	00 
  80edb6:	89 1c 24             	mov    %ebx,(%esp)
  80edb9:	e8 c9 9a ff ff       	call   808887 <tcp_sent>
  tcp_poll(pcb, poll_tcp, 4);
  80edbe:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  80edc5:	00 
  80edc6:	c7 44 24 04 aa f2 80 	movl   $0x80f2aa,0x4(%esp)
  80edcd:	00 
  80edce:	89 1c 24             	mov    %ebx,(%esp)
  80edd1:	e8 e1 9a ff ff       	call   8088b7 <tcp_poll>
  tcp_err(pcb, err_tcp);
  80edd6:	c7 44 24 04 68 f0 80 	movl   $0x80f068,0x4(%esp)
  80eddd:	00 
  80edde:	89 1c 24             	mov    %ebx,(%esp)
  80ede1:	e8 b2 9a ff ff       	call   808898 <tcp_err>
}
  80ede6:	83 c4 14             	add    $0x14,%esp
  80ede9:	5b                   	pop    %ebx
  80edea:	5d                   	pop    %ebp
  80edeb:	c3                   	ret    

0080edec <do_connected>:
 *
 * @see tcp.h (struct tcp_pcb.connected) for parameters and return values
 */
static err_t
do_connected(void *arg, struct tcp_pcb *pcb, err_t err)
{
  80edec:	55                   	push   %ebp
  80eded:	89 e5                	mov    %esp,%ebp
  80edef:	53                   	push   %ebx
  80edf0:	83 ec 14             	sub    $0x14,%esp
  80edf3:	0f b6 55 10          	movzbl 0x10(%ebp),%edx
  struct netconn *conn;

  LWIP_UNUSED_ARG(pcb);

  conn = arg;
  80edf7:	8b 5d 08             	mov    0x8(%ebp),%ebx

  if (conn == NULL) {
  80edfa:	b8 f7 ff ff ff       	mov    $0xfffffff7,%eax
  80edff:	85 db                	test   %ebx,%ebx
  80ee01:	74 2a                	je     80ee2d <do_connected+0x41>
    return ERR_VAL;
  }

  conn->err = err;
  80ee03:	88 53 0c             	mov    %dl,0xc(%ebx)
  if ((conn->type == NETCONN_TCP) && (err == ERR_OK)) {
  80ee06:	83 3b 10             	cmpl   $0x10,(%ebx)
  80ee09:	75 0b                	jne    80ee16 <do_connected+0x2a>
  80ee0b:	84 d2                	test   %dl,%dl
  80ee0d:	75 07                	jne    80ee16 <do_connected+0x2a>
    setup_tcp(conn);
  80ee0f:	89 d8                	mov    %ebx,%eax
  80ee11:	e8 72 ff ff ff       	call   80ed88 <setup_tcp>
  }
  conn->state = NETCONN_NONE;
  80ee16:	c7 43 04 00 00 00 00 	movl   $0x0,0x4(%ebx)
  sys_sem_signal(conn->op_completed);
  80ee1d:	8b 43 10             	mov    0x10(%ebx),%eax
  80ee20:	89 04 24             	mov    %eax,(%esp)
  80ee23:	e8 bf ed ff ff       	call   80dbe7 <sys_sem_signal>
  80ee28:	b8 00 00 00 00       	mov    $0x0,%eax
  return ERR_OK;
}
  80ee2d:	83 c4 14             	add    $0x14,%esp
  80ee30:	5b                   	pop    %ebx
  80ee31:	5d                   	pop    %ebp
  80ee32:	c3                   	ret    

0080ee33 <do_close_internal>:
 *
 * @param conn the TCP netconn to close
 */
static void
do_close_internal(struct netconn *conn)
{
  80ee33:	55                   	push   %ebp
  80ee34:	89 e5                	mov    %esp,%ebp
  80ee36:	53                   	push   %ebx
  80ee37:	83 ec 14             	sub    $0x14,%esp
  80ee3a:	89 c3                	mov    %eax,%ebx
  err_t err;

  LWIP_ASSERT("invalid conn", (conn != NULL));
  80ee3c:	85 c0                	test   %eax,%eax
  80ee3e:	75 1c                	jne    80ee5c <do_close_internal+0x29>
  80ee40:	c7 44 24 08 09 4a 81 	movl   $0x814a09,0x8(%esp)
  80ee47:	00 
  80ee48:	c7 44 24 04 53 02 00 	movl   $0x253,0x4(%esp)
  80ee4f:	00 
  80ee50:	c7 04 24 dd 4b 81 00 	movl   $0x814bdd,(%esp)
  80ee57:	e8 40 1b ff ff       	call   80099c <_panic>
  LWIP_ASSERT("this is for tcp netconns only", (conn->type == NETCONN_TCP));
  80ee5c:	83 38 10             	cmpl   $0x10,(%eax)
  80ee5f:	74 1c                	je     80ee7d <do_close_internal+0x4a>
  80ee61:	c7 44 24 08 f4 4b 81 	movl   $0x814bf4,0x8(%esp)
  80ee68:	00 
  80ee69:	c7 44 24 04 54 02 00 	movl   $0x254,0x4(%esp)
  80ee70:	00 
  80ee71:	c7 04 24 dd 4b 81 00 	movl   $0x814bdd,(%esp)
  80ee78:	e8 1f 1b ff ff       	call   80099c <_panic>
  LWIP_ASSERT("conn must be in state NETCONN_CLOSE", (conn->state == NETCONN_CLOSE));
  80ee7d:	83 78 04 04          	cmpl   $0x4,0x4(%eax)
  80ee81:	74 1c                	je     80ee9f <do_close_internal+0x6c>
  80ee83:	c7 44 24 08 c0 4c 81 	movl   $0x814cc0,0x8(%esp)
  80ee8a:	00 
  80ee8b:	c7 44 24 04 55 02 00 	movl   $0x255,0x4(%esp)
  80ee92:	00 
  80ee93:	c7 04 24 dd 4b 81 00 	movl   $0x814bdd,(%esp)
  80ee9a:	e8 fd 1a ff ff       	call   80099c <_panic>
  LWIP_ASSERT("pcb already closed", (conn->pcb.tcp != NULL));
  80ee9f:	8b 40 08             	mov    0x8(%eax),%eax
  80eea2:	85 c0                	test   %eax,%eax
  80eea4:	75 1c                	jne    80eec2 <do_close_internal+0x8f>
  80eea6:	c7 44 24 08 12 4c 81 	movl   $0x814c12,0x8(%esp)
  80eead:	00 
  80eeae:	c7 44 24 04 56 02 00 	movl   $0x256,0x4(%esp)
  80eeb5:	00 
  80eeb6:	c7 04 24 dd 4b 81 00 	movl   $0x814bdd,(%esp)
  80eebd:	e8 da 1a ff ff       	call   80099c <_panic>

  /* Set back some callback pointers */
  tcp_arg(conn->pcb.tcp, NULL);
  80eec2:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80eec9:	00 
  80eeca:	89 04 24             	mov    %eax,(%esp)
  80eecd:	e8 96 99 ff ff       	call   808868 <tcp_arg>
  if (conn->pcb.tcp->state == LISTEN) {
  80eed2:	8b 43 08             	mov    0x8(%ebx),%eax
  80eed5:	83 78 10 01          	cmpl   $0x1,0x10(%eax)
  80eed9:	75 12                	jne    80eeed <do_close_internal+0xba>
    tcp_accept(conn->pcb.tcp, NULL);
  80eedb:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80eee2:	00 
  80eee3:	89 04 24             	mov    %eax,(%esp)
  80eee6:	e8 be 99 ff ff       	call   8088a9 <tcp_accept>
  80eeeb:	eb 64                	jmp    80ef51 <do_close_internal+0x11e>
  } else {
    tcp_recv(conn->pcb.tcp, NULL);
  80eeed:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80eef4:	00 
  80eef5:	89 04 24             	mov    %eax,(%esp)
  80eef8:	e8 79 99 ff ff       	call   808876 <tcp_recv>
    tcp_accept(conn->pcb.tcp, NULL);
  80eefd:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80ef04:	00 
  80ef05:	8b 43 08             	mov    0x8(%ebx),%eax
  80ef08:	89 04 24             	mov    %eax,(%esp)
  80ef0b:	e8 99 99 ff ff       	call   8088a9 <tcp_accept>
    /* some callbacks have to be reset if tcp_close is not successful */
    tcp_sent(conn->pcb.tcp, NULL);
  80ef10:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80ef17:	00 
  80ef18:	8b 43 08             	mov    0x8(%ebx),%eax
  80ef1b:	89 04 24             	mov    %eax,(%esp)
  80ef1e:	e8 64 99 ff ff       	call   808887 <tcp_sent>
    tcp_poll(conn->pcb.tcp, NULL, 4);
  80ef23:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  80ef2a:	00 
  80ef2b:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80ef32:	00 
  80ef33:	8b 43 08             	mov    0x8(%ebx),%eax
  80ef36:	89 04 24             	mov    %eax,(%esp)
  80ef39:	e8 79 99 ff ff       	call   8088b7 <tcp_poll>
    tcp_err(conn->pcb.tcp, NULL);
  80ef3e:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80ef45:	00 
  80ef46:	8b 43 08             	mov    0x8(%ebx),%eax
  80ef49:	89 04 24             	mov    %eax,(%esp)
  80ef4c:	e8 47 99 ff ff       	call   808898 <tcp_err>
  }
  /* Try to close the connection */
  err = tcp_close(conn->pcb.tcp);
  80ef51:	8b 43 08             	mov    0x8(%ebx),%eax
  80ef54:	89 04 24             	mov    %eax,(%esp)
  80ef57:	e8 ff a7 ff ff       	call   80975b <tcp_close>
  if (err == ERR_OK) {
  80ef5c:	84 c0                	test   %al,%al
  80ef5e:	75 57                	jne    80efb7 <do_close_internal+0x184>
    /* Closing succeeded */
    conn->state = NETCONN_NONE;
  80ef60:	c7 43 04 00 00 00 00 	movl   $0x0,0x4(%ebx)
    /* Set back some callback pointers as conn is going away */
    conn->pcb.tcp = NULL;
  80ef67:	c7 43 08 00 00 00 00 	movl   $0x0,0x8(%ebx)
    conn->err = ERR_OK;
  80ef6e:	c6 43 0c 00          	movb   $0x0,0xc(%ebx)
    /* Trigger select() in socket layer. This send should something else so the
       errorfd is set, not the read and write fd! */
    API_EVENT(conn, NETCONN_EVT_RCVPLUS, 0);
  80ef72:	8b 43 2c             	mov    0x2c(%ebx),%eax
  80ef75:	85 c0                	test   %eax,%eax
  80ef77:	74 31                	je     80efaa <do_close_internal+0x177>
  80ef79:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80ef80:	00 
  80ef81:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80ef88:	00 
  80ef89:	89 1c 24             	mov    %ebx,(%esp)
  80ef8c:	ff d0                	call   *%eax
    API_EVENT(conn, NETCONN_EVT_SENDPLUS, 0);
  80ef8e:	8b 43 2c             	mov    0x2c(%ebx),%eax
  80ef91:	85 c0                	test   %eax,%eax
  80ef93:	74 15                	je     80efaa <do_close_internal+0x177>
  80ef95:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80ef9c:	00 
  80ef9d:	c7 44 24 04 02 00 00 	movl   $0x2,0x4(%esp)
  80efa4:	00 
  80efa5:	89 1c 24             	mov    %ebx,(%esp)
  80efa8:	ff d0                	call   *%eax
    /* wake up the application task */
    sys_sem_signal(conn->op_completed);
  80efaa:	8b 43 10             	mov    0x10(%ebx),%eax
  80efad:	89 04 24             	mov    %eax,(%esp)
  80efb0:	e8 32 ec ff ff       	call   80dbe7 <sys_sem_signal>
  80efb5:	eb 72                	jmp    80f029 <do_close_internal+0x1f6>
  } else {
    /* Closing failed, restore some of the callbacks */
    /* Closing of listen pcb will never fail! */
    LWIP_ASSERT("Closing a listen pcb may not fail!", (conn->pcb.tcp->state != LISTEN));
  80efb7:	8b 43 08             	mov    0x8(%ebx),%eax
  80efba:	83 78 10 01          	cmpl   $0x1,0x10(%eax)
  80efbe:	75 1c                	jne    80efdc <do_close_internal+0x1a9>
  80efc0:	c7 44 24 08 e4 4c 81 	movl   $0x814ce4,0x8(%esp)
  80efc7:	00 
  80efc8:	c7 44 24 04 75 02 00 	movl   $0x275,0x4(%esp)
  80efcf:	00 
  80efd0:	c7 04 24 dd 4b 81 00 	movl   $0x814bdd,(%esp)
  80efd7:	e8 c0 19 ff ff       	call   80099c <_panic>
    tcp_sent(conn->pcb.tcp, sent_tcp);
  80efdc:	c7 44 24 04 fc f2 80 	movl   $0x80f2fc,0x4(%esp)
  80efe3:	00 
  80efe4:	89 04 24             	mov    %eax,(%esp)
  80efe7:	e8 9b 98 ff ff       	call   808887 <tcp_sent>
    tcp_poll(conn->pcb.tcp, poll_tcp, 4);
  80efec:	c7 44 24 08 04 00 00 	movl   $0x4,0x8(%esp)
  80eff3:	00 
  80eff4:	c7 44 24 04 aa f2 80 	movl   $0x80f2aa,0x4(%esp)
  80effb:	00 
  80effc:	8b 43 08             	mov    0x8(%ebx),%eax
  80efff:	89 04 24             	mov    %eax,(%esp)
  80f002:	e8 b0 98 ff ff       	call   8088b7 <tcp_poll>
    tcp_err(conn->pcb.tcp, err_tcp);
  80f007:	c7 44 24 04 68 f0 80 	movl   $0x80f068,0x4(%esp)
  80f00e:	00 
  80f00f:	8b 43 08             	mov    0x8(%ebx),%eax
  80f012:	89 04 24             	mov    %eax,(%esp)
  80f015:	e8 7e 98 ff ff       	call   808898 <tcp_err>
    tcp_arg(conn->pcb.tcp, conn);
  80f01a:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  80f01e:	8b 43 08             	mov    0x8(%ebx),%eax
  80f021:	89 04 24             	mov    %eax,(%esp)
  80f024:	e8 3f 98 ff ff       	call   808868 <tcp_arg>
  }
  /* If closing didn't succeed, we get called again either
     from poll_tcp or from sent_tcp */
}
  80f029:	83 c4 14             	add    $0x14,%esp
  80f02c:	5b                   	pop    %ebx
  80f02d:	5d                   	pop    %ebp
  80f02e:	c3                   	ret    

0080f02f <do_close>:
 *
 * @param msg the api_msg_msg pointing to the connection
 */
void
do_close(struct api_msg_msg *msg)
{
  80f02f:	55                   	push   %ebp
  80f030:	89 e5                	mov    %esp,%ebp
  80f032:	83 ec 18             	sub    $0x18,%esp
  80f035:	8b 55 08             	mov    0x8(%ebp),%edx
#if LWIP_TCP
  if ((msg->conn->pcb.tcp != NULL) && (msg->conn->type == NETCONN_TCP)) {
  80f038:	8b 02                	mov    (%edx),%eax
  80f03a:	83 78 08 00          	cmpl   $0x0,0x8(%eax)
  80f03e:	74 15                	je     80f055 <do_close+0x26>
  80f040:	83 38 10             	cmpl   $0x10,(%eax)
  80f043:	75 10                	jne    80f055 <do_close+0x26>
      msg->conn->state = NETCONN_CLOSE;
  80f045:	c7 40 04 04 00 00 00 	movl   $0x4,0x4(%eax)
      do_close_internal(msg->conn);
  80f04c:	8b 02                	mov    (%edx),%eax
  80f04e:	e8 e0 fd ff ff       	call   80ee33 <do_close_internal>
 */
void
do_close(struct api_msg_msg *msg)
{
#if LWIP_TCP
  if ((msg->conn->pcb.tcp != NULL) && (msg->conn->type == NETCONN_TCP)) {
  80f053:	eb 11                	jmp    80f066 <do_close+0x37>
      do_close_internal(msg->conn);
      /* for tcp netconns, do_close_internal ACKs the message */
  } else
#endif /* LWIP_TCP */
  {
    msg->conn->err = ERR_VAL;
  80f055:	c6 40 0c f7          	movb   $0xf7,0xc(%eax)
    TCPIP_APIMSG_ACK(msg);
  80f059:	8b 02                	mov    (%edx),%eax
  80f05b:	8b 40 10             	mov    0x10(%eax),%eax
  80f05e:	89 04 24             	mov    %eax,(%esp)
  80f061:	e8 81 eb ff ff       	call   80dbe7 <sys_sem_signal>
  }
}
  80f066:	c9                   	leave  
  80f067:	c3                   	ret    

0080f068 <err_tcp>:
 *
 * @see tcp.h (struct tcp_pcb.err) for parameters
 */
static void
err_tcp(void *arg, err_t err)
{
  80f068:	55                   	push   %ebp
  80f069:	89 e5                	mov    %esp,%ebp
  80f06b:	53                   	push   %ebx
  80f06c:	83 ec 14             	sub    $0x14,%esp
  80f06f:	0f b6 45 0c          	movzbl 0xc(%ebp),%eax
  struct netconn *conn;

  conn = arg;
  80f073:	8b 5d 08             	mov    0x8(%ebp),%ebx
  LWIP_ASSERT("conn != NULL", (conn != NULL));
  80f076:	85 db                	test   %ebx,%ebx
  80f078:	75 1c                	jne    80f096 <err_tcp+0x2e>
  80f07a:	c7 44 24 08 25 4c 81 	movl   $0x814c25,0x8(%esp)
  80f081:	00 
  80f082:	c7 44 24 04 22 01 00 	movl   $0x122,0x4(%esp)
  80f089:	00 
  80f08a:	c7 04 24 dd 4b 81 00 	movl   $0x814bdd,(%esp)
  80f091:	e8 06 19 ff ff       	call   80099c <_panic>

  conn->pcb.tcp = NULL;
  80f096:	c7 43 08 00 00 00 00 	movl   $0x0,0x8(%ebx)

  conn->err = err;
  80f09d:	88 43 0c             	mov    %al,0xc(%ebx)
  if (conn->recvmbox != SYS_MBOX_NULL) {
  80f0a0:	83 7b 14 ff          	cmpl   $0xffffffff,0x14(%ebx)
  80f0a4:	74 2f                	je     80f0d5 <err_tcp+0x6d>
    /* Register event with callback */
    API_EVENT(conn, NETCONN_EVT_RCVPLUS, 0);
  80f0a6:	8b 43 2c             	mov    0x2c(%ebx),%eax
  80f0a9:	85 c0                	test   %eax,%eax
  80f0ab:	74 15                	je     80f0c2 <err_tcp+0x5a>
  80f0ad:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80f0b4:	00 
  80f0b5:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80f0bc:	00 
  80f0bd:	89 1c 24             	mov    %ebx,(%esp)
  80f0c0:	ff d0                	call   *%eax
    sys_mbox_post(conn->recvmbox, NULL);
  80f0c2:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80f0c9:	00 
  80f0ca:	8b 43 14             	mov    0x14(%ebx),%eax
  80f0cd:	89 04 24             	mov    %eax,(%esp)
  80f0d0:	e8 90 ed ff ff       	call   80de65 <sys_mbox_post>
  }
  if (conn->op_completed != SYS_SEM_NULL && conn->state == NETCONN_CONNECT) {
  80f0d5:	83 7b 10 ff          	cmpl   $0xffffffff,0x10(%ebx)
  80f0d9:	74 18                	je     80f0f3 <err_tcp+0x8b>
  80f0db:	83 7b 04 03          	cmpl   $0x3,0x4(%ebx)
  80f0df:	75 12                	jne    80f0f3 <err_tcp+0x8b>
    conn->state = NETCONN_NONE;
  80f0e1:	c7 43 04 00 00 00 00 	movl   $0x0,0x4(%ebx)
    sys_sem_signal(conn->op_completed);
  80f0e8:	8b 43 10             	mov    0x10(%ebx),%eax
  80f0eb:	89 04 24             	mov    %eax,(%esp)
  80f0ee:	e8 f4 ea ff ff       	call   80dbe7 <sys_sem_signal>
  }
  if (conn->acceptmbox != SYS_MBOX_NULL) {
  80f0f3:	83 7b 18 ff          	cmpl   $0xffffffff,0x18(%ebx)
  80f0f7:	74 2f                	je     80f128 <err_tcp+0xc0>
    /* Register event with callback */
    API_EVENT(conn, NETCONN_EVT_RCVPLUS, 0);
  80f0f9:	8b 43 2c             	mov    0x2c(%ebx),%eax
  80f0fc:	85 c0                	test   %eax,%eax
  80f0fe:	74 15                	je     80f115 <err_tcp+0xad>
  80f100:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80f107:	00 
  80f108:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80f10f:	00 
  80f110:	89 1c 24             	mov    %ebx,(%esp)
  80f113:	ff d0                	call   *%eax
    sys_mbox_post(conn->acceptmbox, NULL);
  80f115:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80f11c:	00 
  80f11d:	8b 43 18             	mov    0x18(%ebx),%eax
  80f120:	89 04 24             	mov    %eax,(%esp)
  80f123:	e8 3d ed ff ff       	call   80de65 <sys_mbox_post>
  }
  if ((conn->state == NETCONN_WRITE) || (conn->state == NETCONN_CLOSE)) {
  80f128:	8b 43 04             	mov    0x4(%ebx),%eax
  80f12b:	83 f8 01             	cmp    $0x1,%eax
  80f12e:	74 05                	je     80f135 <err_tcp+0xcd>
  80f130:	83 f8 04             	cmp    $0x4,%eax
  80f133:	75 12                	jne    80f147 <err_tcp+0xdf>
    /* calling do_writemore/do_close_internal is not necessary
       since the pcb has already been deleted! */
    conn->state = NETCONN_NONE;
  80f135:	c7 43 04 00 00 00 00 	movl   $0x0,0x4(%ebx)
    /* wake up the waiting task */
    sys_sem_signal(conn->op_completed);
  80f13c:	8b 43 10             	mov    0x10(%ebx),%eax
  80f13f:	89 04 24             	mov    %eax,(%esp)
  80f142:	e8 a0 ea ff ff       	call   80dbe7 <sys_sem_signal>
  }
}
  80f147:	83 c4 14             	add    $0x14,%esp
  80f14a:	5b                   	pop    %ebx
  80f14b:	5d                   	pop    %ebp
  80f14c:	c3                   	ret    

0080f14d <do_writemore>:
 * @return ERR_OK
 *         ERR_MEM if LWIP_TCPIP_CORE_LOCKING=1 and sending hasn't yet finished
 */
static err_t
do_writemore(struct netconn *conn)
{
  80f14d:	55                   	push   %ebp
  80f14e:	89 e5                	mov    %esp,%ebp
  80f150:	57                   	push   %edi
  80f151:	56                   	push   %esi
  80f152:	53                   	push   %ebx
  80f153:	83 ec 2c             	sub    $0x2c,%esp
  80f156:	89 c3                	mov    %eax,%ebx
  err_t err;
  void *dataptr;
  u16_t len, available;
  u8_t write_finished = 0;

  LWIP_ASSERT("conn->state == NETCONN_WRITE", (conn->state == NETCONN_WRITE));
  80f158:	83 78 04 01          	cmpl   $0x1,0x4(%eax)
  80f15c:	74 1c                	je     80f17a <do_writemore+0x2d>
  80f15e:	c7 44 24 08 32 4c 81 	movl   $0x814c32,0x8(%esp)
  80f165:	00 
  80f166:	c7 44 24 04 b8 03 00 	movl   $0x3b8,0x4(%esp)
  80f16d:	00 
  80f16e:	c7 04 24 dd 4b 81 00 	movl   $0x814bdd,(%esp)
  80f175:	e8 22 18 ff ff       	call   80099c <_panic>

  dataptr = (u8_t*)conn->write_msg->msg.w.dataptr + conn->write_offset;
  80f17a:	8b 50 24             	mov    0x24(%eax),%edx
  80f17d:	8b 42 04             	mov    0x4(%edx),%eax
  80f180:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  80f183:	8b 43 28             	mov    0x28(%ebx),%eax
  if ((conn->write_msg->msg.w.len - conn->write_offset > 0xffff)) { /* max_u16_t */
  80f186:	8b 72 08             	mov    0x8(%edx),%esi
  80f189:	89 f1                	mov    %esi,%ecx
  80f18b:	29 c1                	sub    %eax,%ecx
  80f18d:	66 29 c6             	sub    %ax,%si
  80f190:	81 f9 00 00 01 00    	cmp    $0x10000,%ecx
  80f196:	b9 ff ff ff ff       	mov    $0xffffffff,%ecx
  80f19b:	0f 4d f1             	cmovge %ecx,%esi
    conn->write_delayed = 1;
#endif
  } else {
    len = conn->write_msg->msg.w.len - conn->write_offset;
  }
  available = tcp_sndbuf(conn->pcb.tcp);
  80f19e:	8b 4b 08             	mov    0x8(%ebx),%ecx
#if LWIP_TCPIP_CORE_LOCKING
    conn->write_delayed = 1;
#endif
  }

  err = tcp_write(conn->pcb.tcp, dataptr, len, conn->write_msg->msg.w.apiflags);
  80f1a1:	66 3b 71 6e          	cmp    0x6e(%ecx),%si
  80f1a5:	0f b7 79 6e          	movzwl 0x6e(%ecx),%edi
  80f1a9:	0f 47 f7             	cmova  %edi,%esi
  80f1ac:	0f b7 f6             	movzwl %si,%esi
  80f1af:	0f b6 52 0c          	movzbl 0xc(%edx),%edx
  80f1b3:	89 54 24 0c          	mov    %edx,0xc(%esp)
  80f1b7:	89 74 24 08          	mov    %esi,0x8(%esp)
  80f1bb:	03 45 e4             	add    -0x1c(%ebp),%eax
  80f1be:	89 44 24 04          	mov    %eax,0x4(%esp)
  80f1c2:	89 0c 24             	mov    %ecx,(%esp)
  80f1c5:	e8 ef cd ff ff       	call   80bfb9 <tcp_write>
  LWIP_ASSERT("do_writemore: invalid length!", ((conn->write_offset + len) <= conn->write_msg->msg.w.len));
  80f1ca:	89 f2                	mov    %esi,%edx
  80f1cc:	03 53 28             	add    0x28(%ebx),%edx
  80f1cf:	8b 4b 24             	mov    0x24(%ebx),%ecx
  80f1d2:	3b 51 08             	cmp    0x8(%ecx),%edx
  80f1d5:	7e 1c                	jle    80f1f3 <do_writemore+0xa6>
  80f1d7:	c7 44 24 08 4f 4c 81 	movl   $0x814c4f,0x8(%esp)
  80f1de:	00 
  80f1df:	c7 44 24 04 cd 03 00 	movl   $0x3cd,0x4(%esp)
  80f1e6:	00 
  80f1e7:	c7 04 24 dd 4b 81 00 	movl   $0x814bdd,(%esp)
  80f1ee:	e8 a9 17 ff ff       	call   80099c <_panic>
  if (err == ERR_OK) {
  80f1f3:	84 c0                	test   %al,%al
  80f1f5:	75 72                	jne    80f269 <do_writemore+0x11c>
    conn->write_offset += len;
  80f1f7:	89 53 28             	mov    %edx,0x28(%ebx)
    if (conn->write_offset == conn->write_msg->msg.w.len) {
  80f1fa:	8b 43 24             	mov    0x24(%ebx),%eax
  80f1fd:	bf 00 00 00 00       	mov    $0x0,%edi
  80f202:	3b 50 08             	cmp    0x8(%eax),%edx
  80f205:	75 13                	jne    80f21a <do_writemore+0xcd>
      /* everything was written */
      write_finished = 1;
      conn->write_msg = NULL;
  80f207:	c7 43 24 00 00 00 00 	movl   $0x0,0x24(%ebx)
      conn->write_offset = 0;
  80f20e:	c7 43 28 00 00 00 00 	movl   $0x0,0x28(%ebx)
  80f215:	bf 01 00 00 00       	mov    $0x1,%edi
    }
    err = tcp_output_nagle(conn->pcb.tcp);
  80f21a:	8b 43 08             	mov    0x8(%ebx),%eax
  80f21d:	83 78 78 00          	cmpl   $0x0,0x78(%eax)
  80f221:	74 12                	je     80f235 <do_writemore+0xe8>
  80f223:	f6 40 20 40          	testb  $0x40,0x20(%eax)
  80f227:	75 0c                	jne    80f235 <do_writemore+0xe8>
  80f229:	8b 50 74             	mov    0x74(%eax),%edx
  80f22c:	85 d2                	test   %edx,%edx
  80f22e:	74 74                	je     80f2a4 <do_writemore+0x157>
  80f230:	83 3a 00             	cmpl   $0x0,(%edx)
  80f233:	74 6f                	je     80f2a4 <do_writemore+0x157>
  80f235:	89 04 24             	mov    %eax,(%esp)
  80f238:	e8 3e c1 ff ff       	call   80b37b <tcp_output>
    conn->err = err;
  80f23d:	88 43 0c             	mov    %al,0xc(%ebx)
    if ((err == ERR_OK) && (tcp_sndbuf(conn->pcb.tcp) <= TCP_SNDLOWAT)) {
  80f240:	84 c0                	test   %al,%al
  80f242:	75 3b                	jne    80f27f <do_writemore+0x132>
  80f244:	8b 43 08             	mov    0x8(%ebx),%eax
  80f247:	66 81 78 6e a0 2d    	cmpw   $0x2da0,0x6e(%eax)
  80f24d:	77 30                	ja     80f27f <do_writemore+0x132>
      API_EVENT(conn, NETCONN_EVT_SENDMINUS, len);
  80f24f:	8b 43 2c             	mov    0x2c(%ebx),%eax
  80f252:	85 c0                	test   %eax,%eax
  80f254:	74 29                	je     80f27f <do_writemore+0x132>
  80f256:	89 74 24 08          	mov    %esi,0x8(%esp)
  80f25a:	c7 44 24 04 03 00 00 	movl   $0x3,0x4(%esp)
  80f261:	00 
  80f262:	89 1c 24             	mov    %ebx,(%esp)
  80f265:	ff d0                	call   *%eax
  80f267:	eb 16                	jmp    80f27f <do_writemore+0x132>
    }
  } else if (err == ERR_MEM) {
  80f269:	3c ff                	cmp    $0xff,%al
  80f26b:	75 0d                	jne    80f27a <do_writemore+0x12d>
    /* If ERR_MEM, we wait for sent_tcp or poll_tcp to be called
       we do NOT return to the application thread, since ERR_MEM is
       only a temporary error! */

    /* tcp_enqueue returned ERR_MEM, try tcp_output anyway */
    err = tcp_output(conn->pcb.tcp);
  80f26d:	8b 43 08             	mov    0x8(%ebx),%eax
  80f270:	89 04 24             	mov    %eax,(%esp)
  80f273:	e8 03 c1 ff ff       	call   80b37b <tcp_output>
  80f278:	eb 1d                	jmp    80f297 <do_writemore+0x14a>
    conn->write_delayed = 1;
#endif
  } else {
    /* On errors != ERR_MEM, we don't try writing any more but return
       the error to the application thread. */
    conn->err = err;
  80f27a:	88 43 0c             	mov    %al,0xc(%ebx)
  80f27d:	eb 06                	jmp    80f285 <do_writemore+0x138>
    write_finished = 1;
  }

  if (write_finished) {
  80f27f:	89 f8                	mov    %edi,%eax
  80f281:	84 c0                	test   %al,%al
  80f283:	74 12                	je     80f297 <do_writemore+0x14a>
    /* everything was written: set back connection state
       and back to application task */
    conn->state = NETCONN_NONE;
  80f285:	c7 43 04 00 00 00 00 	movl   $0x0,0x4(%ebx)
#if LWIP_TCPIP_CORE_LOCKING
    if (conn->write_delayed != 0)
#endif
    {
      sys_sem_signal(conn->op_completed);
  80f28c:	8b 43 10             	mov    0x10(%ebx),%eax
  80f28f:	89 04 24             	mov    %eax,(%esp)
  80f292:	e8 50 e9 ff ff       	call   80dbe7 <sys_sem_signal>
#if LWIP_TCPIP_CORE_LOCKING
  else
    return ERR_MEM;
#endif
  return ERR_OK;
}
  80f297:	b8 00 00 00 00       	mov    $0x0,%eax
  80f29c:	83 c4 2c             	add    $0x2c,%esp
  80f29f:	5b                   	pop    %ebx
  80f2a0:	5e                   	pop    %esi
  80f2a1:	5f                   	pop    %edi
  80f2a2:	5d                   	pop    %ebp
  80f2a3:	c3                   	ret    
      write_finished = 1;
      conn->write_msg = NULL;
      conn->write_offset = 0;
    }
    err = tcp_output_nagle(conn->pcb.tcp);
    conn->err = err;
  80f2a4:	c6 43 0c 00          	movb   $0x0,0xc(%ebx)
  80f2a8:	eb 9a                	jmp    80f244 <do_writemore+0xf7>

0080f2aa <poll_tcp>:
 *
 * @see tcp.h (struct tcp_pcb.poll) for parameters and return value
 */
static err_t
poll_tcp(void *arg, struct tcp_pcb *pcb)
{
  80f2aa:	55                   	push   %ebp
  80f2ab:	89 e5                	mov    %esp,%ebp
  80f2ad:	83 ec 18             	sub    $0x18,%esp
  struct netconn *conn = arg;
  80f2b0:	8b 45 08             	mov    0x8(%ebp),%eax

  LWIP_UNUSED_ARG(pcb);
  LWIP_ASSERT("conn != NULL", (conn != NULL));
  80f2b3:	85 c0                	test   %eax,%eax
  80f2b5:	75 1c                	jne    80f2d3 <poll_tcp+0x29>
  80f2b7:	c7 44 24 08 25 4c 81 	movl   $0x814c25,0x8(%esp)
  80f2be:	00 
  80f2bf:	c7 44 24 04 eb 00 00 	movl   $0xeb,0x4(%esp)
  80f2c6:	00 
  80f2c7:	c7 04 24 dd 4b 81 00 	movl   $0x814bdd,(%esp)
  80f2ce:	e8 c9 16 ff ff       	call   80099c <_panic>

  if (conn->state == NETCONN_WRITE) {
  80f2d3:	8b 50 04             	mov    0x4(%eax),%edx
  80f2d6:	83 fa 01             	cmp    $0x1,%edx
  80f2d9:	75 07                	jne    80f2e2 <poll_tcp+0x38>
    do_writemore(conn);
  80f2db:	e8 6d fe ff ff       	call   80f14d <do_writemore>
  80f2e0:	eb 13                	jmp    80f2f5 <poll_tcp+0x4b>
  } else if (conn->state == NETCONN_CLOSE) {
  80f2e2:	83 fa 04             	cmp    $0x4,%edx
  80f2e5:	75 0e                	jne    80f2f5 <poll_tcp+0x4b>
    do_close_internal(conn);
  80f2e7:	89 f6                	mov    %esi,%esi
  80f2e9:	8d bc 27 00 00 00 00 	lea    0x0(%edi,%eiz,1),%edi
  80f2f0:	e8 3e fb ff ff       	call   80ee33 <do_close_internal>
  }

  return ERR_OK;
}
  80f2f5:	b8 00 00 00 00       	mov    $0x0,%eax
  80f2fa:	c9                   	leave  
  80f2fb:	c3                   	ret    

0080f2fc <sent_tcp>:
 *
 * @see tcp.h (struct tcp_pcb.sent) for parameters and return value
 */
static err_t
sent_tcp(void *arg, struct tcp_pcb *pcb, u16_t len)
{
  80f2fc:	55                   	push   %ebp
  80f2fd:	89 e5                	mov    %esp,%ebp
  80f2ff:	83 ec 18             	sub    $0x18,%esp
  80f302:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  80f305:	89 75 fc             	mov    %esi,-0x4(%ebp)
  80f308:	0f b7 75 10          	movzwl 0x10(%ebp),%esi
  struct netconn *conn = arg;
  80f30c:	8b 5d 08             	mov    0x8(%ebp),%ebx

  LWIP_UNUSED_ARG(pcb);
  LWIP_ASSERT("conn != NULL", (conn != NULL));
  80f30f:	85 db                	test   %ebx,%ebx
  80f311:	75 1c                	jne    80f32f <sent_tcp+0x33>
  80f313:	c7 44 24 08 25 4c 81 	movl   $0x814c25,0x8(%esp)
  80f31a:	00 
  80f31b:	c7 44 24 04 03 01 00 	movl   $0x103,0x4(%esp)
  80f322:	00 
  80f323:	c7 04 24 dd 4b 81 00 	movl   $0x814bdd,(%esp)
  80f32a:	e8 6d 16 ff ff       	call   80099c <_panic>

  if (conn->state == NETCONN_WRITE) {
  80f32f:	8b 43 04             	mov    0x4(%ebx),%eax
  80f332:	83 f8 01             	cmp    $0x1,%eax
  80f335:	75 2b                	jne    80f362 <sent_tcp+0x66>
    LWIP_ASSERT("conn->pcb.tcp != NULL", conn->pcb.tcp != NULL);
  80f337:	83 7b 08 00          	cmpl   $0x0,0x8(%ebx)
  80f33b:	75 1c                	jne    80f359 <sent_tcp+0x5d>
  80f33d:	c7 44 24 08 6d 4c 81 	movl   $0x814c6d,0x8(%esp)
  80f344:	00 
  80f345:	c7 44 24 04 06 01 00 	movl   $0x106,0x4(%esp)
  80f34c:	00 
  80f34d:	c7 04 24 dd 4b 81 00 	movl   $0x814bdd,(%esp)
  80f354:	e8 43 16 ff ff       	call   80099c <_panic>
    do_writemore(conn);
  80f359:	89 d8                	mov    %ebx,%eax
  80f35b:	e8 ed fd ff ff       	call   80f14d <do_writemore>
  80f360:	eb 13                	jmp    80f375 <sent_tcp+0x79>
  } else if (conn->state == NETCONN_CLOSE) {
  80f362:	83 f8 04             	cmp    $0x4,%eax
  80f365:	75 0e                	jne    80f375 <sent_tcp+0x79>
    do_close_internal(conn);
  80f367:	89 d8                	mov    %ebx,%eax
  80f369:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  80f370:	e8 be fa ff ff       	call   80ee33 <do_close_internal>
  }

  if (conn) {
    if ((conn->pcb.tcp != NULL) && (tcp_sndbuf(conn->pcb.tcp) > TCP_SNDLOWAT)) {
  80f375:	8b 43 08             	mov    0x8(%ebx),%eax
  80f378:	85 c0                	test   %eax,%eax
  80f37a:	74 23                	je     80f39f <sent_tcp+0xa3>
  80f37c:	66 81 78 6e a0 2d    	cmpw   $0x2da0,0x6e(%eax)
  80f382:	76 1b                	jbe    80f39f <sent_tcp+0xa3>
      API_EVENT(conn, NETCONN_EVT_SENDPLUS, len);
  80f384:	8b 43 2c             	mov    0x2c(%ebx),%eax
  80f387:	85 c0                	test   %eax,%eax
  80f389:	74 14                	je     80f39f <sent_tcp+0xa3>
  80f38b:	0f b7 f6             	movzwl %si,%esi
  80f38e:	89 74 24 08          	mov    %esi,0x8(%esp)
  80f392:	c7 44 24 04 02 00 00 	movl   $0x2,0x4(%esp)
  80f399:	00 
  80f39a:	89 1c 24             	mov    %ebx,(%esp)
  80f39d:	ff d0                	call   *%eax
    }
  }
  
  return ERR_OK;
}
  80f39f:	b8 00 00 00 00       	mov    $0x0,%eax
  80f3a4:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  80f3a7:	8b 75 fc             	mov    -0x4(%ebp),%esi
  80f3aa:	89 ec                	mov    %ebp,%esp
  80f3ac:	5d                   	pop    %ebp
  80f3ad:	c3                   	ret    

0080f3ae <do_write>:
 *
 * @param msg the api_msg_msg pointing to the connection
 */
void
do_write(struct api_msg_msg *msg)
{
  80f3ae:	55                   	push   %ebp
  80f3af:	89 e5                	mov    %esp,%ebp
  80f3b1:	83 ec 18             	sub    $0x18,%esp
  80f3b4:	8b 55 08             	mov    0x8(%ebp),%edx
  if (!ERR_IS_FATAL(msg->conn->err)) {
  80f3b7:	8b 02                	mov    (%edx),%eax
  80f3b9:	80 78 0c fc          	cmpb   $0xfc,0xc(%eax)
  80f3bd:	7c 2d                	jl     80f3ec <do_write+0x3e>
    if ((msg->conn->pcb.tcp != NULL) && (msg->conn->type == NETCONN_TCP)) {
  80f3bf:	83 78 08 00          	cmpl   $0x0,0x8(%eax)
  80f3c3:	74 23                	je     80f3e8 <do_write+0x3a>
  80f3c5:	83 38 10             	cmpl   $0x10,(%eax)
  80f3c8:	75 1e                	jne    80f3e8 <do_write+0x3a>
#if LWIP_TCP
      msg->conn->state = NETCONN_WRITE;
  80f3ca:	c7 40 04 01 00 00 00 	movl   $0x1,0x4(%eax)
      /* set all the variables used by do_writemore */
      msg->conn->write_msg = msg;
  80f3d1:	8b 02                	mov    (%edx),%eax
  80f3d3:	89 50 24             	mov    %edx,0x24(%eax)
      msg->conn->write_offset = 0;
  80f3d6:	8b 02                	mov    (%edx),%eax
  80f3d8:	c7 40 28 00 00 00 00 	movl   $0x0,0x28(%eax)
        sys_arch_sem_wait(msg->conn->op_completed, 0);
        LOCK_TCPIP_CORE();
        LWIP_ASSERT("state!", msg->conn->state == NETCONN_NONE);
      }
#else
      do_writemore(msg->conn);
  80f3df:	8b 02                	mov    (%edx),%eax
  80f3e1:	e8 67 fd ff ff       	call   80f14d <do_writemore>
#endif
      /* for both cases: if do_writemore was called, don't ACK the APIMSG! */
      return;
  80f3e6:	eb 11                	jmp    80f3f9 <do_write+0x4b>
#endif /* LWIP_TCP */
#if (LWIP_UDP || LWIP_RAW)
    } else {
      msg->conn->err = ERR_VAL;
  80f3e8:	c6 40 0c f7          	movb   $0xf7,0xc(%eax)
#endif /* (LWIP_UDP || LWIP_RAW) */
    }
  }
  TCPIP_APIMSG_ACK(msg);
  80f3ec:	8b 02                	mov    (%edx),%eax
  80f3ee:	8b 40 10             	mov    0x10(%eax),%eax
  80f3f1:	89 04 24             	mov    %eax,(%esp)
  80f3f4:	e8 ee e7 ff ff       	call   80dbe7 <sys_sem_signal>
}
  80f3f9:	c9                   	leave  
  80f3fa:	c3                   	ret    

0080f3fb <do_recv>:
 *
 * @param msg the api_msg_msg pointing to the connection
 */
void
do_recv(struct api_msg_msg *msg)
{
  80f3fb:	55                   	push   %ebp
  80f3fc:	89 e5                	mov    %esp,%ebp
  80f3fe:	53                   	push   %ebx
  80f3ff:	83 ec 14             	sub    $0x14,%esp
  80f402:	8b 5d 08             	mov    0x8(%ebp),%ebx
#if LWIP_TCP
  if (!ERR_IS_FATAL(msg->conn->err)) {
  80f405:	8b 03                	mov    (%ebx),%eax
  80f407:	80 78 0c fc          	cmpb   $0xfc,0xc(%eax)
  80f40b:	7c 1c                	jl     80f429 <do_recv+0x2e>
    if (msg->conn->pcb.tcp != NULL) {
  80f40d:	8b 50 08             	mov    0x8(%eax),%edx
  80f410:	85 d2                	test   %edx,%edx
  80f412:	74 15                	je     80f429 <do_recv+0x2e>
      if (msg->conn->type == NETCONN_TCP) {
  80f414:	83 38 10             	cmpl   $0x10,(%eax)
  80f417:	75 10                	jne    80f429 <do_recv+0x2e>
        if (msg->conn->pcb.tcp->state == LISTEN) {
          tcp_accepted(msg->conn->pcb.tcp);
        } else
#endif /* TCP_LISTEN_BACKLOG */
        {
          tcp_recved(msg->conn->pcb.tcp, msg->msg.r.len);
  80f419:	0f b7 43 04          	movzwl 0x4(%ebx),%eax
  80f41d:	89 44 24 04          	mov    %eax,0x4(%esp)
  80f421:	89 14 24             	mov    %edx,(%esp)
  80f424:	e8 ee 94 ff ff       	call   808917 <tcp_recved>
        }
      }
    }
  }
#endif /* LWIP_TCP */
  TCPIP_APIMSG_ACK(msg);
  80f429:	8b 03                	mov    (%ebx),%eax
  80f42b:	8b 40 10             	mov    0x10(%eax),%eax
  80f42e:	89 04 24             	mov    %eax,(%esp)
  80f431:	e8 b1 e7 ff ff       	call   80dbe7 <sys_sem_signal>
}
  80f436:	83 c4 14             	add    $0x14,%esp
  80f439:	5b                   	pop    %ebx
  80f43a:	5d                   	pop    %ebp
  80f43b:	c3                   	ret    

0080f43c <do_send>:
 *
 * @param msg the api_msg_msg pointing to the connection
 */
void
do_send(struct api_msg_msg *msg)
{
  80f43c:	55                   	push   %ebp
  80f43d:	89 e5                	mov    %esp,%ebp
  80f43f:	83 ec 28             	sub    $0x28,%esp
  80f442:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  80f445:	89 75 f8             	mov    %esi,-0x8(%ebp)
  80f448:	89 7d fc             	mov    %edi,-0x4(%ebp)
  80f44b:	8b 75 08             	mov    0x8(%ebp),%esi
  if (!ERR_IS_FATAL(msg->conn->err)) {
  80f44e:	8b 1e                	mov    (%esi),%ebx
  80f450:	80 7b 0c fc          	cmpb   $0xfc,0xc(%ebx)
  80f454:	0f 8c 8b 00 00 00    	jl     80f4e5 <do_send+0xa9>
    if (msg->conn->pcb.tcp != NULL) {
  80f45a:	8b 43 08             	mov    0x8(%ebx),%eax
  80f45d:	85 c0                	test   %eax,%eax
  80f45f:	0f 84 80 00 00 00    	je     80f4e5 <do_send+0xa9>
      switch (NETCONNTYPE_GROUP(msg->conn->type)) {
  80f465:	8b 13                	mov    (%ebx),%edx
  80f467:	81 e2 f0 00 00 00    	and    $0xf0,%edx
  80f46d:	83 fa 20             	cmp    $0x20,%edx
  80f470:	74 39                	je     80f4ab <do_send+0x6f>
  80f472:	83 fa 40             	cmp    $0x40,%edx
  80f475:	75 6e                	jne    80f4e5 <do_send+0xa9>
#if LWIP_RAW
      case NETCONN_RAW:
        if (msg->msg.b->addr == NULL) {
  80f477:	8b 56 04             	mov    0x4(%esi),%edx
  80f47a:	8b 4a 08             	mov    0x8(%edx),%ecx
  80f47d:	85 c9                	test   %ecx,%ecx
  80f47f:	75 13                	jne    80f494 <do_send+0x58>
          msg->conn->err = raw_send(msg->conn->pcb.raw, msg->msg.b->p);
  80f481:	8b 12                	mov    (%edx),%edx
  80f483:	89 54 24 04          	mov    %edx,0x4(%esp)
  80f487:	89 04 24             	mov    %eax,(%esp)
  80f48a:	e8 43 27 00 00       	call   811bd2 <raw_send>
  80f48f:	88 43 0c             	mov    %al,0xc(%ebx)
  80f492:	eb 51                	jmp    80f4e5 <do_send+0xa9>
        } else {
          msg->conn->err = raw_sendto(msg->conn->pcb.raw, msg->msg.b->p, msg->msg.b->addr);
  80f494:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  80f498:	8b 12                	mov    (%edx),%edx
  80f49a:	89 54 24 04          	mov    %edx,0x4(%esp)
  80f49e:	89 04 24             	mov    %eax,(%esp)
  80f4a1:	e8 22 26 00 00       	call   811ac8 <raw_sendto>
  80f4a6:	88 43 0c             	mov    %al,0xc(%ebx)
  80f4a9:	eb 3a                	jmp    80f4e5 <do_send+0xa9>
        }
        break;
#endif
#if LWIP_UDP
      case NETCONN_UDP:
        if (msg->msg.b->addr == NULL) {
  80f4ab:	8b 56 04             	mov    0x4(%esi),%edx
  80f4ae:	8b 4a 08             	mov    0x8(%edx),%ecx
  80f4b1:	85 c9                	test   %ecx,%ecx
  80f4b3:	75 13                	jne    80f4c8 <do_send+0x8c>
          msg->conn->err = udp_send(msg->conn->pcb.udp, msg->msg.b->p);
  80f4b5:	8b 12                	mov    (%edx),%edx
  80f4b7:	89 54 24 04          	mov    %edx,0x4(%esp)
  80f4bb:	89 04 24             	mov    %eax,(%esp)
  80f4be:	e8 bc cf ff ff       	call   80c47f <udp_send>
  80f4c3:	88 43 0c             	mov    %al,0xc(%ebx)
  80f4c6:	eb 1d                	jmp    80f4e5 <do_send+0xa9>
        } else {
          msg->conn->err = udp_sendto(msg->conn->pcb.udp, msg->msg.b->p, msg->msg.b->addr, msg->msg.b->port);
  80f4c8:	0f b7 7a 0c          	movzwl 0xc(%edx),%edi
  80f4cc:	89 7c 24 0c          	mov    %edi,0xc(%esp)
  80f4d0:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  80f4d4:	8b 12                	mov    (%edx),%edx
  80f4d6:	89 54 24 04          	mov    %edx,0x4(%esp)
  80f4da:	89 04 24             	mov    %eax,(%esp)
  80f4dd:	e8 4c cf ff ff       	call   80c42e <udp_sendto>
  80f4e2:	88 43 0c             	mov    %al,0xc(%ebx)
      default:
        break;
      }
    }
  }
  TCPIP_APIMSG_ACK(msg);
  80f4e5:	8b 06                	mov    (%esi),%eax
  80f4e7:	8b 40 10             	mov    0x10(%eax),%eax
  80f4ea:	89 04 24             	mov    %eax,(%esp)
  80f4ed:	e8 f5 e6 ff ff       	call   80dbe7 <sys_sem_signal>
}
  80f4f2:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  80f4f5:	8b 75 f8             	mov    -0x8(%ebp),%esi
  80f4f8:	8b 7d fc             	mov    -0x4(%ebp),%edi
  80f4fb:	89 ec                	mov    %ebp,%esp
  80f4fd:	5d                   	pop    %ebp
  80f4fe:	c3                   	ret    

0080f4ff <do_listen>:
 *
 * @param msg the api_msg_msg pointing to the connection
 */
void
do_listen(struct api_msg_msg *msg)
{
  80f4ff:	55                   	push   %ebp
  80f500:	89 e5                	mov    %esp,%ebp
  80f502:	83 ec 28             	sub    $0x28,%esp
  80f505:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  80f508:	89 75 f8             	mov    %esi,-0x8(%ebp)
  80f50b:	89 7d fc             	mov    %edi,-0x4(%ebp)
  80f50e:	8b 5d 08             	mov    0x8(%ebp),%ebx
#if LWIP_TCP
  if (!ERR_IS_FATAL(msg->conn->err)) {
  80f511:	8b 03                	mov    (%ebx),%eax
  80f513:	80 78 0c fc          	cmpb   $0xfc,0xc(%eax)
  80f517:	0f 8c b9 00 00 00    	jl     80f5d6 <do_listen+0xd7>
    if (msg->conn->pcb.tcp != NULL) {
  80f51d:	8b 50 08             	mov    0x8(%eax),%edx
  80f520:	85 d2                	test   %edx,%edx
  80f522:	0f 84 ae 00 00 00    	je     80f5d6 <do_listen+0xd7>
      if (msg->conn->type == NETCONN_TCP) {
  80f528:	83 38 10             	cmpl   $0x10,(%eax)
  80f52b:	0f 85 a5 00 00 00    	jne    80f5d6 <do_listen+0xd7>
        if (msg->conn->pcb.tcp->state == CLOSED) {
  80f531:	83 7a 10 00          	cmpl   $0x0,0x10(%edx)
  80f535:	0f 85 97 00 00 00    	jne    80f5d2 <do_listen+0xd3>
#if TCP_LISTEN_BACKLOG
          struct tcp_pcb* lpcb = tcp_listen_with_backlog(msg->conn->pcb.tcp, msg->msg.lb.backlog);
#else  /* TCP_LISTEN_BACKLOG */
          struct tcp_pcb* lpcb = tcp_listen(msg->conn->pcb.tcp);
  80f53b:	c7 44 24 04 ff 00 00 	movl   $0xff,0x4(%esp)
  80f542:	00 
  80f543:	89 14 24             	mov    %edx,(%esp)
  80f546:	e8 0e 97 ff ff       	call   808c59 <tcp_listen_with_backlog>
  80f54b:	89 c6                	mov    %eax,%esi
#endif /* TCP_LISTEN_BACKLOG */
          if (lpcb == NULL) {
  80f54d:	85 c0                	test   %eax,%eax
  80f54f:	75 08                	jne    80f559 <do_listen+0x5a>
            msg->conn->err = ERR_MEM;
  80f551:	8b 03                	mov    (%ebx),%eax
  80f553:	c6 40 0c ff          	movb   $0xff,0xc(%eax)
  80f557:	eb 7d                	jmp    80f5d6 <do_listen+0xd7>
          } else {
            /* delete the recvmbox and allocate the acceptmbox */
            if (msg->conn->recvmbox != SYS_MBOX_NULL) {
  80f559:	8b 03                	mov    (%ebx),%eax
  80f55b:	8b 40 14             	mov    0x14(%eax),%eax
  80f55e:	83 f8 ff             	cmp    $0xffffffff,%eax
  80f561:	74 11                	je     80f574 <do_listen+0x75>
              /** @todo: should we drain the recvmbox here? */
              sys_mbox_free(msg->conn->recvmbox);
  80f563:	89 04 24             	mov    %eax,(%esp)
  80f566:	e8 a8 e0 ff ff       	call   80d613 <sys_mbox_free>
              msg->conn->recvmbox = SYS_MBOX_NULL;
  80f56b:	8b 03                	mov    (%ebx),%eax
  80f56d:	c7 40 14 ff ff ff ff 	movl   $0xffffffff,0x14(%eax)
            }
            if (msg->conn->acceptmbox == SYS_MBOX_NULL) {
  80f574:	8b 3b                	mov    (%ebx),%edi
  80f576:	83 7f 18 ff          	cmpl   $0xffffffff,0x18(%edi)
  80f57a:	75 1a                	jne    80f596 <do_listen+0x97>
              if ((msg->conn->acceptmbox = sys_mbox_new(DEFAULT_ACCEPTMBOX_SIZE)) == SYS_MBOX_NULL) {
  80f57c:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80f583:	e8 47 e5 ff ff       	call   80dacf <sys_mbox_new>
  80f588:	89 47 18             	mov    %eax,0x18(%edi)
  80f58b:	83 f8 ff             	cmp    $0xffffffff,%eax
  80f58e:	75 06                	jne    80f596 <do_listen+0x97>
                msg->conn->err = ERR_MEM;
  80f590:	8b 03                	mov    (%ebx),%eax
  80f592:	c6 40 0c ff          	movb   $0xff,0xc(%eax)
              }
            }
            if (msg->conn->err == ERR_OK) {
  80f596:	8b 03                	mov    (%ebx),%eax
  80f598:	80 78 0c 00          	cmpb   $0x0,0xc(%eax)
  80f59c:	75 38                	jne    80f5d6 <do_listen+0xd7>
              msg->conn->state = NETCONN_LISTEN;
  80f59e:	c7 40 04 02 00 00 00 	movl   $0x2,0x4(%eax)
              msg->conn->pcb.tcp = lpcb;
  80f5a5:	8b 03                	mov    (%ebx),%eax
  80f5a7:	89 70 08             	mov    %esi,0x8(%eax)
              tcp_arg(msg->conn->pcb.tcp, msg->conn);
  80f5aa:	8b 03                	mov    (%ebx),%eax
  80f5ac:	89 44 24 04          	mov    %eax,0x4(%esp)
  80f5b0:	8b 40 08             	mov    0x8(%eax),%eax
  80f5b3:	89 04 24             	mov    %eax,(%esp)
  80f5b6:	e8 ad 92 ff ff       	call   808868 <tcp_arg>
              tcp_accept(msg->conn->pcb.tcp, accept_function);
  80f5bb:	c7 44 24 04 d4 fb 80 	movl   $0x80fbd4,0x4(%esp)
  80f5c2:	00 
  80f5c3:	8b 03                	mov    (%ebx),%eax
  80f5c5:	8b 40 08             	mov    0x8(%eax),%eax
  80f5c8:	89 04 24             	mov    %eax,(%esp)
  80f5cb:	e8 d9 92 ff ff       	call   8088a9 <tcp_accept>
  80f5d0:	eb 04                	jmp    80f5d6 <do_listen+0xd7>
            }
          }
        } else {
          msg->conn->err = ERR_CONN;
  80f5d2:	c6 40 0c f8          	movb   $0xf8,0xc(%eax)
        }
      }
    }
  }
#endif /* LWIP_TCP */
  TCPIP_APIMSG_ACK(msg);
  80f5d6:	8b 03                	mov    (%ebx),%eax
  80f5d8:	8b 40 10             	mov    0x10(%eax),%eax
  80f5db:	89 04 24             	mov    %eax,(%esp)
  80f5de:	e8 04 e6 ff ff       	call   80dbe7 <sys_sem_signal>
}
  80f5e3:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  80f5e6:	8b 75 f8             	mov    -0x8(%ebp),%esi
  80f5e9:	8b 7d fc             	mov    -0x4(%ebp),%edi
  80f5ec:	89 ec                	mov    %ebp,%esp
  80f5ee:	5d                   	pop    %ebp
  80f5ef:	c3                   	ret    

0080f5f0 <recv_tcp>:
 *
 * @see tcp.h (struct tcp_pcb.recv) for parameters and return value
 */
static err_t
recv_tcp(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
{
  80f5f0:	55                   	push   %ebp
  80f5f1:	89 e5                	mov    %esp,%ebp
  80f5f3:	83 ec 18             	sub    $0x18,%esp
  80f5f6:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  80f5f9:	89 75 fc             	mov    %esi,-0x4(%ebp)
  80f5fc:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80f5ff:	8b 45 0c             	mov    0xc(%ebp),%eax
  80f602:	8b 75 10             	mov    0x10(%ebp),%esi
  80f605:	0f b6 55 14          	movzbl 0x14(%ebp),%edx
  struct netconn *conn;
  u16_t len;

  LWIP_UNUSED_ARG(pcb);
  LWIP_ASSERT("recv_tcp must have a pcb argument", pcb != NULL);
  80f609:	85 c0                	test   %eax,%eax
  80f60b:	75 1c                	jne    80f629 <recv_tcp+0x39>
  80f60d:	c7 44 24 08 08 4d 81 	movl   $0x814d08,0x8(%esp)
  80f614:	00 
  80f615:	c7 44 24 04 c1 00 00 	movl   $0xc1,0x4(%esp)
  80f61c:	00 
  80f61d:	c7 04 24 dd 4b 81 00 	movl   $0x814bdd,(%esp)
  80f624:	e8 73 13 ff ff       	call   80099c <_panic>
  LWIP_ASSERT("recv_tcp must have an argument", arg != NULL);
  80f629:	85 db                	test   %ebx,%ebx
  80f62b:	75 1c                	jne    80f649 <recv_tcp+0x59>
  80f62d:	c7 44 24 08 2c 4d 81 	movl   $0x814d2c,0x8(%esp)
  80f634:	00 
  80f635:	c7 44 24 04 c2 00 00 	movl   $0xc2,0x4(%esp)
  80f63c:	00 
  80f63d:	c7 04 24 dd 4b 81 00 	movl   $0x814bdd,(%esp)
  80f644:	e8 53 13 ff ff       	call   80099c <_panic>
  conn = arg;
  LWIP_ASSERT("recv_tcp: recv for wrong pcb!", conn->pcb.tcp == pcb);
  80f649:	39 43 08             	cmp    %eax,0x8(%ebx)
  80f64c:	74 1c                	je     80f66a <recv_tcp+0x7a>
  80f64e:	c7 44 24 08 83 4c 81 	movl   $0x814c83,0x8(%esp)
  80f655:	00 
  80f656:	c7 44 24 04 c4 00 00 	movl   $0xc4,0x4(%esp)
  80f65d:	00 
  80f65e:	c7 04 24 dd 4b 81 00 	movl   $0x814bdd,(%esp)
  80f665:	e8 32 13 ff ff       	call   80099c <_panic>

  if ((conn == NULL) || (conn->recvmbox == SYS_MBOX_NULL)) {
  80f66a:	85 db                	test   %ebx,%ebx
  80f66c:	74 4c                	je     80f6ba <recv_tcp+0xca>
  80f66e:	83 7b 14 ff          	cmpl   $0xffffffff,0x14(%ebx)
  80f672:	74 46                	je     80f6ba <recv_tcp+0xca>
    return ERR_VAL;
  }

  conn->err = err;
  80f674:	88 53 0c             	mov    %dl,0xc(%ebx)
  if (p != NULL) {
  80f677:	b8 00 00 00 00       	mov    $0x0,%eax
  80f67c:	85 f6                	test   %esi,%esi
  80f67e:	74 08                	je     80f688 <recv_tcp+0x98>
    len = p->tot_len;
  80f680:	0f b7 46 08          	movzwl 0x8(%esi),%eax
    SYS_ARCH_INC(conn->recv_avail, len);
  80f684:	66 01 43 20          	add    %ax,0x20(%ebx)
  } else {
    len = 0;
  }
  /* Register event with callback */
  API_EVENT(conn, NETCONN_EVT_RCVPLUS, len);
  80f688:	8b 53 2c             	mov    0x2c(%ebx),%edx
  80f68b:	85 d2                	test   %edx,%edx
  80f68d:	74 14                	je     80f6a3 <recv_tcp+0xb3>
  80f68f:	0f b7 c0             	movzwl %ax,%eax
  80f692:	89 44 24 08          	mov    %eax,0x8(%esp)
  80f696:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80f69d:	00 
  80f69e:	89 1c 24             	mov    %ebx,(%esp)
  80f6a1:	ff d2                	call   *%edx
  if (sys_mbox_trypost(conn->recvmbox, p) != ERR_OK) {
  80f6a3:	89 74 24 04          	mov    %esi,0x4(%esp)
  80f6a7:	8b 43 14             	mov    0x14(%ebx),%eax
  80f6aa:	89 04 24             	mov    %eax,(%esp)
  80f6ad:	e8 e5 e6 ff ff       	call   80dd97 <sys_mbox_trypost>
  80f6b2:	3c 01                	cmp    $0x1,%al
  80f6b4:	19 c0                	sbb    %eax,%eax
  80f6b6:	f7 d0                	not    %eax
  80f6b8:	eb 05                	jmp    80f6bf <recv_tcp+0xcf>
  80f6ba:	b8 f7 ff ff ff       	mov    $0xfffffff7,%eax
    return ERR_MEM;
  }

  return ERR_OK;
}
  80f6bf:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  80f6c2:	8b 75 fc             	mov    -0x4(%ebp),%esi
  80f6c5:	89 ec                	mov    %ebp,%esp
  80f6c7:	5d                   	pop    %ebp
  80f6c8:	c3                   	ret    

0080f6c9 <do_disconnect>:
 *
 * @param msg the api_msg_msg pointing to the connection to disconnect
 */
void
do_disconnect(struct api_msg_msg *msg)
{
  80f6c9:	55                   	push   %ebp
  80f6ca:	89 e5                	mov    %esp,%ebp
  80f6cc:	53                   	push   %ebx
  80f6cd:	83 ec 14             	sub    $0x14,%esp
  80f6d0:	8b 5d 08             	mov    0x8(%ebp),%ebx
#if LWIP_UDP
  if (NETCONNTYPE_GROUP(msg->conn->type) == NETCONN_UDP) {
  80f6d3:	8b 03                	mov    (%ebx),%eax
  80f6d5:	8b 10                	mov    (%eax),%edx
  80f6d7:	81 e2 f0 00 00 00    	and    $0xf0,%edx
  80f6dd:	83 fa 20             	cmp    $0x20,%edx
  80f6e0:	75 0b                	jne    80f6ed <do_disconnect+0x24>
    udp_disconnect(msg->conn->pcb.udp);
  80f6e2:	8b 40 08             	mov    0x8(%eax),%eax
  80f6e5:	89 04 24             	mov    %eax,(%esp)
  80f6e8:	e8 93 c9 ff ff       	call   80c080 <udp_disconnect>
  }
#endif /* LWIP_UDP */
  TCPIP_APIMSG_ACK(msg);
  80f6ed:	8b 03                	mov    (%ebx),%eax
  80f6ef:	8b 40 10             	mov    0x10(%eax),%eax
  80f6f2:	89 04 24             	mov    %eax,(%esp)
  80f6f5:	e8 ed e4 ff ff       	call   80dbe7 <sys_sem_signal>
}
  80f6fa:	83 c4 14             	add    $0x14,%esp
  80f6fd:	5b                   	pop    %ebx
  80f6fe:	5d                   	pop    %ebp
  80f6ff:	c3                   	ret    

0080f700 <do_connect>:
 * @param msg the api_msg_msg pointing to the connection and containing
 *            the IP address and port to connect to
 */
void
do_connect(struct api_msg_msg *msg)
{
  80f700:	55                   	push   %ebp
  80f701:	89 e5                	mov    %esp,%ebp
  80f703:	56                   	push   %esi
  80f704:	53                   	push   %ebx
  80f705:	83 ec 10             	sub    $0x10,%esp
  80f708:	8b 75 08             	mov    0x8(%ebp),%esi
  if (msg->conn->pcb.tcp == NULL) {
  80f70b:	8b 1e                	mov    (%esi),%ebx
  80f70d:	8b 53 08             	mov    0x8(%ebx),%edx
  80f710:	85 d2                	test   %edx,%edx
  80f712:	75 10                	jne    80f724 <do_connect+0x24>
    sys_sem_signal(msg->conn->op_completed);
  80f714:	8b 43 10             	mov    0x10(%ebx),%eax
  80f717:	89 04 24             	mov    %eax,(%esp)
  80f71a:	e8 c8 e4 ff ff       	call   80dbe7 <sys_sem_signal>
    return;
  80f71f:	e9 9d 00 00 00       	jmp    80f7c1 <do_connect+0xc1>
  }

  switch (NETCONNTYPE_GROUP(msg->conn->type)) {
  80f724:	8b 03                	mov    (%ebx),%eax
  80f726:	25 f0 00 00 00       	and    $0xf0,%eax
  80f72b:	83 f8 20             	cmp    $0x20,%eax
  80f72e:	74 33                	je     80f763 <do_connect+0x63>
  80f730:	83 f8 40             	cmp    $0x40,%eax
  80f733:	74 0d                	je     80f742 <do_connect+0x42>
  80f735:	83 f8 10             	cmp    $0x10,%eax
  80f738:	0f 85 83 00 00 00    	jne    80f7c1 <do_connect+0xc1>
  80f73e:	66 90                	xchg   %ax,%ax
  80f740:	eb 4a                	jmp    80f78c <do_connect+0x8c>
#if LWIP_RAW
  case NETCONN_RAW:
    msg->conn->err = raw_connect(msg->conn->pcb.raw, msg->msg.bc.ipaddr);
  80f742:	8b 46 04             	mov    0x4(%esi),%eax
  80f745:	89 44 24 04          	mov    %eax,0x4(%esp)
  80f749:	89 14 24             	mov    %edx,(%esp)
  80f74c:	e8 9c 22 00 00       	call   8119ed <raw_connect>
  80f751:	88 43 0c             	mov    %al,0xc(%ebx)
    sys_sem_signal(msg->conn->op_completed);
  80f754:	8b 06                	mov    (%esi),%eax
  80f756:	8b 40 10             	mov    0x10(%eax),%eax
  80f759:	89 04 24             	mov    %eax,(%esp)
  80f75c:	e8 86 e4 ff ff       	call   80dbe7 <sys_sem_signal>
    break;
  80f761:	eb 5e                	jmp    80f7c1 <do_connect+0xc1>
#endif /* LWIP_RAW */
#if LWIP_UDP
  case NETCONN_UDP:
    msg->conn->err = udp_connect(msg->conn->pcb.udp, msg->msg.bc.ipaddr, msg->msg.bc.port);
  80f763:	0f b7 46 08          	movzwl 0x8(%esi),%eax
  80f767:	89 44 24 08          	mov    %eax,0x8(%esp)
  80f76b:	8b 46 04             	mov    0x4(%esi),%eax
  80f76e:	89 44 24 04          	mov    %eax,0x4(%esp)
  80f772:	89 14 24             	mov    %edx,(%esp)
  80f775:	e8 84 ca ff ff       	call   80c1fe <udp_connect>
  80f77a:	88 43 0c             	mov    %al,0xc(%ebx)
    sys_sem_signal(msg->conn->op_completed);
  80f77d:	8b 06                	mov    (%esi),%eax
  80f77f:	8b 40 10             	mov    0x10(%eax),%eax
  80f782:	89 04 24             	mov    %eax,(%esp)
  80f785:	e8 5d e4 ff ff       	call   80dbe7 <sys_sem_signal>
    break;
  80f78a:	eb 35                	jmp    80f7c1 <do_connect+0xc1>
#endif /* LWIP_UDP */
#if LWIP_TCP
  case NETCONN_TCP:
    msg->conn->state = NETCONN_CONNECT;
  80f78c:	c7 43 04 03 00 00 00 	movl   $0x3,0x4(%ebx)
    setup_tcp(msg->conn);
  80f793:	8b 06                	mov    (%esi),%eax
  80f795:	e8 ee f5 ff ff       	call   80ed88 <setup_tcp>
    msg->conn->err = tcp_connect(msg->conn->pcb.tcp, msg->msg.bc.ipaddr, msg->msg.bc.port,
  80f79a:	8b 1e                	mov    (%esi),%ebx
  80f79c:	c7 44 24 0c ec ed 80 	movl   $0x80edec,0xc(%esp)
  80f7a3:	00 
  80f7a4:	0f b7 46 08          	movzwl 0x8(%esi),%eax
  80f7a8:	89 44 24 08          	mov    %eax,0x8(%esp)
  80f7ac:	8b 46 04             	mov    0x4(%esi),%eax
  80f7af:	89 44 24 04          	mov    %eax,0x4(%esp)
  80f7b3:	8b 43 08             	mov    0x8(%ebx),%eax
  80f7b6:	89 04 24             	mov    %eax,(%esp)
  80f7b9:	e8 e5 96 ff ff       	call   808ea3 <tcp_connect>
  80f7be:	88 43 0c             	mov    %al,0xc(%ebx)
    break;
#endif /* LWIP_TCP */
  default:
    break;
  }
}
  80f7c1:	83 c4 10             	add    $0x10,%esp
  80f7c4:	5b                   	pop    %ebx
  80f7c5:	5e                   	pop    %esi
  80f7c6:	5d                   	pop    %ebp
  80f7c7:	c3                   	ret    

0080f7c8 <do_bind>:
 * @param msg the api_msg_msg pointing to the connection and containing
 *            the IP address and port to bind to
 */
void
do_bind(struct api_msg_msg *msg)
{
  80f7c8:	55                   	push   %ebp
  80f7c9:	89 e5                	mov    %esp,%ebp
  80f7cb:	83 ec 18             	sub    $0x18,%esp
  80f7ce:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  80f7d1:	89 75 fc             	mov    %esi,-0x4(%ebp)
  80f7d4:	8b 75 08             	mov    0x8(%ebp),%esi
  if (!ERR_IS_FATAL(msg->conn->err)) {
  80f7d7:	8b 1e                	mov    (%esi),%ebx
  80f7d9:	80 7b 0c fc          	cmpb   $0xfc,0xc(%ebx)
  80f7dd:	7c 73                	jl     80f852 <do_bind+0x8a>
    if (msg->conn->pcb.tcp != NULL) {
  80f7df:	8b 53 08             	mov    0x8(%ebx),%edx
  80f7e2:	85 d2                	test   %edx,%edx
  80f7e4:	74 68                	je     80f84e <do_bind+0x86>
      switch (NETCONNTYPE_GROUP(msg->conn->type)) {
  80f7e6:	8b 03                	mov    (%ebx),%eax
  80f7e8:	25 f0 00 00 00       	and    $0xf0,%eax
  80f7ed:	83 f8 20             	cmp    $0x20,%eax
  80f7f0:	74 24                	je     80f816 <do_bind+0x4e>
  80f7f2:	83 f8 40             	cmp    $0x40,%eax
  80f7f5:	74 0b                	je     80f802 <do_bind+0x3a>
  80f7f7:	83 f8 10             	cmp    $0x10,%eax
  80f7fa:	75 56                	jne    80f852 <do_bind+0x8a>
  80f7fc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  80f800:	eb 30                	jmp    80f832 <do_bind+0x6a>
#if LWIP_RAW
      case NETCONN_RAW:
        msg->conn->err = raw_bind(msg->conn->pcb.raw, msg->msg.bc.ipaddr);
  80f802:	8b 46 04             	mov    0x4(%esi),%eax
  80f805:	89 44 24 04          	mov    %eax,0x4(%esp)
  80f809:	89 14 24             	mov    %edx,(%esp)
  80f80c:	e8 bf 21 00 00       	call   8119d0 <raw_bind>
  80f811:	88 43 0c             	mov    %al,0xc(%ebx)
        break;
  80f814:	eb 3c                	jmp    80f852 <do_bind+0x8a>
#endif /* LWIP_RAW */
#if LWIP_UDP
      case NETCONN_UDP:
        msg->conn->err = udp_bind(msg->conn->pcb.udp, msg->msg.bc.ipaddr, msg->msg.bc.port);
  80f816:	0f b7 46 08          	movzwl 0x8(%esi),%eax
  80f81a:	89 44 24 08          	mov    %eax,0x8(%esp)
  80f81e:	8b 46 04             	mov    0x4(%esi),%eax
  80f821:	89 44 24 04          	mov    %eax,0x4(%esp)
  80f825:	89 14 24             	mov    %edx,(%esp)
  80f828:	e8 0b c9 ff ff       	call   80c138 <udp_bind>
  80f82d:	88 43 0c             	mov    %al,0xc(%ebx)
        break;
  80f830:	eb 20                	jmp    80f852 <do_bind+0x8a>
#endif /* LWIP_UDP */
#if LWIP_TCP
      case NETCONN_TCP:
        msg->conn->err = tcp_bind(msg->conn->pcb.tcp, msg->msg.bc.ipaddr, msg->msg.bc.port);
  80f832:	0f b7 46 08          	movzwl 0x8(%esi),%eax
  80f836:	89 44 24 08          	mov    %eax,0x8(%esp)
  80f83a:	8b 46 04             	mov    0x4(%esi),%eax
  80f83d:	89 44 24 04          	mov    %eax,0x4(%esp)
  80f841:	89 14 24             	mov    %edx,(%esp)
  80f844:	e8 15 95 ff ff       	call   808d5e <tcp_bind>
  80f849:	88 43 0c             	mov    %al,0xc(%ebx)
  80f84c:	eb 04                	jmp    80f852 <do_bind+0x8a>
      default:
        break;
      }
    } else {
      /* msg->conn->pcb is NULL */
      msg->conn->err = ERR_VAL;
  80f84e:	c6 43 0c f7          	movb   $0xf7,0xc(%ebx)
    }
  }
  TCPIP_APIMSG_ACK(msg);
  80f852:	8b 06                	mov    (%esi),%eax
  80f854:	8b 40 10             	mov    0x10(%eax),%eax
  80f857:	89 04 24             	mov    %eax,(%esp)
  80f85a:	e8 88 e3 ff ff       	call   80dbe7 <sys_sem_signal>
}
  80f85f:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  80f862:	8b 75 fc             	mov    -0x4(%ebp),%esi
  80f865:	89 ec                	mov    %ebp,%esp
  80f867:	5d                   	pop    %ebp
  80f868:	c3                   	ret    

0080f869 <do_delconn>:
 *
 * @param msg the api_msg_msg pointing to the connection
 */
void
do_delconn(struct api_msg_msg *msg)
{
  80f869:	55                   	push   %ebp
  80f86a:	89 e5                	mov    %esp,%ebp
  80f86c:	53                   	push   %ebx
  80f86d:	83 ec 14             	sub    $0x14,%esp
  80f870:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if (msg->conn->pcb.tcp != NULL) {
  80f873:	8b 03                	mov    (%ebx),%eax
  80f875:	8b 48 08             	mov    0x8(%eax),%ecx
  80f878:	85 c9                	test   %ecx,%ecx
  80f87a:	74 51                	je     80f8cd <do_delconn+0x64>
    switch (NETCONNTYPE_GROUP(msg->conn->type)) {
  80f87c:	8b 10                	mov    (%eax),%edx
  80f87e:	81 e2 f0 00 00 00    	and    $0xf0,%edx
  80f884:	83 fa 20             	cmp    $0x20,%edx
  80f887:	74 1e                	je     80f8a7 <do_delconn+0x3e>
  80f889:	83 fa 40             	cmp    $0x40,%edx
  80f88c:	74 0c                	je     80f89a <do_delconn+0x31>
  80f88e:	83 fa 10             	cmp    $0x10,%edx
  80f891:	75 3a                	jne    80f8cd <do_delconn+0x64>
  80f893:	90                   	nop
  80f894:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  80f898:	eb 23                	jmp    80f8bd <do_delconn+0x54>
#if LWIP_RAW
    case NETCONN_RAW:
      raw_remove(msg->conn->pcb.raw);
  80f89a:	89 0c 24             	mov    %ecx,(%esp)
  80f89d:	8d 76 00             	lea    0x0(%esi),%esi
  80f8a0:	e8 d7 21 00 00       	call   811a7c <raw_remove>
      break;
  80f8a5:	eb 26                	jmp    80f8cd <do_delconn+0x64>
#endif /* LWIP_RAW */
#if LWIP_UDP
    case NETCONN_UDP:
      msg->conn->pcb.udp->recv_arg = NULL;
  80f8a7:	c7 41 1c 00 00 00 00 	movl   $0x0,0x1c(%ecx)
      udp_remove(msg->conn->pcb.udp);
  80f8ae:	8b 03                	mov    (%ebx),%eax
  80f8b0:	8b 40 08             	mov    0x8(%eax),%eax
  80f8b3:	89 04 24             	mov    %eax,(%esp)
  80f8b6:	e8 31 c8 ff ff       	call   80c0ec <udp_remove>
      break;
  80f8bb:	eb 10                	jmp    80f8cd <do_delconn+0x64>
#endif /* LWIP_UDP */
#if LWIP_TCP
    case NETCONN_TCP:
      msg->conn->state = NETCONN_CLOSE;
  80f8bd:	c7 40 04 04 00 00 00 	movl   $0x4,0x4(%eax)
      do_close_internal(msg->conn);
  80f8c4:	8b 03                	mov    (%ebx),%eax
  80f8c6:	e8 68 f5 ff ff       	call   80ee33 <do_close_internal>
      /* API_EVENT is called inside do_close_internal, before releasing
         the application thread, so we can return at this point! */
      return;
  80f8cb:	eb 4e                	jmp    80f91b <do_delconn+0xb2>
  }
  /* tcp netconns don't come here! */

  /* Trigger select() in socket layer. This send should something else so the
     errorfd is set, not the read and write fd! */
  API_EVENT(msg->conn, NETCONN_EVT_RCVPLUS, 0);
  80f8cd:	8b 13                	mov    (%ebx),%edx
  80f8cf:	8b 42 2c             	mov    0x2c(%edx),%eax
  80f8d2:	85 c0                	test   %eax,%eax
  80f8d4:	74 33                	je     80f909 <do_delconn+0xa0>
  80f8d6:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80f8dd:	00 
  80f8de:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80f8e5:	00 
  80f8e6:	89 14 24             	mov    %edx,(%esp)
  80f8e9:	ff d0                	call   *%eax
  API_EVENT(msg->conn, NETCONN_EVT_SENDPLUS, 0);
  80f8eb:	8b 13                	mov    (%ebx),%edx
  80f8ed:	8b 42 2c             	mov    0x2c(%edx),%eax
  80f8f0:	85 c0                	test   %eax,%eax
  80f8f2:	74 15                	je     80f909 <do_delconn+0xa0>
  80f8f4:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80f8fb:	00 
  80f8fc:	c7 44 24 04 02 00 00 	movl   $0x2,0x4(%esp)
  80f903:	00 
  80f904:	89 14 24             	mov    %edx,(%esp)
  80f907:	ff d0                	call   *%eax

  if (msg->conn->op_completed != SYS_SEM_NULL) {
  80f909:	8b 03                	mov    (%ebx),%eax
  80f90b:	8b 40 10             	mov    0x10(%eax),%eax
  80f90e:	83 f8 ff             	cmp    $0xffffffff,%eax
  80f911:	74 08                	je     80f91b <do_delconn+0xb2>
    sys_sem_signal(msg->conn->op_completed);
  80f913:	89 04 24             	mov    %eax,(%esp)
  80f916:	e8 cc e2 ff ff       	call   80dbe7 <sys_sem_signal>
  }
}
  80f91b:	83 c4 14             	add    $0x14,%esp
  80f91e:	5b                   	pop    %ebx
  80f91f:	5d                   	pop    %ebp
  80f920:	c3                   	ret    

0080f921 <netconn_free>:
 *
 * @param conn the netconn to free
 */
void
netconn_free(struct netconn *conn)
{
  80f921:	55                   	push   %ebp
  80f922:	89 e5                	mov    %esp,%ebp
  80f924:	56                   	push   %esi
  80f925:	53                   	push   %ebx
  80f926:	83 ec 20             	sub    $0x20,%esp
  80f929:	8b 5d 08             	mov    0x8(%ebp),%ebx
  void *mem;
  LWIP_ASSERT("PCB must be deallocated outside this function", conn->pcb.tcp == NULL);
  80f92c:	83 7b 08 00          	cmpl   $0x0,0x8(%ebx)
  80f930:	74 1c                	je     80f94e <netconn_free+0x2d>
  80f932:	c7 44 24 08 4c 4d 81 	movl   $0x814d4c,0x8(%esp)
  80f939:	00 
  80f93a:	c7 44 24 04 26 02 00 	movl   $0x226,0x4(%esp)
  80f941:	00 
  80f942:	c7 04 24 dd 4b 81 00 	movl   $0x814bdd,(%esp)
  80f949:	e8 4e 10 ff ff       	call   80099c <_panic>

  /* Drain the recvmbox. */
  if (conn->recvmbox != SYS_MBOX_NULL) {
    while (sys_mbox_tryfetch(conn->recvmbox, &mem) != SYS_MBOX_EMPTY) {
  80f94e:	8d 75 f4             	lea    -0xc(%ebp),%esi
{
  void *mem;
  LWIP_ASSERT("PCB must be deallocated outside this function", conn->pcb.tcp == NULL);

  /* Drain the recvmbox. */
  if (conn->recvmbox != SYS_MBOX_NULL) {
  80f951:	83 7b 14 ff          	cmpl   $0xffffffff,0x14(%ebx)
  80f955:	75 27                	jne    80f97e <netconn_free+0x5d>
  80f957:	eb 4b                	jmp    80f9a4 <netconn_free+0x83>
    while (sys_mbox_tryfetch(conn->recvmbox, &mem) != SYS_MBOX_EMPTY) {
      if (conn->type == NETCONN_TCP) {
  80f959:	83 3b 10             	cmpl   $0x10,(%ebx)
  80f95c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  80f960:	75 11                	jne    80f973 <netconn_free+0x52>
        if(mem != NULL) {
  80f962:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80f965:	85 c0                	test   %eax,%eax
  80f967:	74 15                	je     80f97e <netconn_free+0x5d>
          pbuf_free((struct pbuf *)mem);
  80f969:	89 04 24             	mov    %eax,(%esp)
  80f96c:	e8 8c 85 ff ff       	call   807efd <pbuf_free>
  80f971:	eb 0b                	jmp    80f97e <netconn_free+0x5d>
        }
      } else {
        netbuf_delete((struct netbuf *)mem);
  80f973:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80f976:	89 04 24             	mov    %eax,(%esp)
  80f979:	e8 a0 5c ff ff       	call   80561e <netbuf_delete>
  void *mem;
  LWIP_ASSERT("PCB must be deallocated outside this function", conn->pcb.tcp == NULL);

  /* Drain the recvmbox. */
  if (conn->recvmbox != SYS_MBOX_NULL) {
    while (sys_mbox_tryfetch(conn->recvmbox, &mem) != SYS_MBOX_EMPTY) {
  80f97e:	89 74 24 04          	mov    %esi,0x4(%esp)
  80f982:	8b 43 14             	mov    0x14(%ebx),%eax
  80f985:	89 04 24             	mov    %eax,(%esp)
  80f988:	e8 e8 e3 ff ff       	call   80dd75 <sys_arch_mbox_tryfetch>
  80f98d:	83 f8 ff             	cmp    $0xffffffff,%eax
  80f990:	75 c7                	jne    80f959 <netconn_free+0x38>
        }
      } else {
        netbuf_delete((struct netbuf *)mem);
      }
    }
    sys_mbox_free(conn->recvmbox);
  80f992:	8b 43 14             	mov    0x14(%ebx),%eax
  80f995:	89 04 24             	mov    %eax,(%esp)
  80f998:	e8 76 dc ff ff       	call   80d613 <sys_mbox_free>
    conn->recvmbox = SYS_MBOX_NULL;
  80f99d:	c7 43 14 ff ff ff ff 	movl   $0xffffffff,0x14(%ebx)
  }

  /* Drain the acceptmbox. */
  if (conn->acceptmbox != SYS_MBOX_NULL) {
    while (sys_mbox_tryfetch(conn->acceptmbox, &mem) != SYS_MBOX_EMPTY) {
  80f9a4:	8d 75 f4             	lea    -0xc(%ebp),%esi
    sys_mbox_free(conn->recvmbox);
    conn->recvmbox = SYS_MBOX_NULL;
  }

  /* Drain the acceptmbox. */
  if (conn->acceptmbox != SYS_MBOX_NULL) {
  80f9a7:	83 7b 18 ff          	cmpl   $0xffffffff,0x18(%ebx)
  80f9ab:	75 0d                	jne    80f9ba <netconn_free+0x99>
  80f9ad:	eb 31                	jmp    80f9e0 <netconn_free+0xbf>
    while (sys_mbox_tryfetch(conn->acceptmbox, &mem) != SYS_MBOX_EMPTY) {
      netconn_delete((struct netconn *)mem);
  80f9af:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80f9b2:	89 04 24             	mov    %eax,(%esp)
  80f9b5:	e8 c1 f1 ff ff       	call   80eb7b <netconn_delete>
    conn->recvmbox = SYS_MBOX_NULL;
  }

  /* Drain the acceptmbox. */
  if (conn->acceptmbox != SYS_MBOX_NULL) {
    while (sys_mbox_tryfetch(conn->acceptmbox, &mem) != SYS_MBOX_EMPTY) {
  80f9ba:	89 74 24 04          	mov    %esi,0x4(%esp)
  80f9be:	8b 43 18             	mov    0x18(%ebx),%eax
  80f9c1:	89 04 24             	mov    %eax,(%esp)
  80f9c4:	e8 ac e3 ff ff       	call   80dd75 <sys_arch_mbox_tryfetch>
  80f9c9:	83 f8 ff             	cmp    $0xffffffff,%eax
  80f9cc:	75 e1                	jne    80f9af <netconn_free+0x8e>
      netconn_delete((struct netconn *)mem);
    }
    sys_mbox_free(conn->acceptmbox);
  80f9ce:	8b 43 18             	mov    0x18(%ebx),%eax
  80f9d1:	89 04 24             	mov    %eax,(%esp)
  80f9d4:	e8 3a dc ff ff       	call   80d613 <sys_mbox_free>
    conn->acceptmbox = SYS_MBOX_NULL;
  80f9d9:	c7 43 18 ff ff ff ff 	movl   $0xffffffff,0x18(%ebx)
  }

  sys_sem_free(conn->op_completed);
  80f9e0:	8b 43 10             	mov    0x10(%ebx),%eax
  80f9e3:	89 04 24             	mov    %eax,(%esp)
  80f9e6:	e8 98 db ff ff       	call   80d583 <sys_sem_free>
  conn->op_completed = SYS_SEM_NULL;
  80f9eb:	c7 43 10 ff ff ff ff 	movl   $0xffffffff,0x10(%ebx)

  memp_free(MEMP_NETCONN, conn);
  80f9f2:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  80f9f6:	c7 04 24 07 00 00 00 	movl   $0x7,(%esp)
  80f9fd:	e8 72 7d ff ff       	call   807774 <memp_free>
}
  80fa02:	83 c4 20             	add    $0x20,%esp
  80fa05:	5b                   	pop    %ebx
  80fa06:	5e                   	pop    %esi
  80fa07:	5d                   	pop    %ebp
  80fa08:	c3                   	ret    

0080fa09 <recv_udp>:
 * @see udp.h (struct udp_pcb.recv) for parameters
 */
static void
recv_udp(void *arg, struct udp_pcb *pcb, struct pbuf *p,
   struct ip_addr *addr, u16_t port)
{
  80fa09:	55                   	push   %ebp
  80fa0a:	89 e5                	mov    %esp,%ebp
  80fa0c:	83 ec 38             	sub    $0x38,%esp
  80fa0f:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  80fa12:	89 75 f8             	mov    %esi,-0x8(%ebp)
  80fa15:	89 7d fc             	mov    %edi,-0x4(%ebp)
  80fa18:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80fa1b:	8b 45 0c             	mov    0xc(%ebp),%eax
  80fa1e:	8b 7d 10             	mov    0x10(%ebp),%edi
  80fa21:	0f b7 55 18          	movzwl 0x18(%ebp),%edx
  80fa25:	66 89 55 e6          	mov    %dx,-0x1a(%ebp)
#if LWIP_SO_RCVBUF
  int recv_avail;
#endif /* LWIP_SO_RCVBUF */

  LWIP_UNUSED_ARG(pcb); /* only used for asserts... */
  LWIP_ASSERT("recv_udp must have a pcb argument", pcb != NULL);
  80fa29:	85 c0                	test   %eax,%eax
  80fa2b:	75 1c                	jne    80fa49 <recv_udp+0x40>
  80fa2d:	c7 44 24 08 7c 4d 81 	movl   $0x814d7c,0x8(%esp)
  80fa34:	00 
  80fa35:	c7 44 24 04 8e 00 00 	movl   $0x8e,0x4(%esp)
  80fa3c:	00 
  80fa3d:	c7 04 24 dd 4b 81 00 	movl   $0x814bdd,(%esp)
  80fa44:	e8 53 0f ff ff       	call   80099c <_panic>
  LWIP_ASSERT("recv_udp must have an argument", arg != NULL);
  80fa49:	85 db                	test   %ebx,%ebx
  80fa4b:	75 1c                	jne    80fa69 <recv_udp+0x60>
  80fa4d:	c7 44 24 08 a0 4d 81 	movl   $0x814da0,0x8(%esp)
  80fa54:	00 
  80fa55:	c7 44 24 04 8f 00 00 	movl   $0x8f,0x4(%esp)
  80fa5c:	00 
  80fa5d:	c7 04 24 dd 4b 81 00 	movl   $0x814bdd,(%esp)
  80fa64:	e8 33 0f ff ff       	call   80099c <_panic>
  conn = arg;
  LWIP_ASSERT("recv_udp: recv for wrong pcb!", conn->pcb.udp == pcb);
  80fa69:	39 43 08             	cmp    %eax,0x8(%ebx)
  80fa6c:	74 1c                	je     80fa8a <recv_udp+0x81>
  80fa6e:	c7 44 24 08 a1 4c 81 	movl   $0x814ca1,0x8(%esp)
  80fa75:	00 
  80fa76:	c7 44 24 04 91 00 00 	movl   $0x91,0x4(%esp)
  80fa7d:	00 
  80fa7e:	c7 04 24 dd 4b 81 00 	movl   $0x814bdd,(%esp)
  80fa85:	e8 12 0f ff ff       	call   80099c <_panic>
#if LWIP_SO_RCVBUF
  SYS_ARCH_GET(conn->recv_avail, recv_avail);
  if ((conn == NULL) || (conn->recvmbox == SYS_MBOX_NULL) ||
      ((recv_avail + (int)(p->tot_len)) > conn->recv_bufsize)) {
#else  /* LWIP_SO_RCVBUF */
  if ((conn == NULL) || (conn->recvmbox == SYS_MBOX_NULL)) {
  80fa8a:	85 db                	test   %ebx,%ebx
  80fa8c:	74 06                	je     80fa94 <recv_udp+0x8b>
  80fa8e:	83 7b 14 ff          	cmpl   $0xffffffff,0x14(%ebx)
  80fa92:	75 0e                	jne    80faa2 <recv_udp+0x99>
#endif /* LWIP_SO_RCVBUF */
    pbuf_free(p);
  80fa94:	89 3c 24             	mov    %edi,(%esp)
  80fa97:	e8 61 84 ff ff       	call   807efd <pbuf_free>
    return;
  80fa9c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  80faa0:	eb 6e                	jmp    80fb10 <recv_udp+0x107>
  }

  buf = memp_malloc(MEMP_NETBUF);
  80faa2:	c7 04 24 06 00 00 00 	movl   $0x6,(%esp)
  80faa9:	e8 0a 7d ff ff       	call   8077b8 <memp_malloc>
  80faae:	89 c6                	mov    %eax,%esi
  if (buf == NULL) {
  80fab0:	85 c0                	test   %eax,%eax
  80fab2:	75 0a                	jne    80fabe <recv_udp+0xb5>
    pbuf_free(p);
  80fab4:	89 3c 24             	mov    %edi,(%esp)
  80fab7:	e8 41 84 ff ff       	call   807efd <pbuf_free>
    return;
  80fabc:	eb 52                	jmp    80fb10 <recv_udp+0x107>
  } else {
    buf->p = p;
  80fabe:	89 38                	mov    %edi,(%eax)
    buf->ptr = p;
  80fac0:	89 78 04             	mov    %edi,0x4(%eax)
    buf->addr = addr;
  80fac3:	8b 45 14             	mov    0x14(%ebp),%eax
  80fac6:	89 46 08             	mov    %eax,0x8(%esi)
    buf->port = port;
  80fac9:	0f b7 45 e6          	movzwl -0x1a(%ebp),%eax
  80facd:	66 89 46 0c          	mov    %ax,0xc(%esi)
  }

  SYS_ARCH_INC(conn->recv_avail, p->tot_len);
  80fad1:	0f b7 47 08          	movzwl 0x8(%edi),%eax
  80fad5:	66 01 43 20          	add    %ax,0x20(%ebx)
  /* Register event with callback */
  API_EVENT(conn, NETCONN_EVT_RCVPLUS, p->tot_len);
  80fad9:	8b 43 2c             	mov    0x2c(%ebx),%eax
  80fadc:	85 c0                	test   %eax,%eax
  80fade:	74 15                	je     80faf5 <recv_udp+0xec>
  80fae0:	0f b7 57 08          	movzwl 0x8(%edi),%edx
  80fae4:	89 54 24 08          	mov    %edx,0x8(%esp)
  80fae8:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80faef:	00 
  80faf0:	89 1c 24             	mov    %ebx,(%esp)
  80faf3:	ff d0                	call   *%eax
  if (sys_mbox_trypost(conn->recvmbox, buf) != ERR_OK) {
  80faf5:	89 74 24 04          	mov    %esi,0x4(%esp)
  80faf9:	8b 43 14             	mov    0x14(%ebx),%eax
  80fafc:	89 04 24             	mov    %eax,(%esp)
  80faff:	e8 93 e2 ff ff       	call   80dd97 <sys_mbox_trypost>
  80fb04:	84 c0                	test   %al,%al
  80fb06:	74 08                	je     80fb10 <recv_udp+0x107>
    netbuf_delete(buf);
  80fb08:	89 34 24             	mov    %esi,(%esp)
  80fb0b:	e8 0e 5b ff ff       	call   80561e <netbuf_delete>
    return;
  }
}
  80fb10:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  80fb13:	8b 75 f8             	mov    -0x8(%ebp),%esi
  80fb16:	8b 7d fc             	mov    -0x4(%ebp),%edi
  80fb19:	89 ec                	mov    %ebp,%esp
  80fb1b:	5d                   	pop    %ebp
  80fb1c:	c3                   	ret    

0080fb1d <netconn_alloc>:
 * @return a newly allocated struct netconn or
 *         NULL on memory error
 */
struct netconn*
netconn_alloc(enum netconn_type t, netconn_callback callback)
{
  80fb1d:	55                   	push   %ebp
  80fb1e:	89 e5                	mov    %esp,%ebp
  80fb20:	53                   	push   %ebx
  80fb21:	83 ec 14             	sub    $0x14,%esp
  struct netconn *conn;
  int size;

  conn = memp_malloc(MEMP_NETCONN);
  80fb24:	c7 04 24 07 00 00 00 	movl   $0x7,(%esp)
  80fb2b:	e8 88 7c ff ff       	call   8077b8 <memp_malloc>
  80fb30:	89 c3                	mov    %eax,%ebx
  if (conn == NULL) {
  80fb32:	85 c0                	test   %eax,%eax
  80fb34:	0f 84 92 00 00 00    	je     80fbcc <netconn_alloc+0xaf>
    return NULL;
  }

  conn->err = ERR_OK;
  80fb3a:	c6 40 0c 00          	movb   $0x0,0xc(%eax)
  conn->type = t;
  80fb3e:	8b 45 08             	mov    0x8(%ebp),%eax
  80fb41:	89 03                	mov    %eax,(%ebx)
  conn->pcb.tcp = NULL;
  80fb43:	c7 43 08 00 00 00 00 	movl   $0x0,0x8(%ebx)
    LWIP_ASSERT("netconn_alloc: undefined netconn_type", 0);
    break;
  }
#endif

  if ((conn->op_completed = sys_sem_new(0)) == SYS_SEM_NULL) {
  80fb4a:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80fb51:	e8 ef de ff ff       	call   80da45 <sys_sem_new>
  80fb56:	89 43 10             	mov    %eax,0x10(%ebx)
  80fb59:	83 f8 ff             	cmp    $0xffffffff,%eax
  80fb5c:	75 17                	jne    80fb75 <netconn_alloc+0x58>
    memp_free(MEMP_NETCONN, conn);
  80fb5e:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  80fb62:	c7 04 24 07 00 00 00 	movl   $0x7,(%esp)
  80fb69:	e8 06 7c ff ff       	call   807774 <memp_free>
  80fb6e:	bb 00 00 00 00       	mov    $0x0,%ebx
    return NULL;
  80fb73:	eb 57                	jmp    80fbcc <netconn_alloc+0xaf>
  }
  if ((conn->recvmbox = sys_mbox_new(size)) == SYS_MBOX_NULL) {
  80fb75:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  80fb7c:	e8 4e df ff ff       	call   80dacf <sys_mbox_new>
  80fb81:	89 43 14             	mov    %eax,0x14(%ebx)
  80fb84:	83 f8 ff             	cmp    $0xffffffff,%eax
  80fb87:	75 22                	jne    80fbab <netconn_alloc+0x8e>
    sys_sem_free(conn->op_completed);
  80fb89:	8b 43 10             	mov    0x10(%ebx),%eax
  80fb8c:	89 04 24             	mov    %eax,(%esp)
  80fb8f:	e8 ef d9 ff ff       	call   80d583 <sys_sem_free>
    memp_free(MEMP_NETCONN, conn);
  80fb94:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  80fb98:	c7 04 24 07 00 00 00 	movl   $0x7,(%esp)
  80fb9f:	e8 d0 7b ff ff       	call   807774 <memp_free>
  80fba4:	bb 00 00 00 00       	mov    $0x0,%ebx
    return NULL;
  80fba9:	eb 21                	jmp    80fbcc <netconn_alloc+0xaf>
  }

  conn->acceptmbox   = SYS_MBOX_NULL;
  80fbab:	c7 43 18 ff ff ff ff 	movl   $0xffffffff,0x18(%ebx)
  conn->state        = NETCONN_NONE;
  80fbb2:	c7 43 04 00 00 00 00 	movl   $0x0,0x4(%ebx)
  /* initialize socket to -1 since 0 is a valid socket */
  conn->socket       = -1;
  80fbb9:	c7 43 1c ff ff ff ff 	movl   $0xffffffff,0x1c(%ebx)
  conn->callback     = callback;
  80fbc0:	8b 45 0c             	mov    0xc(%ebp),%eax
  80fbc3:	89 43 2c             	mov    %eax,0x2c(%ebx)
  conn->recv_avail   = 0;
  80fbc6:	66 c7 43 20 00 00    	movw   $0x0,0x20(%ebx)
#endif /* LWIP_SO_RCVTIMEO */
#if LWIP_SO_RCVBUF
  conn->recv_bufsize = INT_MAX;
#endif /* LWIP_SO_RCVBUF */
  return conn;
}
  80fbcc:	89 d8                	mov    %ebx,%eax
  80fbce:	83 c4 14             	add    $0x14,%esp
  80fbd1:	5b                   	pop    %ebx
  80fbd2:	5d                   	pop    %ebp
  80fbd3:	c3                   	ret    

0080fbd4 <accept_function>:
 *
 * @see tcp.h (struct tcp_pcb_listen.accept) for parameters and return value
 */
static err_t
accept_function(void *arg, struct tcp_pcb *newpcb, err_t err)
{
  80fbd4:	55                   	push   %ebp
  80fbd5:	89 e5                	mov    %esp,%ebp
  80fbd7:	83 ec 28             	sub    $0x28,%esp
  80fbda:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  80fbdd:	89 75 f8             	mov    %esi,-0x8(%ebp)
  80fbe0:	89 7d fc             	mov    %edi,-0x4(%ebp)
  80fbe3:	0f b6 7d 10          	movzbl 0x10(%ebp),%edi
#if API_MSG_DEBUG
#if TCP_DEBUG
  tcp_debug_print_state(newpcb->state);
#endif /* TCP_DEBUG */
#endif /* API_MSG_DEBUG */
  conn = (struct netconn *)arg;
  80fbe7:	8b 5d 08             	mov    0x8(%ebp),%ebx

  LWIP_ERROR("accept_function: invalid conn->acceptmbox",
  80fbea:	83 7b 18 ff          	cmpl   $0xffffffff,0x18(%ebx)
  80fbee:	75 1c                	jne    80fc0c <accept_function+0x38>
  80fbf0:	c7 44 24 08 c0 4d 81 	movl   $0x814dc0,0x8(%esp)
  80fbf7:	00 
  80fbf8:	c7 44 24 04 65 01 00 	movl   $0x165,0x4(%esp)
  80fbff:	00 
  80fc00:	c7 04 24 dd 4b 81 00 	movl   $0x814bdd,(%esp)
  80fc07:	e8 90 0d ff ff       	call   80099c <_panic>
             conn->acceptmbox != SYS_MBOX_NULL, return ERR_VAL;);

  /* We have to set the callback here even though
   * the new socket is unknown. conn->socket is marked as -1. */
  newconn = netconn_alloc(conn->type, conn->callback);
  80fc0c:	8b 43 2c             	mov    0x2c(%ebx),%eax
  80fc0f:	89 44 24 04          	mov    %eax,0x4(%esp)
  80fc13:	8b 03                	mov    (%ebx),%eax
  80fc15:	89 04 24             	mov    %eax,(%esp)
  80fc18:	e8 00 ff ff ff       	call   80fb1d <netconn_alloc>
  80fc1d:	89 c6                	mov    %eax,%esi
  if (newconn == NULL) {
  80fc1f:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  80fc24:	85 f6                	test   %esi,%esi
  80fc26:	74 55                	je     80fc7d <accept_function+0xa9>
    return ERR_MEM;
  }
  newconn->pcb.tcp = newpcb;
  80fc28:	8b 45 0c             	mov    0xc(%ebp),%eax
  80fc2b:	89 46 08             	mov    %eax,0x8(%esi)
  setup_tcp(newconn);
  80fc2e:	89 f0                	mov    %esi,%eax
  80fc30:	e8 53 f1 ff ff       	call   80ed88 <setup_tcp>
  newconn->err = err;
  80fc35:	89 f8                	mov    %edi,%eax
  80fc37:	88 46 0c             	mov    %al,0xc(%esi)
  /* Register event with callback */
  API_EVENT(conn, NETCONN_EVT_RCVPLUS, 0);
  80fc3a:	8b 43 2c             	mov    0x2c(%ebx),%eax
  80fc3d:	85 c0                	test   %eax,%eax
  80fc3f:	74 15                	je     80fc56 <accept_function+0x82>
  80fc41:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80fc48:	00 
  80fc49:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80fc50:	00 
  80fc51:	89 1c 24             	mov    %ebx,(%esp)
  80fc54:	ff d0                	call   *%eax

  if (sys_mbox_trypost(conn->acceptmbox, newconn) != ERR_OK) {
  80fc56:	89 74 24 04          	mov    %esi,0x4(%esp)
  80fc5a:	8b 43 18             	mov    0x18(%ebx),%eax
  80fc5d:	89 04 24             	mov    %eax,(%esp)
  80fc60:	e8 32 e1 ff ff       	call   80dd97 <sys_mbox_trypost>
  80fc65:	84 c0                	test   %al,%al
  80fc67:	74 14                	je     80fc7d <accept_function+0xa9>
    /* When returning != ERR_OK, the connection is aborted in tcp_process(),
       so do nothing here! */
    newconn->pcb.tcp = NULL;
  80fc69:	c7 46 08 00 00 00 00 	movl   $0x0,0x8(%esi)
    netconn_free(newconn);
  80fc70:	89 34 24             	mov    %esi,(%esp)
  80fc73:	e8 a9 fc ff ff       	call   80f921 <netconn_free>
  80fc78:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
    return ERR_MEM;
  }
  return ERR_OK;
}
  80fc7d:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  80fc80:	8b 75 f8             	mov    -0x8(%ebp),%esi
  80fc83:	8b 7d fc             	mov    -0x4(%ebp),%edi
  80fc86:	89 ec                	mov    %ebp,%esp
  80fc88:	5d                   	pop    %ebp
  80fc89:	c3                   	ret    

0080fc8a <do_newconn>:
 *
 * @param msg the api_msg_msg describing the connection type
 */
void
do_newconn(struct api_msg_msg *msg)
{
  80fc8a:	55                   	push   %ebp
  80fc8b:	89 e5                	mov    %esp,%ebp
  80fc8d:	83 ec 18             	sub    $0x18,%esp
  80fc90:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  80fc93:	89 75 fc             	mov    %esi,-0x4(%ebp)
  80fc96:	8b 5d 08             	mov    0x8(%ebp),%ebx
   if(msg->conn->pcb.tcp == NULL) {
  80fc99:	8b 03                	mov    (%ebx),%eax
  80fc9b:	83 78 08 00          	cmpl   $0x0,0x8(%eax)
  80fc9f:	0f 85 d5 00 00 00    	jne    80fd7a <do_newconn+0xf0>
 * @return msg->conn->err, but the return value is currently ignored
 */
static err_t
pcb_new(struct api_msg_msg *msg)
{
   msg->conn->err = ERR_OK;
  80fca5:	c6 40 0c 00          	movb   $0x0,0xc(%eax)

   LWIP_ASSERT("pcb_new: pcb already allocated", msg->conn->pcb.tcp == NULL);
  80fca9:	8b 33                	mov    (%ebx),%esi
  80fcab:	83 7e 08 00          	cmpl   $0x0,0x8(%esi)
  80fcaf:	74 1c                	je     80fccd <do_newconn+0x43>
  80fcb1:	c7 44 24 08 ec 4d 81 	movl   $0x814dec,0x8(%esp)
  80fcb8:	00 
  80fcb9:	c7 44 24 04 8a 01 00 	movl   $0x18a,0x4(%esp)
  80fcc0:	00 
  80fcc1:	c7 04 24 dd 4b 81 00 	movl   $0x814bdd,(%esp)
  80fcc8:	e8 cf 0c ff ff       	call   80099c <_panic>

   /* Allocate a PCB for this connection */
   switch(NETCONNTYPE_GROUP(msg->conn->type)) {
  80fccd:	8b 06                	mov    (%esi),%eax
  80fccf:	25 f0 00 00 00       	and    $0xf0,%eax
  80fcd4:	83 f8 20             	cmp    $0x20,%eax
  80fcd7:	74 45                	je     80fd1e <do_newconn+0x94>
  80fcd9:	83 f8 40             	cmp    $0x40,%eax
  80fcdc:	74 0c                	je     80fcea <do_newconn+0x60>
  80fcde:	83 f8 10             	cmp    $0x10,%eax
  80fce1:	0f 85 8f 00 00 00    	jne    80fd76 <do_newconn+0xec>
  80fce7:	90                   	nop
  80fce8:	eb 6f                	jmp    80fd59 <do_newconn+0xcf>
#if LWIP_RAW
   case NETCONN_RAW:
     msg->conn->pcb.raw = raw_new(msg->msg.n.proto);
  80fcea:	0f b6 43 04          	movzbl 0x4(%ebx),%eax
  80fcee:	89 04 24             	mov    %eax,(%esp)
  80fcf1:	e8 29 1d 00 00       	call   811a1f <raw_new>
  80fcf6:	89 46 08             	mov    %eax,0x8(%esi)
     if(msg->conn->pcb.raw == NULL) {
  80fcf9:	8b 03                	mov    (%ebx),%eax
  80fcfb:	8b 50 08             	mov    0x8(%eax),%edx
  80fcfe:	85 d2                	test   %edx,%edx
  80fd00:	75 06                	jne    80fd08 <do_newconn+0x7e>
       msg->conn->err = ERR_MEM;
  80fd02:	c6 40 0c ff          	movb   $0xff,0xc(%eax)
  80fd06:	eb 72                	jmp    80fd7a <do_newconn+0xf0>
       break;
     }
     raw_recv(msg->conn->pcb.raw, recv_raw, msg->conn);
  80fd08:	89 44 24 08          	mov    %eax,0x8(%esp)
  80fd0c:	c7 44 24 04 91 fd 80 	movl   $0x80fd91,0x4(%esp)
  80fd13:	00 
  80fd14:	89 14 24             	mov    %edx,(%esp)
  80fd17:	e8 ef 1c 00 00       	call   811a0b <raw_recv>
  80fd1c:	eb 5c                	jmp    80fd7a <do_newconn+0xf0>
     break;
#endif /* LWIP_RAW */
#if LWIP_UDP
   case NETCONN_UDP:
     msg->conn->pcb.udp = udp_new();
  80fd1e:	e8 8c c3 ff ff       	call   80c0af <udp_new>
  80fd23:	89 46 08             	mov    %eax,0x8(%esi)
     if(msg->conn->pcb.udp == NULL) {
  80fd26:	8b 03                	mov    (%ebx),%eax
  80fd28:	8b 50 08             	mov    0x8(%eax),%edx
  80fd2b:	85 d2                	test   %edx,%edx
  80fd2d:	75 06                	jne    80fd35 <do_newconn+0xab>
       msg->conn->err = ERR_MEM;
  80fd2f:	c6 40 0c ff          	movb   $0xff,0xc(%eax)
  80fd33:	eb 45                	jmp    80fd7a <do_newconn+0xf0>
#if LWIP_UDPLITE
     if (msg->conn->type==NETCONN_UDPLITE) {
       udp_setflags(msg->conn->pcb.udp, UDP_FLAGS_UDPLITE);
     }
#endif /* LWIP_UDPLITE */
     if (msg->conn->type==NETCONN_UDPNOCHKSUM) {
  80fd35:	83 38 22             	cmpl   $0x22,(%eax)
  80fd38:	75 04                	jne    80fd3e <do_newconn+0xb4>
       udp_setflags(msg->conn->pcb.udp, UDP_FLAGS_NOCHKSUM);
  80fd3a:	c6 42 10 01          	movb   $0x1,0x10(%edx)
     }
     udp_recv(msg->conn->pcb.udp, recv_udp, msg->conn);
  80fd3e:	8b 03                	mov    (%ebx),%eax
  80fd40:	89 44 24 08          	mov    %eax,0x8(%esp)
  80fd44:	c7 44 24 04 09 fa 80 	movl   $0x80fa09,0x4(%esp)
  80fd4b:	00 
  80fd4c:	8b 40 08             	mov    0x8(%eax),%eax
  80fd4f:	89 04 24             	mov    %eax,(%esp)
  80fd52:	e8 44 c3 ff ff       	call   80c09b <udp_recv>
  80fd57:	eb 21                	jmp    80fd7a <do_newconn+0xf0>
     break;
#endif /* LWIP_UDP */
#if LWIP_TCP
   case NETCONN_TCP:
     msg->conn->pcb.tcp = tcp_new();
  80fd59:	e8 6c 95 ff ff       	call   8092ca <tcp_new>
  80fd5e:	89 46 08             	mov    %eax,0x8(%esi)
     if(msg->conn->pcb.tcp == NULL) {
  80fd61:	8b 03                	mov    (%ebx),%eax
  80fd63:	83 78 08 00          	cmpl   $0x0,0x8(%eax)
  80fd67:	75 06                	jne    80fd6f <do_newconn+0xe5>
       msg->conn->err = ERR_MEM;
  80fd69:	c6 40 0c ff          	movb   $0xff,0xc(%eax)
  80fd6d:	eb 0b                	jmp    80fd7a <do_newconn+0xf0>
       break;
     }
     setup_tcp(msg->conn);
  80fd6f:	e8 14 f0 ff ff       	call   80ed88 <setup_tcp>
  80fd74:	eb 04                	jmp    80fd7a <do_newconn+0xf0>
     break;
#endif /* LWIP_TCP */
   default:
     /* Unsupported netconn type, e.g. protocol disabled */
     msg->conn->err = ERR_VAL;
  80fd76:	c6 46 0c f7          	movb   $0xf7,0xc(%esi)
   }
   /* Else? This "new" connection already has a PCB allocated. */
   /* Is this an error condition? Should it be deleted? */
   /* We currently just are happy and return. */

   TCPIP_APIMSG_ACK(msg);
  80fd7a:	8b 03                	mov    (%ebx),%eax
  80fd7c:	8b 40 10             	mov    0x10(%eax),%eax
  80fd7f:	89 04 24             	mov    %eax,(%esp)
  80fd82:	e8 60 de ff ff       	call   80dbe7 <sys_sem_signal>
}
  80fd87:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  80fd8a:	8b 75 fc             	mov    -0x4(%ebp),%esi
  80fd8d:	89 ec                	mov    %ebp,%esp
  80fd8f:	5d                   	pop    %ebp
  80fd90:	c3                   	ret    

0080fd91 <recv_raw>:
 * @see raw.h (struct raw_pcb.recv) for parameters and return value
 */
static u8_t
recv_raw(void *arg, struct raw_pcb *pcb, struct pbuf *p,
    struct ip_addr *addr)
{
  80fd91:	55                   	push   %ebp
  80fd92:	89 e5                	mov    %esp,%ebp
  80fd94:	83 ec 28             	sub    $0x28,%esp
  80fd97:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  80fd9a:	89 75 f8             	mov    %esi,-0x8(%ebp)
  80fd9d:	89 7d fc             	mov    %edi,-0x4(%ebp)
  80fda0:	8b 7d 10             	mov    0x10(%ebp),%edi
#if LWIP_SO_RCVBUF
  int recv_avail;
#endif /* LWIP_SO_RCVBUF */

  LWIP_UNUSED_ARG(addr);
  conn = arg;
  80fda3:	8b 5d 08             	mov    0x8(%ebp),%ebx
#if LWIP_SO_RCVBUF
  SYS_ARCH_GET(conn->recv_avail, recv_avail);
  if ((conn != NULL) && (conn->recvmbox != SYS_MBOX_NULL) &&
      ((recv_avail + (int)(p->tot_len)) <= conn->recv_bufsize)) {
#else  /* LWIP_SO_RCVBUF */
  if ((conn != NULL) && (conn->recvmbox != SYS_MBOX_NULL)) {
  80fda6:	85 db                	test   %ebx,%ebx
  80fda8:	0f 84 b0 00 00 00    	je     80fe5e <recv_raw+0xcd>
  80fdae:	83 7b 14 ff          	cmpl   $0xffffffff,0x14(%ebx)
  80fdb2:	0f 84 a6 00 00 00    	je     80fe5e <recv_raw+0xcd>
#endif /* LWIP_SO_RCVBUF */
    /* copy the whole packet into new pbufs */
    q = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM);
  80fdb8:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  80fdbf:	00 
  80fdc0:	0f b7 47 08          	movzwl 0x8(%edi),%eax
  80fdc4:	89 44 24 04          	mov    %eax,0x4(%esp)
  80fdc8:	c7 04 24 03 00 00 00 	movl   $0x3,(%esp)
  80fdcf:	e8 e5 83 ff ff       	call   8081b9 <pbuf_alloc>
  80fdd4:	89 c6                	mov    %eax,%esi
    if(q != NULL) {
  80fdd6:	85 c0                	test   %eax,%eax
  80fdd8:	0f 84 80 00 00 00    	je     80fe5e <recv_raw+0xcd>
      if (pbuf_copy(q, p) != ERR_OK) {
  80fdde:	89 7c 24 04          	mov    %edi,0x4(%esp)
  80fde2:	89 04 24             	mov    %eax,(%esp)
  80fde5:	e8 6a 7f ff ff       	call   807d54 <pbuf_copy>
  80fdea:	84 c0                	test   %al,%al
  80fdec:	0f 84 7e 00 00 00    	je     80fe70 <recv_raw+0xdf>
        pbuf_free(q);
  80fdf2:	89 34 24             	mov    %esi,(%esp)
  80fdf5:	e8 03 81 ff ff       	call   807efd <pbuf_free>
  80fdfa:	eb 62                	jmp    80fe5e <recv_raw+0xcd>
    }

    if(q != NULL) {
      buf = memp_malloc(MEMP_NETBUF);
      if (buf == NULL) {
        pbuf_free(q);
  80fdfc:	89 34 24             	mov    %esi,(%esp)
  80fdff:	e8 f9 80 ff ff       	call   807efd <pbuf_free>
        return 0;
  80fe04:	eb 58                	jmp    80fe5e <recv_raw+0xcd>
      }

      buf->p = q;
  80fe06:	89 37                	mov    %esi,(%edi)
      buf->ptr = q;
  80fe08:	89 77 04             	mov    %esi,0x4(%edi)
      buf->addr = &(((struct ip_hdr*)(q->payload))->src);
  80fe0b:	8b 46 04             	mov    0x4(%esi),%eax
  80fe0e:	83 c0 0c             	add    $0xc,%eax
  80fe11:	89 47 08             	mov    %eax,0x8(%edi)
      buf->port = pcb->protocol;
  80fe14:	8b 45 0c             	mov    0xc(%ebp),%eax
  80fe17:	0f b6 40 10          	movzbl 0x10(%eax),%eax
  80fe1b:	66 89 47 0c          	mov    %ax,0xc(%edi)

      SYS_ARCH_INC(conn->recv_avail, q->tot_len);
  80fe1f:	0f b7 46 08          	movzwl 0x8(%esi),%eax
  80fe23:	66 01 43 20          	add    %ax,0x20(%ebx)
      /* Register event with callback */
      API_EVENT(conn, NETCONN_EVT_RCVPLUS, q->tot_len);
  80fe27:	8b 43 2c             	mov    0x2c(%ebx),%eax
  80fe2a:	85 c0                	test   %eax,%eax
  80fe2c:	74 15                	je     80fe43 <recv_raw+0xb2>
  80fe2e:	0f b7 56 08          	movzwl 0x8(%esi),%edx
  80fe32:	89 54 24 08          	mov    %edx,0x8(%esp)
  80fe36:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  80fe3d:	00 
  80fe3e:	89 1c 24             	mov    %ebx,(%esp)
  80fe41:	ff d0                	call   *%eax
      if (sys_mbox_trypost(conn->recvmbox, buf) != ERR_OK) {
  80fe43:	89 7c 24 04          	mov    %edi,0x4(%esp)
  80fe47:	8b 43 14             	mov    0x14(%ebx),%eax
  80fe4a:	89 04 24             	mov    %eax,(%esp)
  80fe4d:	e8 45 df ff ff       	call   80dd97 <sys_mbox_trypost>
  80fe52:	84 c0                	test   %al,%al
  80fe54:	74 08                	je     80fe5e <recv_raw+0xcd>
        netbuf_delete(buf);
  80fe56:	89 3c 24             	mov    %edi,(%esp)
  80fe59:	e8 c0 57 ff ff       	call   80561e <netbuf_delete>
      }
    }
  }

  return 0; /* do not eat the packet */
}
  80fe5e:	b8 00 00 00 00       	mov    $0x0,%eax
  80fe63:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  80fe66:	8b 75 f8             	mov    -0x8(%ebp),%esi
  80fe69:	8b 7d fc             	mov    -0x4(%ebp),%edi
  80fe6c:	89 ec                	mov    %ebp,%esp
  80fe6e:	5d                   	pop    %ebp
  80fe6f:	c3                   	ret    
        q = NULL;
      }
    }

    if(q != NULL) {
      buf = memp_malloc(MEMP_NETBUF);
  80fe70:	c7 04 24 06 00 00 00 	movl   $0x6,(%esp)
  80fe77:	e8 3c 79 ff ff       	call   8077b8 <memp_malloc>
  80fe7c:	89 c7                	mov    %eax,%edi
      if (buf == NULL) {
  80fe7e:	85 c0                	test   %eax,%eax
  80fe80:	75 84                	jne    80fe06 <recv_raw+0x75>
  80fe82:	e9 75 ff ff ff       	jmp    80fdfc <recv_raw+0x6b>
	...

0080fe90 <tcp_parseopt>:
 *
 * @param pcb the tcp_pcb for which a segment arrived
 */
static void
tcp_parseopt(struct tcp_pcb *pcb)
{
  80fe90:	55                   	push   %ebp
  80fe91:	89 e5                	mov    %esp,%ebp
  80fe93:	57                   	push   %edi
  80fe94:	56                   	push   %esi
  80fe95:	53                   	push   %ebx
  80fe96:	83 ec 1c             	sub    $0x1c,%esp
  80fe99:	89 c7                	mov    %eax,%edi
  u8_t c;
  u8_t *opts, opt;
  u16_t mss;

  opts = (u8_t *)tcphdr + TCP_HLEN;
  80fe9b:	a1 70 f5 b3 00       	mov    0xb3f570,%eax
  80fea0:	8d 70 14             	lea    0x14(%eax),%esi

  /* Parse the TCP MSS option, if present. */
  if(TCPH_HDRLEN(tcphdr) > 0x5) {
  80fea3:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  80fea7:	89 04 24             	mov    %eax,(%esp)
  80feaa:	e8 51 ae ff ff       	call   80ad00 <ntohs>
  80feaf:	66 c1 e8 0c          	shr    $0xc,%ax
  80feb3:	bb 00 00 00 00       	mov    $0x0,%ebx
  80feb8:	66 83 f8 05          	cmp    $0x5,%ax
  80febc:	77 54                	ja     80ff12 <tcp_parseopt+0x82>
  80febe:	eb 78                	jmp    80ff38 <tcp_parseopt+0xa8>
    for(c = 0; c < (TCPH_HDRLEN(tcphdr) - 5) << 2 ;) {
      opt = opts[c];
  80fec0:	0f b6 d3             	movzbl %bl,%edx
  80fec3:	0f b6 04 16          	movzbl (%esi,%edx,1),%eax
      if (opt == 0x00) {
  80fec7:	84 c0                	test   %al,%al
  80fec9:	74 6d                	je     80ff38 <tcp_parseopt+0xa8>
        /* End of options. */
        break;
      } else if (opt == 0x01) {
  80fecb:	3c 01                	cmp    $0x1,%al
  80fecd:	8d 76 00             	lea    0x0(%esi),%esi
  80fed0:	75 05                	jne    80fed7 <tcp_parseopt+0x47>
        ++c;
  80fed2:	83 c3 01             	add    $0x1,%ebx
  80fed5:	eb 3b                	jmp    80ff12 <tcp_parseopt+0x82>
        /* NOP option. */
      } else if (opt == 0x02 &&
  80fed7:	3c 02                	cmp    $0x2,%al
  80fed9:	75 2c                	jne    80ff07 <tcp_parseopt+0x77>
        opts[c + 1] == 0x04) {
  80fedb:	80 7c 16 01 04       	cmpb   $0x4,0x1(%esi,%edx,1)
  80fee0:	75 25                	jne    80ff07 <tcp_parseopt+0x77>
        /* An MSS option with the right option length. */
        mss = (opts[c + 2] << 8) | opts[c + 3];
  80fee2:	0f b6 44 16 02       	movzbl 0x2(%esi,%edx,1),%eax
  80fee7:	c1 e0 08             	shl    $0x8,%eax
  80feea:	0f b6 54 16 03       	movzbl 0x3(%esi,%edx,1),%edx
  80feef:	09 d0                	or     %edx,%eax
        /* Limit the mss to the configured TCP_MSS and prevent division by zero */
        pcb->mss = ((mss > TCP_MSS) || (mss == 0)) ? TCP_MSS : mss;
  80fef1:	8d 50 ff             	lea    -0x1(%eax),%edx
  80fef4:	66 81 fa b4 05       	cmp    $0x5b4,%dx
  80fef9:	ba b4 05 00 00       	mov    $0x5b4,%edx
  80fefe:	0f 43 c2             	cmovae %edx,%eax
  80ff01:	66 89 47 34          	mov    %ax,0x34(%edi)

        /* And we are done processing options. */
        break;
  80ff05:	eb 31                	jmp    80ff38 <tcp_parseopt+0xa8>
      } else {
        if (opts[c + 1] == 0) {
  80ff07:	0f b6 44 16 01       	movzbl 0x1(%esi,%edx,1),%eax
  80ff0c:	84 c0                	test   %al,%al
  80ff0e:	74 28                	je     80ff38 <tcp_parseopt+0xa8>
             and we don't process them further. */
          break;
        }
        /* All other options have a length field, so that we easily
           can skip past them. */
        c += opts[c + 1];
  80ff10:	01 c3                	add    %eax,%ebx

  opts = (u8_t *)tcphdr + TCP_HLEN;

  /* Parse the TCP MSS option, if present. */
  if(TCPH_HDRLEN(tcphdr) > 0x5) {
    for(c = 0; c < (TCPH_HDRLEN(tcphdr) - 5) << 2 ;) {
  80ff12:	a1 70 f5 b3 00       	mov    0xb3f570,%eax
  80ff17:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  80ff1b:	89 04 24             	mov    %eax,(%esp)
  80ff1e:	e8 dd ad ff ff       	call   80ad00 <ntohs>
  80ff23:	0f b6 d3             	movzbl %bl,%edx
  80ff26:	66 c1 e8 0c          	shr    $0xc,%ax
  80ff2a:	0f b7 c0             	movzwl %ax,%eax
  80ff2d:	8d 04 85 ec ff ff ff 	lea    -0x14(,%eax,4),%eax
  80ff34:	39 c2                	cmp    %eax,%edx
  80ff36:	7c 88                	jl     80fec0 <tcp_parseopt+0x30>
           can skip past them. */
        c += opts[c + 1];
      }
    }
  }
}
  80ff38:	83 c4 1c             	add    $0x1c,%esp
  80ff3b:	5b                   	pop    %ebx
  80ff3c:	5e                   	pop    %esi
  80ff3d:	5f                   	pop    %edi
  80ff3e:	5d                   	pop    %ebp
  80ff3f:	c3                   	ret    

0080ff40 <tcp_receive>:
 *
 * @return 1 if the incoming segment is the next in sequence, 0 if not
 */
static u8_t
tcp_receive(struct tcp_pcb *pcb)
{
  80ff40:	55                   	push   %ebp
  80ff41:	89 e5                	mov    %esp,%ebp
  80ff43:	57                   	push   %edi
  80ff44:	56                   	push   %esi
  80ff45:	53                   	push   %ebx
  80ff46:	83 ec 2c             	sub    $0x2c,%esp
  80ff49:	89 c3                	mov    %eax,%ebx
  s16_t m;
  u32_t right_wnd_edge;
  u16_t new_tot_len;
  u8_t accepted_inseq = 0;

  if (flags & TCP_ACK) {
  80ff4b:	f6 05 80 f5 b3 00 10 	testb  $0x10,0xb3f580
  80ff52:	0f 84 6c 04 00 00    	je     8103c4 <tcp_receive+0x484>
    right_wnd_edge = pcb->snd_wnd + pcb->snd_wl1;
  80ff58:	0f b7 70 5c          	movzwl 0x5c(%eax),%esi
  80ff5c:	8b 50 60             	mov    0x60(%eax),%edx

    /* Update window. */
    if (TCP_SEQ_LT(pcb->snd_wl1, seqno) ||
  80ff5f:	a1 78 f5 b3 00       	mov    0xb3f578,%eax
  80ff64:	39 c2                	cmp    %eax,%edx
  80ff66:	78 24                	js     80ff8c <tcp_receive+0x4c>
  80ff68:	39 c2                	cmp    %eax,%edx
  80ff6a:	75 0a                	jne    80ff76 <tcp_receive+0x36>
       (pcb->snd_wl1 == seqno && TCP_SEQ_LT(pcb->snd_wl2, ackno)) ||
  80ff6c:	a1 7c f5 b3 00       	mov    0xb3f57c,%eax
  80ff71:	39 43 64             	cmp    %eax,0x64(%ebx)
  80ff74:	78 16                	js     80ff8c <tcp_receive+0x4c>
       (pcb->snd_wl2 == ackno && tcphdr->wnd > pcb->snd_wnd)) {
  80ff76:	8b 43 64             	mov    0x64(%ebx),%eax
  80ff79:	3b 05 7c f5 b3 00    	cmp    0xb3f57c,%eax
  80ff7f:	75 3f                	jne    80ffc0 <tcp_receive+0x80>
  80ff81:	a1 70 f5 b3 00       	mov    0xb3f570,%eax
  80ff86:	66 3b 70 0e          	cmp    0xe(%eax),%si
  80ff8a:	73 34                	jae    80ffc0 <tcp_receive+0x80>
      pcb->snd_wnd = tcphdr->wnd;
  80ff8c:	a1 70 f5 b3 00       	mov    0xb3f570,%eax
  80ff91:	0f b7 40 0e          	movzwl 0xe(%eax),%eax
  80ff95:	66 89 43 5c          	mov    %ax,0x5c(%ebx)
      pcb->snd_wl1 = seqno;
  80ff99:	8b 0d 78 f5 b3 00    	mov    0xb3f578,%ecx
  80ff9f:	89 4b 60             	mov    %ecx,0x60(%ebx)
      pcb->snd_wl2 = ackno;
  80ffa2:	8b 0d 7c f5 b3 00    	mov    0xb3f57c,%ecx
  80ffa8:	89 4b 64             	mov    %ecx,0x64(%ebx)
      if (pcb->snd_wnd > 0 && pcb->persist_backoff > 0) {
  80ffab:	66 85 c0             	test   %ax,%ax
  80ffae:	74 10                	je     80ffc0 <tcp_receive+0x80>
  80ffb0:	80 bb a4 00 00 00 00 	cmpb   $0x0,0xa4(%ebx)
  80ffb7:	74 07                	je     80ffc0 <tcp_receive+0x80>
          pcb->persist_backoff = 0;
  80ffb9:	c6 83 a4 00 00 00 00 	movb   $0x0,0xa4(%ebx)
                               pcb->lastack, pcb->snd_max, ackno, pcb->snd_wl1, seqno, pcb->snd_wl2));
      }
#endif /* TCP_WND_DEBUG */
    }

    if (pcb->lastack == ackno) {
  80ffc0:	8b 4b 48             	mov    0x48(%ebx),%ecx
  80ffc3:	a1 7c f5 b3 00       	mov    0xb3f57c,%eax
  80ffc8:	39 c1                	cmp    %eax,%ecx
  80ffca:	0f 85 ab 00 00 00    	jne    81007b <tcp_receive+0x13b>
      pcb->acked = 0;
  80ffd0:	66 c7 43 6c 00 00    	movw   $0x0,0x6c(%ebx)

      if (pcb->snd_wl1 + pcb->snd_wnd == right_wnd_edge){
  80ffd6:	0f b7 43 5c          	movzwl 0x5c(%ebx),%eax
  80ffda:	03 43 60             	add    0x60(%ebx),%eax
  80ffdd:	0f b7 f6             	movzwl %si,%esi
  80ffe0:	8d 14 16             	lea    (%esi,%edx,1),%edx
  80ffe3:	39 d0                	cmp    %edx,%eax
  80ffe5:	0f 85 fe 02 00 00    	jne    8102e9 <tcp_receive+0x3a9>
        ++pcb->dupacks;
  80ffeb:	0f b6 43 4c          	movzbl 0x4c(%ebx),%eax
  80ffef:	83 c0 01             	add    $0x1,%eax
  80fff2:	88 43 4c             	mov    %al,0x4c(%ebx)
        if (pcb->dupacks >= 3 && pcb->unacked != NULL) {
  80fff5:	3c 02                	cmp    $0x2,%al
  80fff7:	0f 86 ec 02 00 00    	jbe    8102e9 <tcp_receive+0x3a9>
  80fffd:	83 7b 78 00          	cmpl   $0x0,0x78(%ebx)
  810001:	0f 84 e2 02 00 00    	je     8102e9 <tcp_receive+0x3a9>
          if (!(pcb->flags & TF_INFR)) {
  810007:	f6 43 20 04          	testb  $0x4,0x20(%ebx)
  81000b:	75 52                	jne    81005f <tcp_receive+0x11f>
            /* This is fast retransmit. Retransmit the first unacked segment. */
            LWIP_DEBUGF(TCP_FR_DEBUG, ("tcp_receive: dupacks %"U16_F" (%"U32_F"), fast retransmit %"U32_F"\n",
                                       (u16_t)pcb->dupacks, pcb->lastack,
                                       ntohl(pcb->unacked->tcphdr->seqno)));
            tcp_rexmit(pcb);
  81000d:	89 1c 24             	mov    %ebx,(%esp)
  810010:	e8 13 b8 ff ff       	call   80b828 <tcp_rexmit>
            /* Set ssthresh to max (FlightSize / 2, 2*SMSS) */
            /*pcb->ssthresh = LWIP_MAX((pcb->snd_max -
                                      pcb->lastack) / 2,
                                      2 * pcb->mss);*/
            /* Set ssthresh to half of the minimum of the current cwnd and the advertised window */
            if (pcb->cwnd > pcb->snd_wnd)
  810015:	0f b7 43 4e          	movzwl 0x4e(%ebx),%eax
  810019:	0f b7 53 5c          	movzwl 0x5c(%ebx),%edx
  81001d:	66 39 d0             	cmp    %dx,%ax
  810020:	76 09                	jbe    81002b <tcp_receive+0xeb>
              pcb->ssthresh = pcb->snd_wnd / 2;
  810022:	66 d1 ea             	shr    %dx
  810025:	66 89 53 50          	mov    %dx,0x50(%ebx)
  810029:	eb 07                	jmp    810032 <tcp_receive+0xf2>
            else
              pcb->ssthresh = pcb->cwnd / 2;
  81002b:	66 d1 e8             	shr    %ax
  81002e:	66 89 43 50          	mov    %ax,0x50(%ebx)

            /* The minimum value for ssthresh should be 2 MSS */
            if (pcb->ssthresh < 2*pcb->mss) {
  810032:	0f b7 43 34          	movzwl 0x34(%ebx),%eax
  810036:	0f b7 4b 50          	movzwl 0x50(%ebx),%ecx
  81003a:	0f b7 d0             	movzwl %ax,%edx
  81003d:	01 d2                	add    %edx,%edx
  81003f:	39 d1                	cmp    %edx,%ecx
  810041:	7d 06                	jge    810049 <tcp_receive+0x109>
              LWIP_DEBUGF(TCP_FR_DEBUG, ("tcp_receive: The minimum value for ssthresh %"U16_F" should be min 2 mss %"U16_F"...\n", pcb->ssthresh, 2*pcb->mss));
              pcb->ssthresh = 2*pcb->mss;
  810043:	01 c0                	add    %eax,%eax
  810045:	66 89 43 50          	mov    %ax,0x50(%ebx)
            }

            pcb->cwnd = pcb->ssthresh + 3 * pcb->mss;
  810049:	66 6b 43 34 03       	imul   $0x3,0x34(%ebx),%ax
  81004e:	66 03 43 50          	add    0x50(%ebx),%ax
  810052:	66 89 43 4e          	mov    %ax,0x4e(%ebx)
            pcb->flags |= TF_INFR;
  810056:	80 4b 20 04          	orb    $0x4,0x20(%ebx)
  81005a:	e9 8a 02 00 00       	jmp    8102e9 <tcp_receive+0x3a9>
          } else {
            /* Inflate the congestion window, but not if it means that
               the value overflows. */
            if ((u16_t)(pcb->cwnd + pcb->mss) > pcb->cwnd) {
  81005f:	0f b7 53 4e          	movzwl 0x4e(%ebx),%edx
  810063:	89 d0                	mov    %edx,%eax
  810065:	66 03 43 34          	add    0x34(%ebx),%ax
  810069:	66 39 c2             	cmp    %ax,%dx
  81006c:	0f 83 77 02 00 00    	jae    8102e9 <tcp_receive+0x3a9>
              pcb->cwnd += pcb->mss;
  810072:	66 89 43 4e          	mov    %ax,0x4e(%ebx)
  810076:	e9 6e 02 00 00       	jmp    8102e9 <tcp_receive+0x3a9>
        }
      } else {
        LWIP_DEBUGF(TCP_FR_DEBUG, ("tcp_receive: dupack averted %"U32_F" %"U32_F"\n",
                                   pcb->snd_wl1 + pcb->snd_wnd, right_wnd_edge));
      }
    } else if (TCP_SEQ_BETWEEN(ackno, pcb->lastack+1, pcb->snd_max)){
  81007b:	f7 d1                	not    %ecx
  81007d:	01 c1                	add    %eax,%ecx
  81007f:	0f 88 b2 01 00 00    	js     810237 <tcp_receive+0x2f7>
  810085:	2b 43 58             	sub    0x58(%ebx),%eax
  810088:	85 c0                	test   %eax,%eax
  81008a:	0f 8f a7 01 00 00    	jg     810237 <tcp_receive+0x2f7>
      /* We come here when the ACK acknowledges new data. */
      
      /* Reset the "IN Fast Retransmit" flag, since we are no longer
         in fast retransmit. Also reset the congestion window to the
         slow start threshold. */
      if (pcb->flags & TF_INFR) {
  810090:	0f b6 43 20          	movzbl 0x20(%ebx),%eax
  810094:	a8 04                	test   $0x4,%al
  810096:	74 0e                	je     8100a6 <tcp_receive+0x166>
        pcb->flags &= ~TF_INFR;
  810098:	83 e0 fb             	and    $0xfffffffb,%eax
  81009b:	88 43 20             	mov    %al,0x20(%ebx)
        pcb->cwnd = pcb->ssthresh;
  81009e:	0f b7 43 50          	movzwl 0x50(%ebx),%eax
  8100a2:	66 89 43 4e          	mov    %ax,0x4e(%ebx)
      }

      /* Reset the number of retransmissions. */
      pcb->nrtx = 0;
  8100a6:	c6 43 46 00          	movb   $0x0,0x46(%ebx)

      /* Reset the retransmission time-out. */
      pcb->rto = (pcb->sa >> 3) + pcb->sv;
  8100aa:	0f b7 43 40          	movzwl 0x40(%ebx),%eax
  8100ae:	66 c1 f8 03          	sar    $0x3,%ax
  8100b2:	66 03 43 42          	add    0x42(%ebx),%ax
  8100b6:	66 89 43 44          	mov    %ax,0x44(%ebx)

      /* Update the send buffer space. Diff between the two can never exceed 64K? */
      pcb->acked = (u16_t)(ackno - pcb->lastack);
  8100ba:	a1 7c f5 b3 00       	mov    0xb3f57c,%eax
  8100bf:	66 2b 43 48          	sub    0x48(%ebx),%ax
  8100c3:	66 89 43 6c          	mov    %ax,0x6c(%ebx)

      pcb->snd_buf += pcb->acked;
  8100c7:	66 01 43 6e          	add    %ax,0x6e(%ebx)

      /* Reset the fast retransmit variables. */
      pcb->dupacks = 0;
  8100cb:	c6 43 4c 00          	movb   $0x0,0x4c(%ebx)
      pcb->lastack = ackno;
  8100cf:	a1 7c f5 b3 00       	mov    0xb3f57c,%eax
  8100d4:	89 43 48             	mov    %eax,0x48(%ebx)

      /* Update the congestion control variables (cwnd and
         ssthresh). */
      if (pcb->state >= ESTABLISHED) {
  8100d7:	83 7b 10 03          	cmpl   $0x3,0x10(%ebx)
  8100db:	0f 86 d3 00 00 00    	jbe    8101b4 <tcp_receive+0x274>
        if (pcb->cwnd < pcb->ssthresh) {
  8100e1:	0f b7 4b 4e          	movzwl 0x4e(%ebx),%ecx
  8100e5:	66 3b 4b 50          	cmp    0x50(%ebx),%cx
  8100e9:	73 18                	jae    810103 <tcp_receive+0x1c3>
          if ((u16_t)(pcb->cwnd + pcb->mss) > pcb->cwnd) {
  8100eb:	89 c8                	mov    %ecx,%eax
  8100ed:	66 03 43 34          	add    0x34(%ebx),%ax
  8100f1:	66 39 c1             	cmp    %ax,%cx
  8100f4:	0f 83 ba 00 00 00    	jae    8101b4 <tcp_receive+0x274>
            pcb->cwnd += pcb->mss;
  8100fa:	66 89 43 4e          	mov    %ax,0x4e(%ebx)
  8100fe:	e9 b1 00 00 00       	jmp    8101b4 <tcp_receive+0x274>
          }
          LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_receive: slow start cwnd %"U16_F"\n", pcb->cwnd));
        } else {
          u16_t new_cwnd = (pcb->cwnd + pcb->mss * pcb->mss / pcb->cwnd);
  810103:	0f b7 53 34          	movzwl 0x34(%ebx),%edx
  810107:	0f af d2             	imul   %edx,%edx
  81010a:	0f b7 f1             	movzwl %cx,%esi
  81010d:	89 d0                	mov    %edx,%eax
  81010f:	c1 fa 1f             	sar    $0x1f,%edx
  810112:	f7 fe                	idiv   %esi
  810114:	8d 04 01             	lea    (%ecx,%eax,1),%eax
          if (new_cwnd > pcb->cwnd) {
  810117:	66 39 c1             	cmp    %ax,%cx
  81011a:	0f 83 94 00 00 00    	jae    8101b4 <tcp_receive+0x274>
            pcb->cwnd = new_cwnd;
  810120:	66 89 43 4e          	mov    %ax,0x4e(%ebx)
  810124:	e9 8b 00 00 00       	jmp    8101b4 <tcp_receive+0x274>
        LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: removing %"U32_F":%"U32_F" from pcb->unacked\n",
                                      ntohl(pcb->unacked->tcphdr->seqno),
                                      ntohl(pcb->unacked->tcphdr->seqno) +
                                      TCP_TCPLEN(pcb->unacked)));

        next = pcb->unacked;
  810129:	8b 73 78             	mov    0x78(%ebx),%esi
        pcb->unacked = pcb->unacked->next;
  81012c:	8b 06                	mov    (%esi),%eax
  81012e:	89 43 78             	mov    %eax,0x78(%ebx)

        LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_receive: queuelen %"U16_F" ... ", (u16_t)pcb->snd_queuelen));
        LWIP_ASSERT("pcb->snd_queuelen >= pbuf_clen(next->p)", (pcb->snd_queuelen >= pbuf_clen(next->p)));
  810131:	0f b7 7b 70          	movzwl 0x70(%ebx),%edi
  810135:	8b 46 04             	mov    0x4(%esi),%eax
  810138:	89 04 24             	mov    %eax,(%esp)
  81013b:	e8 60 79 ff ff       	call   807aa0 <pbuf_clen>
  810140:	0f b6 c0             	movzbl %al,%eax
  810143:	66 39 c7             	cmp    %ax,%di
  810146:	73 1c                	jae    810164 <tcp_receive+0x224>
  810148:	c7 44 24 08 0c 4e 81 	movl   $0x814e0c,0x8(%esp)
  81014f:	00 
  810150:	c7 44 24 04 55 03 00 	movl   $0x355,0x4(%esp)
  810157:	00 
  810158:	c7 04 24 78 4f 81 00 	movl   $0x814f78,(%esp)
  81015f:	e8 38 08 ff ff       	call   80099c <_panic>
        pcb->snd_queuelen -= pbuf_clen(next->p);
  810164:	0f b7 7b 70          	movzwl 0x70(%ebx),%edi
  810168:	8b 46 04             	mov    0x4(%esi),%eax
  81016b:	89 04 24             	mov    %eax,(%esp)
  81016e:	e8 2d 79 ff ff       	call   807aa0 <pbuf_clen>
  810173:	0f b6 c0             	movzbl %al,%eax
  810176:	66 29 c7             	sub    %ax,%di
  810179:	66 89 7b 70          	mov    %di,0x70(%ebx)
        tcp_seg_free(next);
  81017d:	89 34 24             	mov    %esi,(%esp)
  810180:	e8 ec 88 ff ff       	call   808a71 <tcp_seg_free>

        LWIP_DEBUGF(TCP_QLEN_DEBUG, ("%"U16_F" (after freeing unacked)\n", (u16_t)pcb->snd_queuelen));
        if (pcb->snd_queuelen != 0) {
  810185:	66 83 7b 70 00       	cmpw   $0x0,0x70(%ebx)
  81018a:	74 28                	je     8101b4 <tcp_receive+0x274>
          LWIP_ASSERT("tcp_receive: valid queue length", pcb->unacked != NULL ||
  81018c:	83 7b 78 00          	cmpl   $0x0,0x78(%ebx)
  810190:	75 22                	jne    8101b4 <tcp_receive+0x274>
  810192:	83 7b 74 00          	cmpl   $0x0,0x74(%ebx)
  810196:	75 1c                	jne    8101b4 <tcp_receive+0x274>
  810198:	c7 44 24 08 34 4e 81 	movl   $0x814e34,0x8(%esp)
  81019f:	00 
  8101a0:	c7 44 24 04 5c 03 00 	movl   $0x35c,0x4(%esp)
  8101a7:	00 
  8101a8:	c7 04 24 78 4f 81 00 	movl   $0x814f78,(%esp)
  8101af:	e8 e8 07 ff ff       	call   80099c <_panic>
                                    pcb->unacked != NULL?
                                    ntohl(pcb->unacked->tcphdr->seqno) + TCP_TCPLEN(pcb->unacked): 0));

      /* Remove segment from the unacknowledged list if the incoming
         ACK acknowlegdes them. */
      while (pcb->unacked != NULL &&
  8101b4:	8b 43 78             	mov    0x78(%ebx),%eax
  8101b7:	85 c0                	test   %eax,%eax
  8101b9:	74 65                	je     810220 <tcp_receive+0x2e0>
             TCP_SEQ_LEQ(ntohl(pcb->unacked->tcphdr->seqno) +
  8101bb:	8b 40 10             	mov    0x10(%eax),%eax
  8101be:	8b 40 04             	mov    0x4(%eax),%eax
  8101c1:	89 04 24             	mov    %eax,(%esp)
  8101c4:	e8 6c ad ff ff       	call   80af35 <ntohl>
  8101c9:	89 c6                	mov    %eax,%esi
  8101cb:	8b 43 78             	mov    0x78(%ebx),%eax
  8101ce:	0f b7 78 0c          	movzwl 0xc(%eax),%edi
  8101d2:	8b 40 10             	mov    0x10(%eax),%eax
  8101d5:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  8101d9:	89 04 24             	mov    %eax,(%esp)
  8101dc:	e8 1f ab ff ff       	call   80ad00 <ntohs>
  8101e1:	a8 01                	test   $0x1,%al
  8101e3:	75 1b                	jne    810200 <tcp_receive+0x2c0>
  8101e5:	8b 43 78             	mov    0x78(%ebx),%eax
  8101e8:	8b 40 10             	mov    0x10(%eax),%eax
  8101eb:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  8101ef:	89 04 24             	mov    %eax,(%esp)
  8101f2:	e8 09 ab ff ff       	call   80ad00 <ntohs>
  8101f7:	ba 00 00 00 00       	mov    $0x0,%edx
  8101fc:	a8 02                	test   $0x2,%al
  8101fe:	74 05                	je     810205 <tcp_receive+0x2c5>
  810200:	ba 01 00 00 00       	mov    $0x1,%edx
                                    pcb->unacked != NULL?
                                    ntohl(pcb->unacked->tcphdr->seqno) + TCP_TCPLEN(pcb->unacked): 0));

      /* Remove segment from the unacknowledged list if the incoming
         ACK acknowlegdes them. */
      while (pcb->unacked != NULL &&
  810205:	2b 35 7c f5 b3 00    	sub    0xb3f57c,%esi
  81020b:	0f b7 ff             	movzwl %di,%edi
  81020e:	01 fa                	add    %edi,%edx
  810210:	01 d6                	add    %edx,%esi
  810212:	85 f6                	test   %esi,%esi
  810214:	0f 8e 0f ff ff ff    	jle    810129 <tcp_receive+0x1e9>
        }
      }

      /* If there's nothing left to acknowledge, stop the retransmit
         timer, otherwise reset it to start again */
      if(pcb->unacked == NULL)
  81021a:	83 7b 78 00          	cmpl   $0x0,0x78(%ebx)
  81021e:	75 08                	jne    810228 <tcp_receive+0x2e8>
        pcb->rtime = -1;
  810220:	66 c7 43 32 ff ff    	movw   $0xffff,0x32(%ebx)
  810226:	eb 06                	jmp    81022e <tcp_receive+0x2ee>
      else
        pcb->rtime = 0;
  810228:	66 c7 43 32 00 00    	movw   $0x0,0x32(%ebx)

      pcb->polltmr = 0;
  81022e:	c6 43 30 00          	movb   $0x0,0x30(%ebx)
        }
      } else {
        LWIP_DEBUGF(TCP_FR_DEBUG, ("tcp_receive: dupack averted %"U32_F" %"U32_F"\n",
                                   pcb->snd_wl1 + pcb->snd_wnd, right_wnd_edge));
      }
    } else if (TCP_SEQ_BETWEEN(ackno, pcb->lastack+1, pcb->snd_max)){
  810232:	e9 b2 00 00 00       	jmp    8102e9 <tcp_receive+0x3a9>
        pcb->rtime = 0;

      pcb->polltmr = 0;
    } else {
      /* Fix bug bug #21582: out of sequence ACK, didn't really ack anything */
      pcb->acked = 0;
  810237:	66 c7 43 6c 00 00    	movw   $0x0,0x6c(%ebx)
  81023d:	8d 76 00             	lea    0x0(%esi),%esi
  810240:	e9 a4 00 00 00       	jmp    8102e9 <tcp_receive+0x3a9>
           ) {
      LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: removing %"U32_F":%"U32_F" from pcb->unsent\n",
                                    ntohl(pcb->unsent->tcphdr->seqno), ntohl(pcb->unsent->tcphdr->seqno) +
                                    TCP_TCPLEN(pcb->unsent)));

      next = pcb->unsent;
  810245:	8b 73 74             	mov    0x74(%ebx),%esi
      pcb->unsent = pcb->unsent->next;
  810248:	8b 06                	mov    (%esi),%eax
  81024a:	89 43 74             	mov    %eax,0x74(%ebx)
      LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_receive: queuelen %"U16_F" ... ", (u16_t)pcb->snd_queuelen));
      LWIP_ASSERT("pcb->snd_queuelen >= pbuf_clen(next->p)", (pcb->snd_queuelen >= pbuf_clen(next->p)));
  81024d:	0f b7 7b 70          	movzwl 0x70(%ebx),%edi
  810251:	8b 46 04             	mov    0x4(%esi),%eax
  810254:	89 04 24             	mov    %eax,(%esp)
  810257:	e8 44 78 ff ff       	call   807aa0 <pbuf_clen>
  81025c:	0f b6 c0             	movzbl %al,%eax
  81025f:	66 39 c7             	cmp    %ax,%di
  810262:	73 1c                	jae    810280 <tcp_receive+0x340>
  810264:	c7 44 24 08 0c 4e 81 	movl   $0x814e0c,0x8(%esp)
  81026b:	00 
  81026c:	c7 44 24 04 7f 03 00 	movl   $0x37f,0x4(%esp)
  810273:	00 
  810274:	c7 04 24 78 4f 81 00 	movl   $0x814f78,(%esp)
  81027b:	e8 1c 07 ff ff       	call   80099c <_panic>
      pcb->snd_queuelen -= pbuf_clen(next->p);
  810280:	0f b7 7b 70          	movzwl 0x70(%ebx),%edi
  810284:	8b 46 04             	mov    0x4(%esi),%eax
  810287:	89 04 24             	mov    %eax,(%esp)
  81028a:	e8 11 78 ff ff       	call   807aa0 <pbuf_clen>
  81028f:	0f b6 c0             	movzbl %al,%eax
  810292:	66 29 c7             	sub    %ax,%di
  810295:	66 89 7b 70          	mov    %di,0x70(%ebx)
      tcp_seg_free(next);
  810299:	89 34 24             	mov    %esi,(%esp)
  81029c:	e8 d0 87 ff ff       	call   808a71 <tcp_seg_free>
      LWIP_DEBUGF(TCP_QLEN_DEBUG, ("%"U16_F" (after freeing unsent)\n", (u16_t)pcb->snd_queuelen));
      if (pcb->snd_queuelen != 0) {
  8102a1:	66 83 7b 70 00       	cmpw   $0x0,0x70(%ebx)
  8102a6:	74 29                	je     8102d1 <tcp_receive+0x391>
        LWIP_ASSERT("tcp_receive: valid queue length",
  8102a8:	83 7b 78 00          	cmpl   $0x0,0x78(%ebx)
  8102ac:	75 23                	jne    8102d1 <tcp_receive+0x391>
  8102ae:	8b 43 74             	mov    0x74(%ebx),%eax
  8102b1:	85 c0                	test   %eax,%eax
  8102b3:	75 23                	jne    8102d8 <tcp_receive+0x398>
  8102b5:	c7 44 24 08 34 4e 81 	movl   $0x814e34,0x8(%esp)
  8102bc:	00 
  8102bd:	c7 44 24 04 85 03 00 	movl   $0x385,0x4(%esp)
  8102c4:	00 
  8102c5:	c7 04 24 78 4f 81 00 	movl   $0x814f78,(%esp)
  8102cc:	e8 cb 06 ff ff       	call   80099c <_panic>
          pcb->unacked != NULL || pcb->unsent != NULL);
      }

      if (pcb->unsent != NULL) {
  8102d1:	8b 43 74             	mov    0x74(%ebx),%eax
  8102d4:	85 c0                	test   %eax,%eax
  8102d6:	74 11                	je     8102e9 <tcp_receive+0x3a9>
        pcb->snd_nxt = htonl(pcb->unsent->tcphdr->seqno);
  8102d8:	8b 40 10             	mov    0x10(%eax),%eax
  8102db:	8b 40 04             	mov    0x4(%eax),%eax
  8102de:	89 04 24             	mov    %eax,(%esp)
  8102e1:	e8 2e aa ff ff       	call   80ad14 <htonl>
  8102e6:	89 43 54             	mov    %eax,0x54(%ebx)
       on the list are acknowledged by the ACK. This may seem
       strange since an "unsent" segment shouldn't be acked. The
       rationale is that lwIP puts all outstanding segments on the
       ->unsent list after a retransmission, so these segments may
       in fact have been sent once. */
    while (pcb->unsent != NULL &&
  8102e9:	8b 43 74             	mov    0x74(%ebx),%eax
  8102ec:	85 c0                	test   %eax,%eax
  8102ee:	74 70                	je     810360 <tcp_receive+0x420>
           /*TCP_SEQ_LEQ(ntohl(pcb->unsent->tcphdr->seqno) + TCP_TCPLEN(pcb->unsent), ackno) &&
             TCP_SEQ_LEQ(ackno, pcb->snd_max)*/
           TCP_SEQ_BETWEEN(ackno, ntohl(pcb->unsent->tcphdr->seqno) + TCP_TCPLEN(pcb->unsent), pcb->snd_max)
  8102f0:	8b 35 7c f5 b3 00    	mov    0xb3f57c,%esi
  8102f6:	8b 40 10             	mov    0x10(%eax),%eax
  8102f9:	8b 40 04             	mov    0x4(%eax),%eax
  8102fc:	89 04 24             	mov    %eax,(%esp)
  8102ff:	e8 31 ac ff ff       	call   80af35 <ntohl>
  810304:	89 c7                	mov    %eax,%edi
  810306:	8b 43 74             	mov    0x74(%ebx),%eax
  810309:	0f b7 50 0c          	movzwl 0xc(%eax),%edx
  81030d:	66 89 55 e4          	mov    %dx,-0x1c(%ebp)
  810311:	8b 40 10             	mov    0x10(%eax),%eax
  810314:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  810318:	89 04 24             	mov    %eax,(%esp)
  81031b:	e8 e0 a9 ff ff       	call   80ad00 <ntohs>
  810320:	a8 01                	test   $0x1,%al
  810322:	75 1b                	jne    81033f <tcp_receive+0x3ff>
  810324:	8b 43 74             	mov    0x74(%ebx),%eax
  810327:	8b 40 10             	mov    0x10(%eax),%eax
  81032a:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  81032e:	89 04 24             	mov    %eax,(%esp)
  810331:	e8 ca a9 ff ff       	call   80ad00 <ntohs>
  810336:	ba 00 00 00 00       	mov    $0x0,%edx
  81033b:	a8 02                	test   $0x2,%al
  81033d:	74 05                	je     810344 <tcp_receive+0x404>
  81033f:	ba 01 00 00 00       	mov    $0x1,%edx
       on the list are acknowledged by the ACK. This may seem
       strange since an "unsent" segment shouldn't be acked. The
       rationale is that lwIP puts all outstanding segments on the
       ->unsent list after a retransmission, so these segments may
       in fact have been sent once. */
    while (pcb->unsent != NULL &&
  810344:	29 fe                	sub    %edi,%esi
  810346:	0f b7 45 e4          	movzwl -0x1c(%ebp),%eax
  81034a:	01 c2                	add    %eax,%edx
  81034c:	39 d6                	cmp    %edx,%esi
  81034e:	78 10                	js     810360 <tcp_receive+0x420>
           /*TCP_SEQ_LEQ(ntohl(pcb->unsent->tcphdr->seqno) + TCP_TCPLEN(pcb->unsent), ackno) &&
             TCP_SEQ_LEQ(ackno, pcb->snd_max)*/
           TCP_SEQ_BETWEEN(ackno, ntohl(pcb->unsent->tcphdr->seqno) + TCP_TCPLEN(pcb->unsent), pcb->snd_max)
  810350:	a1 7c f5 b3 00       	mov    0xb3f57c,%eax
  810355:	2b 43 58             	sub    0x58(%ebx),%eax
  810358:	85 c0                	test   %eax,%eax
  81035a:	0f 8e e5 fe ff ff    	jle    810245 <tcp_receive+0x305>
                                pcb->rttest, pcb->rtseq, ackno));

    /* RTT estimation calculations. This is done by checking if the
       incoming segment acknowledges the segment we use to take a
       round-trip time measurement. */
    if (pcb->rttest && TCP_SEQ_LT(pcb->rtseq, ackno)) {
  810360:	8b 43 38             	mov    0x38(%ebx),%eax
  810363:	85 c0                	test   %eax,%eax
  810365:	74 5d                	je     8103c4 <tcp_receive+0x484>
  810367:	8b 35 7c f5 b3 00    	mov    0xb3f57c,%esi
  81036d:	39 73 3c             	cmp    %esi,0x3c(%ebx)
  810370:	79 52                	jns    8103c4 <tcp_receive+0x484>

      LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_receive: experienced rtt %"U16_F" ticks (%"U16_F" msec).\n",
                                  m, m * TCP_SLOW_INTERVAL));

      /* This is taken directly from VJs original code in his paper */
      m = m - (pcb->sa >> 3);
  810372:	0f b7 53 40          	movzwl 0x40(%ebx),%edx
  810376:	8b 0d 0c f6 b3 00    	mov    0xb3f60c,%ecx
  81037c:	66 29 c1             	sub    %ax,%cx
  81037f:	89 c8                	mov    %ecx,%eax
  810381:	89 d1                	mov    %edx,%ecx
  810383:	66 c1 f9 03          	sar    $0x3,%cx
  810387:	66 29 c8             	sub    %cx,%ax
      pcb->sa += m;
  81038a:	8d 14 10             	lea    (%eax,%edx,1),%edx
  81038d:	66 89 53 40          	mov    %dx,0x40(%ebx)
      if (m < 0) {
        m = -m;
      }
      m = m - (pcb->sv >> 2);
  810391:	0f b7 4b 42          	movzwl 0x42(%ebx),%ecx
      pcb->sv += m;
  810395:	89 ce                	mov    %ecx,%esi
  810397:	66 c1 fe 02          	sar    $0x2,%si
  81039b:	66 29 f1             	sub    %si,%cx
  81039e:	89 ce                	mov    %ecx,%esi
  8103a0:	89 c1                	mov    %eax,%ecx
  8103a2:	66 c1 f9 0f          	sar    $0xf,%cx
  8103a6:	31 c8                	xor    %ecx,%eax
  8103a8:	66 29 c8             	sub    %cx,%ax
  8103ab:	8d 04 06             	lea    (%esi,%eax,1),%eax
  8103ae:	66 89 43 42          	mov    %ax,0x42(%ebx)
      pcb->rto = (pcb->sa >> 3) + pcb->sv;
  8103b2:	66 c1 fa 03          	sar    $0x3,%dx
  8103b6:	8d 04 02             	lea    (%edx,%eax,1),%eax
  8103b9:	66 89 43 44          	mov    %ax,0x44(%ebx)

      LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_receive: RTO %"U16_F" (%"U16_F" milliseconds)\n",
                                  pcb->rto, pcb->rto * TCP_SLOW_INTERVAL));

      pcb->rttest = 0;
  8103bd:	c7 43 38 00 00 00 00 	movl   $0x0,0x38(%ebx)
    }
  }

  /* If the incoming segment contains data, we must process it
     further. */
  if (tcplen > 0) {
  8103c4:	0f b7 0d 82 f5 b3 00 	movzwl 0xb3f582,%ecx
  8103cb:	66 85 c9             	test   %cx,%cx
  8103ce:	0f 84 a5 07 00 00    	je     810b79 <tcp_receive+0xc39>
       this if the sequence number of the incoming segment is less
       than rcv_nxt, and the sequence number plus the length of the
       segment is larger than rcv_nxt. */
    /*    if (TCP_SEQ_LT(seqno, pcb->rcv_nxt)){
          if (TCP_SEQ_LT(pcb->rcv_nxt, seqno + tcplen)) {*/
    if (TCP_SEQ_BETWEEN(pcb->rcv_nxt, seqno + 1, seqno + tcplen - 1)){
  8103d4:	8b 53 24             	mov    0x24(%ebx),%edx
  8103d7:	a1 78 f5 b3 00       	mov    0xb3f578,%eax
  8103dc:	89 c6                	mov    %eax,%esi
  8103de:	f7 d6                	not    %esi
  8103e0:	01 d6                	add    %edx,%esi
  8103e2:	0f 88 3a 01 00 00    	js     810522 <tcp_receive+0x5e2>
  8103e8:	8d 7a 01             	lea    0x1(%edx),%edi
  8103eb:	29 c7                	sub    %eax,%edi
  8103ed:	0f b7 f1             	movzwl %cx,%esi
  8103f0:	89 f9                	mov    %edi,%ecx
  8103f2:	29 f1                	sub    %esi,%ecx
  8103f4:	85 c9                	test   %ecx,%ecx
  8103f6:	0f 8f 26 01 00 00    	jg     810522 <tcp_receive+0x5e2>
         After we are done with adjusting the pbuf pointers we must
         adjust the ->data pointer in the seg and the segment
         length.*/

      off = pcb->rcv_nxt - seqno;
      p = inseg.p;
  8103fc:	8b 35 60 f5 b3 00    	mov    0xb3f560,%esi
      LWIP_ASSERT("inseg.p != NULL", inseg.p);
  810402:	85 f6                	test   %esi,%esi
  810404:	75 1c                	jne    810422 <tcp_receive+0x4e2>
  810406:	c7 44 24 08 8f 4f 81 	movl   $0x814f8f,0x8(%esp)
  81040d:	00 
  81040e:	c7 44 24 04 e5 03 00 	movl   $0x3e5,0x4(%esp)
  810415:	00 
  810416:	c7 04 24 78 4f 81 00 	movl   $0x814f78,(%esp)
  81041d:	e8 7a 05 ff ff       	call   80099c <_panic>

         After we are done with adjusting the pbuf pointers we must
         adjust the ->data pointer in the seg and the segment
         length.*/

      off = pcb->rcv_nxt - seqno;
  810422:	29 c2                	sub    %eax,%edx
      p = inseg.p;
      LWIP_ASSERT("inseg.p != NULL", inseg.p);
      LWIP_ASSERT("insane offset!", (off < 0x7fff));
  810424:	81 fa fe 7f 00 00    	cmp    $0x7ffe,%edx
  81042a:	7e 1c                	jle    810448 <tcp_receive+0x508>
  81042c:	c7 44 24 08 9f 4f 81 	movl   $0x814f9f,0x8(%esp)
  810433:	00 
  810434:	c7 44 24 04 e6 03 00 	movl   $0x3e6,0x4(%esp)
  81043b:	00 
  81043c:	c7 04 24 78 4f 81 00 	movl   $0x814f78,(%esp)
  810443:	e8 54 05 ff ff       	call   80099c <_panic>
      if (inseg.p->len < off) {
  810448:	0f b7 46 0a          	movzwl 0xa(%esi),%eax
  81044c:	39 c2                	cmp    %eax,%edx
  81044e:	7e 71                	jle    8104c1 <tcp_receive+0x581>
        LWIP_ASSERT("pbuf too short!", (((s32_t)inseg.p->tot_len) >= off));
  810450:	0f b7 4e 08          	movzwl 0x8(%esi),%ecx
  810454:	0f b7 f9             	movzwl %cx,%edi
  810457:	39 fa                	cmp    %edi,%edx
  810459:	7e 1c                	jle    810477 <tcp_receive+0x537>
  81045b:	c7 44 24 08 ae 4f 81 	movl   $0x814fae,0x8(%esp)
  810462:	00 
  810463:	c7 44 24 04 e8 03 00 	movl   $0x3e8,0x4(%esp)
  81046a:	00 
  81046b:	c7 04 24 78 4f 81 00 	movl   $0x814f78,(%esp)
  810472:	e8 25 05 ff ff       	call   80099c <_panic>
        new_tot_len = (u16_t)(inseg.p->tot_len - off);
  810477:	66 29 d1             	sub    %dx,%cx
        while (p->len < off) {
          off -= p->len;
  81047a:	29 c2                	sub    %eax,%edx
          /* KJM following line changed (with addition of new_tot_len var)
             to fix bug #9076
             inseg.p->tot_len -= p->len; */
          p->tot_len = new_tot_len;
  81047c:	66 89 4e 08          	mov    %cx,0x8(%esi)
          p->len = 0;
  810480:	66 c7 46 0a 00 00    	movw   $0x0,0xa(%esi)
          p = p->next;
  810486:	8b 36                	mov    (%esi),%esi
      LWIP_ASSERT("inseg.p != NULL", inseg.p);
      LWIP_ASSERT("insane offset!", (off < 0x7fff));
      if (inseg.p->len < off) {
        LWIP_ASSERT("pbuf too short!", (((s32_t)inseg.p->tot_len) >= off));
        new_tot_len = (u16_t)(inseg.p->tot_len - off);
        while (p->len < off) {
  810488:	0f b7 46 0a          	movzwl 0xa(%esi),%eax
  81048c:	39 d0                	cmp    %edx,%eax
  81048e:	7c ea                	jl     81047a <tcp_receive+0x53a>
             inseg.p->tot_len -= p->len; */
          p->tot_len = new_tot_len;
          p->len = 0;
          p = p->next;
        }
        if(pbuf_header(p, (s16_t)-off)) {
  810490:	f7 da                	neg    %edx
  810492:	0f bf c2             	movswl %dx,%eax
  810495:	89 44 24 04          	mov    %eax,0x4(%esp)
  810499:	89 34 24             	mov    %esi,(%esp)
  81049c:	e8 f2 76 ff ff       	call   807b93 <pbuf_header>
  8104a1:	84 c0                	test   %al,%al
  8104a3:	74 4d                	je     8104f2 <tcp_receive+0x5b2>
          /* Do we need to cope with this failing?  Assert for now */
          LWIP_ASSERT("pbuf_header failed", 0);
  8104a5:	c7 44 24 08 be 4f 81 	movl   $0x814fbe,0x8(%esp)
  8104ac:	00 
  8104ad:	c7 44 24 04 f5 03 00 	movl   $0x3f5,0x4(%esp)
  8104b4:	00 
  8104b5:	c7 04 24 78 4f 81 00 	movl   $0x814f78,(%esp)
  8104bc:	e8 db 04 ff ff       	call   80099c <_panic>
        }
      } else {
        if(pbuf_header(inseg.p, (s16_t)-off)) {
  8104c1:	f7 da                	neg    %edx
  8104c3:	0f bf c2             	movswl %dx,%eax
  8104c6:	89 44 24 04          	mov    %eax,0x4(%esp)
  8104ca:	89 34 24             	mov    %esi,(%esp)
  8104cd:	e8 c1 76 ff ff       	call   807b93 <pbuf_header>
  8104d2:	84 c0                	test   %al,%al
  8104d4:	74 1c                	je     8104f2 <tcp_receive+0x5b2>
          /* Do we need to cope with this failing?  Assert for now */
          LWIP_ASSERT("pbuf_header failed", 0);
  8104d6:	c7 44 24 08 be 4f 81 	movl   $0x814fbe,0x8(%esp)
  8104dd:	00 
  8104de:	c7 44 24 04 fa 03 00 	movl   $0x3fa,0x4(%esp)
  8104e5:	00 
  8104e6:	c7 04 24 78 4f 81 00 	movl   $0x814f78,(%esp)
  8104ed:	e8 aa 04 ff ff       	call   80099c <_panic>
        }
      }
      /* KJM following line changed to use p->payload rather than inseg->p->payload
         to fix bug #9076 */
      inseg.dataptr = p->payload;
  8104f2:	8b 46 04             	mov    0x4(%esi),%eax
  8104f5:	a3 64 f5 b3 00       	mov    %eax,0xb3f564
      inseg.len -= (u16_t)(pcb->rcv_nxt - seqno);
  8104fa:	b8 68 f5 b3 00       	mov    $0xb3f568,%eax
  8104ff:	8b 15 78 f5 b3 00    	mov    0xb3f578,%edx
  810505:	66 03 10             	add    (%eax),%dx
  810508:	66 2b 53 24          	sub    0x24(%ebx),%dx
  81050c:	66 89 10             	mov    %dx,(%eax)
      inseg.tcphdr->seqno = seqno = pcb->rcv_nxt;
  81050f:	8b 43 24             	mov    0x24(%ebx),%eax
  810512:	a3 78 f5 b3 00       	mov    %eax,0xb3f578
  810517:	8b 15 6c f5 b3 00    	mov    0xb3f56c,%edx
  81051d:	89 42 04             	mov    %eax,0x4(%edx)
       this if the sequence number of the incoming segment is less
       than rcv_nxt, and the sequence number plus the length of the
       segment is larger than rcv_nxt. */
    /*    if (TCP_SEQ_LT(seqno, pcb->rcv_nxt)){
          if (TCP_SEQ_LT(pcb->rcv_nxt, seqno + tcplen)) {*/
    if (TCP_SEQ_BETWEEN(pcb->rcv_nxt, seqno + 1, seqno + tcplen - 1)){
  810520:	eb 10                	jmp    810532 <tcp_receive+0x5f2>
      inseg.dataptr = p->payload;
      inseg.len -= (u16_t)(pcb->rcv_nxt - seqno);
      inseg.tcphdr->seqno = seqno = pcb->rcv_nxt;
    }
    else {
      if (TCP_SEQ_LT(seqno, pcb->rcv_nxt)){
  810522:	39 d0                	cmp    %edx,%eax
  810524:	79 1c                	jns    810542 <tcp_receive+0x602>
        /* the whole segment is < rcv_nxt */
        /* must be a duplicate of a packet that has already been correctly handled */

        LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: duplicate seqno %"U32_F"\n", seqno));
        tcp_ack_now(pcb);
  810526:	80 4b 20 02          	orb    $0x2,0x20(%ebx)
  81052a:	89 1c 24             	mov    %ebx,(%esp)
  81052d:	e8 49 ae ff ff       	call   80b37b <tcp_output>
    }

    /* The sequence number must be within the window (above rcv_nxt
       and below rcv_nxt + rcv_wnd) in order to be further
       processed. */
    if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, 
  810532:	a1 78 f5 b3 00       	mov    0xb3f578,%eax
  810537:	8b 53 24             	mov    0x24(%ebx),%edx
  81053a:	39 d0                	cmp    %edx,%eax
  81053c:	0f 88 24 06 00 00    	js     810b66 <tcp_receive+0xc26>
  810542:	0f b7 4b 28          	movzwl 0x28(%ebx),%ecx
  810546:	89 c7                	mov    %eax,%edi
  810548:	29 cf                	sub    %ecx,%edi
  81054a:	8d 4f 01             	lea    0x1(%edi),%ecx
  81054d:	29 d1                	sub    %edx,%ecx
  81054f:	85 c9                	test   %ecx,%ecx
  810551:	0f 8f 0f 06 00 00    	jg     810b66 <tcp_receive+0xc26>
                        pcb->rcv_nxt + pcb->rcv_wnd - 1)){
      if (pcb->rcv_nxt == seqno) {
  810557:	39 d0                	cmp    %edx,%eax
  810559:	0f 85 95 03 00 00    	jne    8108f4 <tcp_receive+0x9b4>
        accepted_inseq = 1; 
        /* The incoming segment is the next in sequence. We check if
           we have to trim the end of the segment and update rcv_nxt
           and pass the data to the application. */
#if TCP_QUEUE_OOSEQ
        if (pcb->ooseq != NULL &&
  81055f:	8b 53 7c             	mov    0x7c(%ebx),%edx
  810562:	85 d2                	test   %edx,%edx
  810564:	0f 84 86 00 00 00    	je     8105f0 <tcp_receive+0x6b0>
                TCP_SEQ_LEQ(pcb->ooseq->tcphdr->seqno, seqno + inseg.len)) {
  81056a:	8b 4a 10             	mov    0x10(%edx),%ecx
  81056d:	8b 49 04             	mov    0x4(%ecx),%ecx
        accepted_inseq = 1; 
        /* The incoming segment is the next in sequence. We check if
           we have to trim the end of the segment and update rcv_nxt
           and pass the data to the application. */
#if TCP_QUEUE_OOSEQ
        if (pcb->ooseq != NULL &&
  810570:	0f b7 35 68 f5 b3 00 	movzwl 0xb3f568,%esi
  810577:	89 cf                	mov    %ecx,%edi
  810579:	29 f7                	sub    %esi,%edi
  81057b:	89 fe                	mov    %edi,%esi
  81057d:	29 c6                	sub    %eax,%esi
  81057f:	85 f6                	test   %esi,%esi
  810581:	7f 6d                	jg     8105f0 <tcp_receive+0x6b0>
                TCP_SEQ_LEQ(pcb->ooseq->tcphdr->seqno, seqno + inseg.len)) {
          if (pcb->ooseq->len > 0) {
  810583:	66 83 7a 0c 00       	cmpw   $0x0,0xc(%edx)
  810588:	74 20                	je     8105aa <tcp_receive+0x66a>
            /* We have to trim the second edge of the incoming
               segment. */
            inseg.len = (u16_t)(pcb->ooseq->tcphdr->seqno - seqno);
  81058a:	66 29 c1             	sub    %ax,%cx
  81058d:	66 89 0d 68 f5 b3 00 	mov    %cx,0xb3f568
            pbuf_realloc(inseg.p, inseg.len);
  810594:	0f b7 c1             	movzwl %cx,%eax
  810597:	89 44 24 04          	mov    %eax,0x4(%esp)
  81059b:	a1 60 f5 b3 00       	mov    0xb3f560,%eax
  8105a0:	89 04 24             	mov    %eax,(%esp)
  8105a3:	e8 e1 7a ff ff       	call   808089 <pbuf_realloc>
  8105a8:	eb 46                	jmp    8105f0 <tcp_receive+0x6b0>
          } else {
            /* does the ooseq segment contain only flags that are in inseg also? */
            if ((TCPH_FLAGS(inseg.tcphdr) & (TCP_FIN|TCP_SYN)) ==
  8105aa:	a1 6c f5 b3 00       	mov    0xb3f56c,%eax
  8105af:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  8105b3:	89 04 24             	mov    %eax,(%esp)
  8105b6:	e8 45 a7 ff ff       	call   80ad00 <ntohs>
  8105bb:	89 c6                	mov    %eax,%esi
  8105bd:	8b 43 7c             	mov    0x7c(%ebx),%eax
  8105c0:	8b 40 10             	mov    0x10(%eax),%eax
  8105c3:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  8105c7:	89 04 24             	mov    %eax,(%esp)
  8105ca:	e8 31 a7 ff ff       	call   80ad00 <ntohs>
  8105cf:	31 c6                	xor    %eax,%esi
  8105d1:	66 f7 c6 03 00       	test   $0x3,%si
  8105d6:	75 18                	jne    8105f0 <tcp_receive+0x6b0>
                (TCPH_FLAGS(pcb->ooseq->tcphdr) & (TCP_FIN|TCP_SYN))) {
              struct tcp_seg *old_ooseq = pcb->ooseq;
  8105d8:	8b 43 7c             	mov    0x7c(%ebx),%eax
              pcb->ooseq = pcb->ooseq->next;
  8105db:	8b 10                	mov    (%eax),%edx
  8105dd:	89 53 7c             	mov    %edx,0x7c(%ebx)
              memp_free(MEMP_TCP_SEG, old_ooseq);
  8105e0:	89 44 24 04          	mov    %eax,0x4(%esp)
  8105e4:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
  8105eb:	e8 84 71 ff ff       	call   807774 <memp_free>
            }
          }
        }
#endif /* TCP_QUEUE_OOSEQ */

        tcplen = TCP_TCPLEN(&inseg);
  8105f0:	0f b7 35 68 f5 b3 00 	movzwl 0xb3f568,%esi
  8105f7:	a1 6c f5 b3 00       	mov    0xb3f56c,%eax
  8105fc:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  810600:	89 04 24             	mov    %eax,(%esp)
  810603:	e8 f8 a6 ff ff       	call   80ad00 <ntohs>
  810608:	a8 01                	test   $0x1,%al
  81060a:	75 1a                	jne    810626 <tcp_receive+0x6e6>
  81060c:	a1 6c f5 b3 00       	mov    0xb3f56c,%eax
  810611:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  810615:	89 04 24             	mov    %eax,(%esp)
  810618:	e8 e3 a6 ff ff       	call   80ad00 <ntohs>
  81061d:	ba 00 00 00 00       	mov    $0x0,%edx
  810622:	a8 02                	test   $0x2,%al
  810624:	74 05                	je     81062b <tcp_receive+0x6eb>
  810626:	ba 01 00 00 00       	mov    $0x1,%edx
  81062b:	01 d6                	add    %edx,%esi
  81062d:	66 89 35 82 f5 b3 00 	mov    %si,0xb3f582

        /* First received FIN will be ACKed +1, on any successive (duplicate)
         * FINs we are already in CLOSE_WAIT and have already done +1.
         */
        if (pcb->state != CLOSE_WAIT) {
  810634:	83 7b 10 07          	cmpl   $0x7,0x10(%ebx)
  810638:	74 06                	je     810640 <tcp_receive+0x700>
          pcb->rcv_nxt += tcplen;
  81063a:	0f b7 f6             	movzwl %si,%esi
  81063d:	01 73 24             	add    %esi,0x24(%ebx)
        }

        /* Update the receiver's (our) window. */
        if (pcb->rcv_wnd < tcplen) {
  810640:	0f b7 53 28          	movzwl 0x28(%ebx),%edx
  810644:	0f b7 05 82 f5 b3 00 	movzwl 0xb3f582,%eax
  81064b:	66 39 c2             	cmp    %ax,%dx
  81064e:	73 08                	jae    810658 <tcp_receive+0x718>
          pcb->rcv_wnd = 0;
  810650:	66 c7 43 28 00 00    	movw   $0x0,0x28(%ebx)
  810656:	eb 07                	jmp    81065f <tcp_receive+0x71f>
        } else {
          pcb->rcv_wnd -= tcplen;
  810658:	66 29 c2             	sub    %ax,%dx
  81065b:	66 89 53 28          	mov    %dx,0x28(%ebx)
        }

        if (pcb->rcv_ann_wnd < tcplen) {
  81065f:	0f b7 53 2a          	movzwl 0x2a(%ebx),%edx
  810663:	0f b7 05 82 f5 b3 00 	movzwl 0xb3f582,%eax
  81066a:	66 39 c2             	cmp    %ax,%dx
  81066d:	73 08                	jae    810677 <tcp_receive+0x737>
          pcb->rcv_ann_wnd = 0;
  81066f:	66 c7 43 2a 00 00    	movw   $0x0,0x2a(%ebx)
  810675:	eb 07                	jmp    81067e <tcp_receive+0x73e>
        } else {
          pcb->rcv_ann_wnd -= tcplen;
  810677:	66 29 c2             	sub    %ax,%dx
  81067a:	66 89 53 2a          	mov    %dx,0x2a(%ebx)
           chains its data on this pbuf as well.

           If the segment was a FIN, we set the TF_GOT_FIN flag that will
           be used to indicate to the application that the remote side has
           closed its end of the connection. */
        if (inseg.p->tot_len > 0) {
  81067e:	a1 60 f5 b3 00       	mov    0xb3f560,%eax
  810683:	66 83 78 08 00       	cmpw   $0x0,0x8(%eax)
  810688:	74 0f                	je     810699 <tcp_receive+0x759>
          recv_data = inseg.p;
  81068a:	a3 88 f5 b3 00       	mov    %eax,0xb3f588
          /* Since this pbuf now is the responsibility of the
             application, we delete our reference to it so that we won't
             (mistakingly) deallocate it. */
          inseg.p = NULL;
  81068f:	c7 05 60 f5 b3 00 00 	movl   $0x0,0xb3f560
  810696:	00 00 00 
        }
        if (TCPH_FLAGS(inseg.tcphdr) & TCP_FIN) {
  810699:	a1 6c f5 b3 00       	mov    0xb3f56c,%eax
  81069e:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  8106a2:	89 04 24             	mov    %eax,(%esp)
  8106a5:	e8 56 a6 ff ff       	call   80ad00 <ntohs>
  8106aa:	a8 01                	test   $0x1,%al
  8106ac:	74 07                	je     8106b5 <tcp_receive+0x775>
          LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: received FIN.\n"));
          recv_flags = TF_GOT_FIN;
  8106ae:	c6 05 84 f5 b3 00 20 	movb   $0x20,0xb3f584
        }

#if TCP_QUEUE_OOSEQ
        /* We now check if we have segments on the ->ooseq queue that
           is now in sequence. */
        while (pcb->ooseq != NULL &&
  8106b5:	8b 73 7c             	mov    0x7c(%ebx),%esi
  8106b8:	85 f6                	test   %esi,%esi
  8106ba:	0f 84 01 02 00 00    	je     8108c1 <tcp_receive+0x981>
               pcb->ooseq->tcphdr->seqno == pcb->rcv_nxt) {
  8106c0:	8b 46 10             	mov    0x10(%esi),%eax
  8106c3:	8b 40 04             	mov    0x4(%eax),%eax
  8106c6:	3b 43 24             	cmp    0x24(%ebx),%eax
  8106c9:	0f 85 f2 01 00 00    	jne    8108c1 <tcp_receive+0x981>

          cseg = pcb->ooseq;
          seqno = pcb->ooseq->tcphdr->seqno;
  8106cf:	a3 78 f5 b3 00       	mov    %eax,0xb3f578

          pcb->rcv_nxt += TCP_TCPLEN(cseg);
  8106d4:	8b 43 24             	mov    0x24(%ebx),%eax
  8106d7:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8106da:	0f b7 7e 0c          	movzwl 0xc(%esi),%edi
  8106de:	8b 46 10             	mov    0x10(%esi),%eax
  8106e1:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  8106e5:	89 04 24             	mov    %eax,(%esp)
  8106e8:	e8 13 a6 ff ff       	call   80ad00 <ntohs>
  8106ed:	a8 01                	test   $0x1,%al
  8106ef:	75 18                	jne    810709 <tcp_receive+0x7c9>
  8106f1:	8b 46 10             	mov    0x10(%esi),%eax
  8106f4:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  8106f8:	89 04 24             	mov    %eax,(%esp)
  8106fb:	e8 00 a6 ff ff       	call   80ad00 <ntohs>
  810700:	ba 00 00 00 00       	mov    $0x0,%edx
  810705:	a8 02                	test   $0x2,%al
  810707:	74 05                	je     81070e <tcp_receive+0x7ce>
  810709:	ba 01 00 00 00       	mov    $0x1,%edx
  81070e:	0f b7 ff             	movzwl %di,%edi
  810711:	01 fa                	add    %edi,%edx
  810713:	03 55 e4             	add    -0x1c(%ebp),%edx
  810716:	89 53 24             	mov    %edx,0x24(%ebx)
          if (pcb->rcv_wnd < TCP_TCPLEN(cseg)) {
  810719:	0f b7 7b 28          	movzwl 0x28(%ebx),%edi
  81071d:	0f b7 56 0c          	movzwl 0xc(%esi),%edx
  810721:	66 89 55 e4          	mov    %dx,-0x1c(%ebp)
  810725:	8b 46 10             	mov    0x10(%esi),%eax
  810728:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  81072c:	89 04 24             	mov    %eax,(%esp)
  81072f:	e8 cc a5 ff ff       	call   80ad00 <ntohs>
  810734:	a8 01                	test   $0x1,%al
  810736:	75 18                	jne    810750 <tcp_receive+0x810>
  810738:	8b 46 10             	mov    0x10(%esi),%eax
  81073b:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  81073f:	89 04 24             	mov    %eax,(%esp)
  810742:	e8 b9 a5 ff ff       	call   80ad00 <ntohs>
  810747:	ba 00 00 00 00       	mov    $0x0,%edx
  81074c:	a8 02                	test   $0x2,%al
  81074e:	74 05                	je     810755 <tcp_receive+0x815>
  810750:	ba 01 00 00 00       	mov    $0x1,%edx
  810755:	0f b7 ff             	movzwl %di,%edi
  810758:	0f b7 45 e4          	movzwl -0x1c(%ebp),%eax
  81075c:	01 c2                	add    %eax,%edx
  81075e:	39 d7                	cmp    %edx,%edi
  810760:	7d 08                	jge    81076a <tcp_receive+0x82a>
            pcb->rcv_wnd = 0;
  810762:	66 c7 43 28 00 00    	movw   $0x0,0x28(%ebx)
  810768:	eb 47                	jmp    8107b1 <tcp_receive+0x871>
          } else {
            pcb->rcv_wnd -= TCP_TCPLEN(cseg);
  81076a:	0f b7 7b 28          	movzwl 0x28(%ebx),%edi
  81076e:	0f b7 46 0c          	movzwl 0xc(%esi),%eax
  810772:	66 89 45 e4          	mov    %ax,-0x1c(%ebp)
  810776:	8b 46 10             	mov    0x10(%esi),%eax
  810779:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  81077d:	89 04 24             	mov    %eax,(%esp)
  810780:	e8 7b a5 ff ff       	call   80ad00 <ntohs>
  810785:	a8 01                	test   $0x1,%al
  810787:	75 18                	jne    8107a1 <tcp_receive+0x861>
  810789:	8b 46 10             	mov    0x10(%esi),%eax
  81078c:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  810790:	89 04 24             	mov    %eax,(%esp)
  810793:	e8 68 a5 ff ff       	call   80ad00 <ntohs>
  810798:	ba 00 00 00 00       	mov    $0x0,%edx
  81079d:	a8 02                	test   $0x2,%al
  81079f:	74 05                	je     8107a6 <tcp_receive+0x866>
  8107a1:	ba 01 00 00 00       	mov    $0x1,%edx
  8107a6:	66 2b 7d e4          	sub    -0x1c(%ebp),%di
  8107aa:	66 29 d7             	sub    %dx,%di
  8107ad:	66 89 7b 28          	mov    %di,0x28(%ebx)
          }
          if (pcb->rcv_ann_wnd < TCP_TCPLEN(cseg)) {
  8107b1:	0f b7 7b 2a          	movzwl 0x2a(%ebx),%edi
  8107b5:	0f b7 56 0c          	movzwl 0xc(%esi),%edx
  8107b9:	66 89 55 e4          	mov    %dx,-0x1c(%ebp)
  8107bd:	8b 46 10             	mov    0x10(%esi),%eax
  8107c0:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  8107c4:	89 04 24             	mov    %eax,(%esp)
  8107c7:	e8 34 a5 ff ff       	call   80ad00 <ntohs>
  8107cc:	a8 01                	test   $0x1,%al
  8107ce:	75 18                	jne    8107e8 <tcp_receive+0x8a8>
  8107d0:	8b 46 10             	mov    0x10(%esi),%eax
  8107d3:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  8107d7:	89 04 24             	mov    %eax,(%esp)
  8107da:	e8 21 a5 ff ff       	call   80ad00 <ntohs>
  8107df:	ba 00 00 00 00       	mov    $0x0,%edx
  8107e4:	a8 02                	test   $0x2,%al
  8107e6:	74 05                	je     8107ed <tcp_receive+0x8ad>
  8107e8:	ba 01 00 00 00       	mov    $0x1,%edx
  8107ed:	0f b7 ff             	movzwl %di,%edi
  8107f0:	0f b7 45 e4          	movzwl -0x1c(%ebp),%eax
  8107f4:	01 c2                	add    %eax,%edx
  8107f6:	39 d7                	cmp    %edx,%edi
  8107f8:	7d 08                	jge    810802 <tcp_receive+0x8c2>
            pcb->rcv_ann_wnd = 0;
  8107fa:	66 c7 43 2a 00 00    	movw   $0x0,0x2a(%ebx)
  810800:	eb 47                	jmp    810849 <tcp_receive+0x909>
          } else {
            pcb->rcv_ann_wnd -= TCP_TCPLEN(cseg);
  810802:	0f b7 7b 2a          	movzwl 0x2a(%ebx),%edi
  810806:	0f b7 46 0c          	movzwl 0xc(%esi),%eax
  81080a:	66 89 45 e4          	mov    %ax,-0x1c(%ebp)
  81080e:	8b 46 10             	mov    0x10(%esi),%eax
  810811:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  810815:	89 04 24             	mov    %eax,(%esp)
  810818:	e8 e3 a4 ff ff       	call   80ad00 <ntohs>
  81081d:	a8 01                	test   $0x1,%al
  81081f:	75 18                	jne    810839 <tcp_receive+0x8f9>
  810821:	8b 46 10             	mov    0x10(%esi),%eax
  810824:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  810828:	89 04 24             	mov    %eax,(%esp)
  81082b:	e8 d0 a4 ff ff       	call   80ad00 <ntohs>
  810830:	ba 00 00 00 00       	mov    $0x0,%edx
  810835:	a8 02                	test   $0x2,%al
  810837:	74 05                	je     81083e <tcp_receive+0x8fe>
  810839:	ba 01 00 00 00       	mov    $0x1,%edx
  81083e:	66 2b 7d e4          	sub    -0x1c(%ebp),%di
  810842:	66 29 d7             	sub    %dx,%di
  810845:	66 89 7b 2a          	mov    %di,0x2a(%ebx)
          }

          if (cseg->p->tot_len > 0) {
  810849:	8b 46 04             	mov    0x4(%esi),%eax
  81084c:	66 83 78 08 00       	cmpw   $0x0,0x8(%eax)
  810851:	74 24                	je     810877 <tcp_receive+0x937>
            /* Chain this pbuf onto the pbuf that we will pass to
               the application. */
            if (recv_data) {
  810853:	8b 15 88 f5 b3 00    	mov    0xb3f588,%edx
  810859:	85 d2                	test   %edx,%edx
  81085b:	74 0e                	je     81086b <tcp_receive+0x92b>
              pbuf_cat(recv_data, cseg->p);
  81085d:	89 44 24 04          	mov    %eax,0x4(%esp)
  810861:	89 14 24             	mov    %edx,(%esp)
  810864:	e8 62 72 ff ff       	call   807acb <pbuf_cat>
  810869:	eb 05                	jmp    810870 <tcp_receive+0x930>
            } else {
              recv_data = cseg->p;
  81086b:	a3 88 f5 b3 00       	mov    %eax,0xb3f588
            }
            cseg->p = NULL;
  810870:	c7 46 04 00 00 00 00 	movl   $0x0,0x4(%esi)
          }
          if (TCPH_FLAGS(cseg->tcphdr) & TCP_FIN) {
  810877:	8b 46 10             	mov    0x10(%esi),%eax
  81087a:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  81087e:	89 04 24             	mov    %eax,(%esp)
  810881:	e8 7a a4 ff ff       	call   80ad00 <ntohs>
  810886:	a8 01                	test   $0x1,%al
  810888:	74 14                	je     81089e <tcp_receive+0x95e>
            LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: dequeued FIN.\n"));
            recv_flags = TF_GOT_FIN;
  81088a:	c6 05 84 f5 b3 00 20 	movb   $0x20,0xb3f584
            if (pcb->state == ESTABLISHED) { /* force passive close or we can move to active close */
  810891:	83 7b 10 04          	cmpl   $0x4,0x10(%ebx)
  810895:	75 07                	jne    81089e <tcp_receive+0x95e>
              pcb->state = CLOSE_WAIT;
  810897:	c7 43 10 07 00 00 00 	movl   $0x7,0x10(%ebx)
            } 
          }


          pcb->ooseq = cseg->next;
  81089e:	8b 06                	mov    (%esi),%eax
  8108a0:	89 43 7c             	mov    %eax,0x7c(%ebx)
          tcp_seg_free(cseg);
  8108a3:	89 34 24             	mov    %esi,(%esp)
  8108a6:	e8 c6 81 ff ff       	call   808a71 <tcp_seg_free>
        }

#if TCP_QUEUE_OOSEQ
        /* We now check if we have segments on the ->ooseq queue that
           is now in sequence. */
        while (pcb->ooseq != NULL &&
  8108ab:	8b 73 7c             	mov    0x7c(%ebx),%esi
  8108ae:	85 f6                	test   %esi,%esi
  8108b0:	74 0f                	je     8108c1 <tcp_receive+0x981>
               pcb->ooseq->tcphdr->seqno == pcb->rcv_nxt) {
  8108b2:	8b 46 10             	mov    0x10(%esi),%eax
  8108b5:	8b 40 04             	mov    0x4(%eax),%eax
  8108b8:	3b 43 24             	cmp    0x24(%ebx),%eax
  8108bb:	0f 84 0e fe ff ff    	je     8106cf <tcp_receive+0x78f>
        }
#endif /* TCP_QUEUE_OOSEQ */


        /* Acknowledge the segment(s). */
        tcp_ack(pcb);
  8108c1:	0f b6 43 20          	movzbl 0x20(%ebx),%eax
  8108c5:	a8 01                	test   $0x1,%al
  8108c7:	74 1b                	je     8108e4 <tcp_receive+0x9a4>
  8108c9:	83 e0 fe             	and    $0xfffffffe,%eax
  8108cc:	83 c8 02             	or     $0x2,%eax
  8108cf:	88 43 20             	mov    %al,0x20(%ebx)
  8108d2:	89 1c 24             	mov    %ebx,(%esp)
  8108d5:	e8 a1 aa ff ff       	call   80b37b <tcp_output>
  8108da:	b8 01 00 00 00       	mov    $0x1,%eax
  8108df:	e9 cb 02 00 00       	jmp    810baf <tcp_receive+0xc6f>
  8108e4:	83 c8 01             	or     $0x1,%eax
  8108e7:	88 43 20             	mov    %al,0x20(%ebx)
  8108ea:	b8 01 00 00 00       	mov    $0x1,%eax
  8108ef:	e9 bb 02 00 00       	jmp    810baf <tcp_receive+0xc6f>

      } else {
        /* We get here if the incoming segment is out-of-sequence. */
        tcp_ack_now(pcb);
  8108f4:	80 4b 20 02          	orb    $0x2,0x20(%ebx)
  8108f8:	89 1c 24             	mov    %ebx,(%esp)
  8108fb:	e8 7b aa ff ff       	call   80b37b <tcp_output>
#if TCP_QUEUE_OOSEQ
        /* We queue the segment on the ->ooseq queue. */
        if (pcb->ooseq == NULL) {
  810900:	8b 73 7c             	mov    0x7c(%ebx),%esi
  810903:	85 f6                	test   %esi,%esi
  810905:	74 31                	je     810938 <tcp_receive+0x9f8>
             segment on the ->ooseq queue, we discard the segment that
             contains less data. */

          prev = NULL;
          for(next = pcb->ooseq; next != NULL; next = next->next) {
            if (seqno == next->tcphdr->seqno) {
  810907:	8b 46 10             	mov    0x10(%esi),%eax
  81090a:	8b 40 04             	mov    0x4(%eax),%eax
  81090d:	8b 15 78 f5 b3 00    	mov    0xb3f578,%edx
  810913:	39 d0                	cmp    %edx,%eax
  810915:	74 18                	je     81092f <tcp_receive+0x9ef>
  810917:	89 75 e4             	mov    %esi,-0x1c(%ebp)
  81091a:	bf 00 00 00 00       	mov    $0x0,%edi
                  break;
                }
              } else 
                /*if (TCP_SEQ_LT(prev->tcphdr->seqno, seqno) &&
                  TCP_SEQ_LT(seqno, next->tcphdr->seqno)) {*/
                if(TCP_SEQ_BETWEEN(seqno, prev->tcphdr->seqno+1, next->tcphdr->seqno-1)){
  81091f:	8d 72 01             	lea    0x1(%edx),%esi
  810922:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  810925:	89 5d e0             	mov    %ebx,-0x20(%ebp)
  810928:	89 f3                	mov    %esi,%ebx
  81092a:	e9 b7 00 00 00       	jmp    8109e6 <tcp_receive+0xaa6>
             segment on the ->ooseq queue, we discard the segment that
             contains less data. */

          prev = NULL;
          for(next = pcb->ooseq; next != NULL; next = next->next) {
            if (seqno == next->tcphdr->seqno) {
  81092f:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  810936:	eb 1f                	jmp    810957 <tcp_receive+0xa17>
        /* We get here if the incoming segment is out-of-sequence. */
        tcp_ack_now(pcb);
#if TCP_QUEUE_OOSEQ
        /* We queue the segment on the ->ooseq queue. */
        if (pcb->ooseq == NULL) {
          pcb->ooseq = tcp_seg_copy(&inseg);
  810938:	c7 04 24 5c f5 b3 00 	movl   $0xb3f55c,(%esp)
  81093f:	e8 ea 80 ff ff       	call   808a2e <tcp_seg_copy>
  810944:	89 43 7c             	mov    %eax,0x7c(%ebx)
  810947:	b8 00 00 00 00       	mov    $0x0,%eax
  81094c:	e9 5e 02 00 00       	jmp    810baf <tcp_receive+0xc6f>
  810951:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
  810954:	8b 5d e0             	mov    -0x20(%ebp),%ebx
            if (seqno == next->tcphdr->seqno) {
              /* The sequence number of the incoming segment is the
                 same as the sequence number of the segment on
                 ->ooseq. We check the lengths to see which one to
                 discard. */
              if (inseg.len > next->len) {
  810957:	0f b7 05 68 f5 b3 00 	movzwl 0xb3f568,%eax
  81095e:	66 3b 46 0c          	cmp    0xc(%esi),%ax
  810962:	0f 86 42 02 00 00    	jbe    810baa <tcp_receive+0xc6a>
                /* The incoming segment is larger than the old
                   segment. We replace the old segment with the new
                   one. */
                cseg = tcp_seg_copy(&inseg);
  810968:	c7 04 24 5c f5 b3 00 	movl   $0xb3f55c,(%esp)
  81096f:	e8 ba 80 ff ff       	call   808a2e <tcp_seg_copy>
  810974:	89 c7                	mov    %eax,%edi
                if (cseg != NULL) {
  810976:	85 c0                	test   %eax,%eax
  810978:	0f 84 2c 02 00 00    	je     810baa <tcp_receive+0xc6a>
                  cseg->next = next->next;
  81097e:	8b 06                	mov    (%esi),%eax
  810980:	89 07                	mov    %eax,(%edi)
                  if (prev != NULL) {
  810982:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  810986:	74 07                	je     81098f <tcp_receive+0xa4f>
                    prev->next = cseg;
  810988:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
  81098b:	89 3b                	mov    %edi,(%ebx)
  81098d:	eb 03                	jmp    810992 <tcp_receive+0xa52>
                  } else {
                    pcb->ooseq = cseg;
  81098f:	89 7b 7c             	mov    %edi,0x7c(%ebx)
                  }
                  tcp_seg_free(next);
  810992:	89 34 24             	mov    %esi,(%esp)
  810995:	e8 d7 80 ff ff       	call   808a71 <tcp_seg_free>
                  if (cseg->next != NULL) {
  81099a:	8b 17                	mov    (%edi),%edx
  81099c:	85 d2                	test   %edx,%edx
  81099e:	0f 84 06 02 00 00    	je     810baa <tcp_receive+0xc6a>
                    next = cseg->next;
                    if (TCP_SEQ_GT(seqno + cseg->len, next->tcphdr->seqno)) {
  8109a4:	a1 78 f5 b3 00       	mov    0xb3f578,%eax
  8109a9:	8b 52 10             	mov    0x10(%edx),%edx
  8109ac:	8b 52 04             	mov    0x4(%edx),%edx
  8109af:	0f b7 4f 0c          	movzwl 0xc(%edi),%ecx
  8109b3:	29 d1                	sub    %edx,%ecx
  8109b5:	01 c1                	add    %eax,%ecx
  8109b7:	85 c9                	test   %ecx,%ecx
  8109b9:	0f 8e eb 01 00 00    	jle    810baa <tcp_receive+0xc6a>
                      /* We need to trim the incoming segment. */
                      cseg->len = (u16_t)(next->tcphdr->seqno - seqno);
  8109bf:	66 29 c2             	sub    %ax,%dx
  8109c2:	66 89 57 0c          	mov    %dx,0xc(%edi)
                      pbuf_realloc(cseg->p, cseg->len);
  8109c6:	0f b7 c2             	movzwl %dx,%eax
  8109c9:	89 44 24 04          	mov    %eax,0x4(%esp)
  8109cd:	8b 47 04             	mov    0x4(%edi),%eax
  8109d0:	89 04 24             	mov    %eax,(%esp)
  8109d3:	e8 b1 76 ff ff       	call   808089 <pbuf_realloc>
  8109d8:	b8 00 00 00 00       	mov    $0x0,%eax
  8109dd:	e9 cd 01 00 00       	jmp    810baf <tcp_receive+0xc6f>
  8109e2:	89 cf                	mov    %ecx,%edi
  8109e4:	89 f1                	mov    %esi,%ecx
                   segment was smaller than the old one; in either
                   case, we ditch the incoming segment. */
                break;
              }
            } else {
              if (prev == NULL) {
  8109e6:	85 ff                	test   %edi,%edi
  8109e8:	75 60                	jne    810a4a <tcp_receive+0xb0a>
                if (TCP_SEQ_LT(seqno, next->tcphdr->seqno)) {
  8109ea:	39 c2                	cmp    %eax,%edx
  8109ec:	0f 89 fd 00 00 00    	jns    810aef <tcp_receive+0xbaf>
  8109f2:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
  8109f5:	8b 5d e0             	mov    -0x20(%ebp),%ebx
                  /* The sequence number of the incoming segment is lower
                     than the sequence number of the first segment on the
                     queue. We put the incoming segment first on the
                     queue. */

                  if (TCP_SEQ_GT(seqno + inseg.len, next->tcphdr->seqno)) {
  8109f8:	0f b7 0d 68 f5 b3 00 	movzwl 0xb3f568,%ecx
  8109ff:	01 d1                	add    %edx,%ecx
  810a01:	29 c1                	sub    %eax,%ecx
  810a03:	85 c9                	test   %ecx,%ecx
  810a05:	7e 1d                	jle    810a24 <tcp_receive+0xae4>
                    /* We need to trim the incoming segment. */
                    inseg.len = (u16_t)(next->tcphdr->seqno - seqno);
  810a07:	66 29 d0             	sub    %dx,%ax
  810a0a:	66 a3 68 f5 b3 00    	mov    %ax,0xb3f568
                    pbuf_realloc(inseg.p, inseg.len);
  810a10:	0f b7 c0             	movzwl %ax,%eax
  810a13:	89 44 24 04          	mov    %eax,0x4(%esp)
  810a17:	a1 60 f5 b3 00       	mov    0xb3f560,%eax
  810a1c:	89 04 24             	mov    %eax,(%esp)
  810a1f:	e8 65 76 ff ff       	call   808089 <pbuf_realloc>
                  }
                  cseg = tcp_seg_copy(&inseg);
  810a24:	c7 04 24 5c f5 b3 00 	movl   $0xb3f55c,(%esp)
  810a2b:	e8 fe 7f ff ff       	call   808a2e <tcp_seg_copy>
                  if (cseg != NULL) {
  810a30:	85 c0                	test   %eax,%eax
  810a32:	0f 84 72 01 00 00    	je     810baa <tcp_receive+0xc6a>
                    cseg->next = next;
  810a38:	8b 75 e4             	mov    -0x1c(%ebp),%esi
  810a3b:	89 30                	mov    %esi,(%eax)
                    pcb->ooseq = cseg;
  810a3d:	89 43 7c             	mov    %eax,0x7c(%ebx)
  810a40:	b8 00 00 00 00       	mov    $0x0,%eax
  810a45:	e9 65 01 00 00       	jmp    810baf <tcp_receive+0xc6f>
                  break;
                }
              } else 
                /*if (TCP_SEQ_LT(prev->tcphdr->seqno, seqno) &&
                  TCP_SEQ_LT(seqno, next->tcphdr->seqno)) {*/
                if(TCP_SEQ_BETWEEN(seqno, prev->tcphdr->seqno+1, next->tcphdr->seqno-1)){
  810a4a:	8b 77 10             	mov    0x10(%edi),%esi
  810a4d:	8b 76 04             	mov    0x4(%esi),%esi
  810a50:	f7 d6                	not    %esi
  810a52:	01 d6                	add    %edx,%esi
  810a54:	0f 88 95 00 00 00    	js     810aef <tcp_receive+0xbaf>
  810a5a:	89 de                	mov    %ebx,%esi
  810a5c:	29 c6                	sub    %eax,%esi
  810a5e:	85 f6                	test   %esi,%esi
  810a60:	0f 8f 89 00 00 00    	jg     810aef <tcp_receive+0xbaf>
  810a66:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
                /* The sequence number of the incoming segment is in
                   between the sequence numbers of the previous and
                   the next segment on ->ooseq. We trim and insert the
                   incoming segment and trim the previous segment, if
                   needed. */
                if (TCP_SEQ_GT(seqno + inseg.len, next->tcphdr->seqno)) {
  810a69:	0f b7 0d 68 f5 b3 00 	movzwl 0xb3f568,%ecx
  810a70:	01 d1                	add    %edx,%ecx
  810a72:	29 c1                	sub    %eax,%ecx
  810a74:	85 c9                	test   %ecx,%ecx
  810a76:	7e 1d                	jle    810a95 <tcp_receive+0xb55>
                  /* We need to trim the incoming segment. */
                  inseg.len = (u16_t)(next->tcphdr->seqno - seqno);
  810a78:	66 29 d0             	sub    %dx,%ax
  810a7b:	66 a3 68 f5 b3 00    	mov    %ax,0xb3f568
                  pbuf_realloc(inseg.p, inseg.len);
  810a81:	0f b7 c0             	movzwl %ax,%eax
  810a84:	89 44 24 04          	mov    %eax,0x4(%esp)
  810a88:	a1 60 f5 b3 00       	mov    0xb3f560,%eax
  810a8d:	89 04 24             	mov    %eax,(%esp)
  810a90:	e8 f4 75 ff ff       	call   808089 <pbuf_realloc>
                }

                cseg = tcp_seg_copy(&inseg);
  810a95:	c7 04 24 5c f5 b3 00 	movl   $0xb3f55c,(%esp)
  810a9c:	e8 8d 7f ff ff       	call   808a2e <tcp_seg_copy>
                if (cseg != NULL) {
  810aa1:	85 c0                	test   %eax,%eax
  810aa3:	0f 84 01 01 00 00    	je     810baa <tcp_receive+0xc6a>
                  cseg->next = next;
  810aa9:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  810aac:	89 10                	mov    %edx,(%eax)
                  prev->next = cseg;
  810aae:	89 07                	mov    %eax,(%edi)
                  if (TCP_SEQ_GT(prev->tcphdr->seqno + prev->len, seqno)) {
  810ab0:	8b 47 10             	mov    0x10(%edi),%eax
  810ab3:	8b 40 04             	mov    0x4(%eax),%eax
  810ab6:	8b 15 78 f5 b3 00    	mov    0xb3f578,%edx
  810abc:	0f b7 4f 0c          	movzwl 0xc(%edi),%ecx
  810ac0:	29 d1                	sub    %edx,%ecx
  810ac2:	01 c1                	add    %eax,%ecx
  810ac4:	85 c9                	test   %ecx,%ecx
  810ac6:	0f 8e de 00 00 00    	jle    810baa <tcp_receive+0xc6a>
                    /* We need to trim the prev segment. */
                    prev->len = (u16_t)(seqno - prev->tcphdr->seqno);
  810acc:	66 29 c2             	sub    %ax,%dx
  810acf:	66 89 57 0c          	mov    %dx,0xc(%edi)
                    pbuf_realloc(prev->p, prev->len);
  810ad3:	0f b7 c2             	movzwl %dx,%eax
  810ad6:	89 44 24 04          	mov    %eax,0x4(%esp)
  810ada:	8b 47 04             	mov    0x4(%edi),%eax
  810add:	89 04 24             	mov    %eax,(%esp)
  810ae0:	e8 a4 75 ff ff       	call   808089 <pbuf_realloc>
  810ae5:	b8 00 00 00 00       	mov    $0x0,%eax
  810aea:	e9 c0 00 00 00       	jmp    810baf <tcp_receive+0xc6f>
                break;
              }
              /* If the "next" segment is the last segment on the
                 ooseq queue, we add the incoming segment to the end
                 of the list. */
              if (next->next == NULL &&
  810aef:	8b 31                	mov    (%ecx),%esi
  810af1:	85 f6                	test   %esi,%esi
  810af3:	75 5e                	jne    810b53 <tcp_receive+0xc13>
  810af5:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
  810af8:	29 c2                	sub    %eax,%edx
  810afa:	85 d2                	test   %edx,%edx
  810afc:	0f 8e a8 00 00 00    	jle    810baa <tcp_receive+0xc6a>
                  TCP_SEQ_GT(seqno, next->tcphdr->seqno)) {
                next->next = tcp_seg_copy(&inseg);
  810b02:	c7 04 24 5c f5 b3 00 	movl   $0xb3f55c,(%esp)
  810b09:	e8 20 7f ff ff       	call   808a2e <tcp_seg_copy>
  810b0e:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
  810b11:	89 03                	mov    %eax,(%ebx)
                if (next->next != NULL) {
  810b13:	85 c0                	test   %eax,%eax
  810b15:	0f 84 8f 00 00 00    	je     810baa <tcp_receive+0xc6a>
                  if (TCP_SEQ_GT(next->tcphdr->seqno + next->len, seqno)) {
  810b1b:	8b 43 10             	mov    0x10(%ebx),%eax
  810b1e:	8b 40 04             	mov    0x4(%eax),%eax
  810b21:	8b 15 78 f5 b3 00    	mov    0xb3f578,%edx
  810b27:	0f b7 4b 0c          	movzwl 0xc(%ebx),%ecx
  810b2b:	29 d1                	sub    %edx,%ecx
  810b2d:	01 c1                	add    %eax,%ecx
  810b2f:	85 c9                	test   %ecx,%ecx
  810b31:	7e 77                	jle    810baa <tcp_receive+0xc6a>
                    /* We need to trim the last segment. */
                    next->len = (u16_t)(seqno - next->tcphdr->seqno);
  810b33:	66 29 c2             	sub    %ax,%dx
  810b36:	66 89 53 0c          	mov    %dx,0xc(%ebx)
                    pbuf_realloc(next->p, next->len);
  810b3a:	0f b7 c2             	movzwl %dx,%eax
  810b3d:	89 44 24 04          	mov    %eax,0x4(%esp)
  810b41:	8b 43 04             	mov    0x4(%ebx),%eax
  810b44:	89 04 24             	mov    %eax,(%esp)
  810b47:	e8 3d 75 ff ff       	call   808089 <pbuf_realloc>
  810b4c:	b8 00 00 00 00       	mov    $0x0,%eax
  810b51:	eb 5c                	jmp    810baf <tcp_receive+0xc6f>
             segment on the ->ooseq queue, we discard the segment that
             contains less data. */

          prev = NULL;
          for(next = pcb->ooseq; next != NULL; next = next->next) {
            if (seqno == next->tcphdr->seqno) {
  810b53:	8b 46 10             	mov    0x10(%esi),%eax
  810b56:	8b 40 04             	mov    0x4(%eax),%eax
  810b59:	39 d0                	cmp    %edx,%eax
  810b5b:	0f 85 81 fe ff ff    	jne    8109e2 <tcp_receive+0xaa2>
  810b61:	e9 eb fd ff ff       	jmp    810951 <tcp_receive+0xa11>
        }
#endif /* TCP_QUEUE_OOSEQ */

      }
    } else {
      tcp_ack_now(pcb);
  810b66:	80 4b 20 02          	orb    $0x2,0x20(%ebx)
  810b6a:	89 1c 24             	mov    %ebx,(%esp)
  810b6d:	e8 09 a8 ff ff       	call   80b37b <tcp_output>
  810b72:	b8 00 00 00 00       	mov    $0x0,%eax
  810b77:	eb 36                	jmp    810baf <tcp_receive+0xc6f>
  } else {
    /* Segments with length 0 is taken care of here. Segments that
       fall out of the window are ACKed. */
    /*if (TCP_SEQ_GT(pcb->rcv_nxt, seqno) ||
      TCP_SEQ_GEQ(seqno, pcb->rcv_nxt + pcb->rcv_wnd)) {*/
    if(!TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, pcb->rcv_nxt + pcb->rcv_wnd-1)){
  810b79:	8b 15 78 f5 b3 00    	mov    0xb3f578,%edx
  810b7f:	8b 43 24             	mov    0x24(%ebx),%eax
  810b82:	39 c2                	cmp    %eax,%edx
  810b84:	78 11                	js     810b97 <tcp_receive+0xc57>
  810b86:	83 c2 01             	add    $0x1,%edx
  810b89:	29 c2                	sub    %eax,%edx
  810b8b:	89 d0                	mov    %edx,%eax
  810b8d:	0f b7 4b 28          	movzwl 0x28(%ebx),%ecx
  810b91:	29 c8                	sub    %ecx,%eax
  810b93:	85 c0                	test   %eax,%eax
  810b95:	7e 13                	jle    810baa <tcp_receive+0xc6a>
      tcp_ack_now(pcb);
  810b97:	80 4b 20 02          	orb    $0x2,0x20(%ebx)
  810b9b:	89 1c 24             	mov    %ebx,(%esp)
  810b9e:	e8 d8 a7 ff ff       	call   80b37b <tcp_output>
  810ba3:	b8 00 00 00 00       	mov    $0x0,%eax
  810ba8:	eb 05                	jmp    810baf <tcp_receive+0xc6f>
  810baa:	b8 00 00 00 00       	mov    $0x0,%eax
    }
  }
  return accepted_inseq;
}
  810baf:	83 c4 2c             	add    $0x2c,%esp
  810bb2:	5b                   	pop    %ebx
  810bb3:	5e                   	pop    %esi
  810bb4:	5f                   	pop    %edi
  810bb5:	5d                   	pop    %ebp
  810bb6:	c3                   	ret    

00810bb7 <tcp_input>:
 * @param p received TCP segment to process (p->payload pointing to the IP header)
 * @param inp network interface on which this segment was received
 */
void
tcp_input(struct pbuf *p, struct netif *inp)
{
  810bb7:	55                   	push   %ebp
  810bb8:	89 e5                	mov    %esp,%ebp
  810bba:	57                   	push   %edi
  810bbb:	56                   	push   %esi
  810bbc:	53                   	push   %ebx
  810bbd:	83 ec 5c             	sub    $0x5c,%esp
  810bc0:	8b 75 08             	mov    0x8(%ebp),%esi
  PERF_START;

  TCP_STATS_INC(tcp.recv);
  snmp_inc_tcpinsegs();

  iphdr = p->payload;
  810bc3:	8b 46 04             	mov    0x4(%esi),%eax
  810bc6:	a3 74 f5 b3 00       	mov    %eax,0xb3f574
  tcphdr = (struct tcp_hdr *)((u8_t *)p->payload + IPH_HL(iphdr) * 4);
  810bcb:	8b 5e 04             	mov    0x4(%esi),%ebx
  810bce:	0f b7 00             	movzwl (%eax),%eax
  810bd1:	89 04 24             	mov    %eax,(%esp)
  810bd4:	e8 27 a1 ff ff       	call   80ad00 <ntohs>
  810bd9:	c1 e8 06             	shr    $0x6,%eax
  810bdc:	83 e0 3c             	and    $0x3c,%eax
  810bdf:	01 c3                	add    %eax,%ebx
  810be1:	89 1d 70 f5 b3 00    	mov    %ebx,0xb3f570
#if TCP_INPUT_DEBUG
  tcp_debug_print(tcphdr);
#endif

  /* remove header from payload */
  if (pbuf_header(p, -((s16_t)(IPH_HL(iphdr) * 4))) || (p->tot_len < sizeof(struct tcp_hdr))) {
  810be7:	a1 74 f5 b3 00       	mov    0xb3f574,%eax
  810bec:	0f b7 00             	movzwl (%eax),%eax
  810bef:	89 04 24             	mov    %eax,(%esp)
  810bf2:	e8 09 a1 ff ff       	call   80ad00 <ntohs>
  810bf7:	66 c1 e8 06          	shr    $0x6,%ax
  810bfb:	83 e0 3c             	and    $0x3c,%eax
  810bfe:	f7 d8                	neg    %eax
  810c00:	98                   	cwtl   
  810c01:	89 44 24 04          	mov    %eax,0x4(%esp)
  810c05:	89 34 24             	mov    %esi,(%esp)
  810c08:	e8 86 6f ff ff       	call   807b93 <pbuf_header>
  810c0d:	84 c0                	test   %al,%al
  810c0f:	75 07                	jne    810c18 <tcp_input+0x61>
  810c11:	66 83 7e 08 13       	cmpw   $0x13,0x8(%esi)
  810c16:	77 12                	ja     810c2a <tcp_input+0x73>
    /* drop short packets */
    LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: short packet (%"U16_F" bytes) discarded\n", p->tot_len));
    TCP_STATS_INC(tcp.lenerr);
    TCP_STATS_INC(tcp.drop);
    snmp_inc_tcpinerrs();
    pbuf_free(p);
  810c18:	89 34 24             	mov    %esi,(%esp)
  810c1b:	90                   	nop
  810c1c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  810c20:	e8 d8 72 ff ff       	call   807efd <pbuf_free>
    return;
  810c25:	e9 9a 0d 00 00       	jmp    8119c4 <tcp_input+0xe0d>
  }

  /* Don't even process incoming broadcasts/multicasts. */
  if (ip_addr_isbroadcast(&(iphdr->dest), inp) ||
  810c2a:	8b 45 0c             	mov    0xc(%ebp),%eax
  810c2d:	89 44 24 04          	mov    %eax,0x4(%esp)
  810c31:	a1 74 f5 b3 00       	mov    0xb3f574,%eax
  810c36:	83 c0 10             	add    $0x10,%eax
  810c39:	89 04 24             	mov    %eax,(%esp)
  810c3c:	e8 a7 8c ff ff       	call   8098e8 <ip_addr_isbroadcast>
  810c41:	84 c0                	test   %al,%al
  810c43:	75 28                	jne    810c6d <tcp_input+0xb6>
      ip_addr_ismulticast(&(iphdr->dest))) {
  810c45:	a1 74 f5 b3 00       	mov    0xb3f574,%eax
  810c4a:	8b 78 10             	mov    0x10(%eax),%edi
  810c4d:	c7 04 24 00 00 00 f0 	movl   $0xf0000000,(%esp)
  810c54:	e8 dc a2 ff ff       	call   80af35 <ntohl>
  810c59:	89 c3                	mov    %eax,%ebx
  810c5b:	c7 04 24 00 00 00 e0 	movl   $0xe0000000,(%esp)
  810c62:	e8 ce a2 ff ff       	call   80af35 <ntohl>
    pbuf_free(p);
    return;
  }

  /* Don't even process incoming broadcasts/multicasts. */
  if (ip_addr_isbroadcast(&(iphdr->dest), inp) ||
  810c67:	21 fb                	and    %edi,%ebx
  810c69:	39 c3                	cmp    %eax,%ebx
  810c6b:	75 0d                	jne    810c7a <tcp_input+0xc3>
      ip_addr_ismulticast(&(iphdr->dest))) {
    TCP_STATS_INC(tcp.proterr);
    TCP_STATS_INC(tcp.drop);
    snmp_inc_tcpinerrs();
    pbuf_free(p);
  810c6d:	89 34 24             	mov    %esi,(%esp)
  810c70:	e8 88 72 ff ff       	call   807efd <pbuf_free>
    return;
  810c75:	e9 4a 0d 00 00       	jmp    8119c4 <tcp_input+0xe0d>
  }

#if CHECKSUM_CHECK_TCP
  /* Verify TCP checksum. */
  if (inet_chksum_pseudo(p, (struct ip_addr *)&(iphdr->src),
      (struct ip_addr *)&(iphdr->dest),
  810c7a:	a1 74 f5 b3 00       	mov    0xb3f574,%eax
    return;
  }

#if CHECKSUM_CHECK_TCP
  /* Verify TCP checksum. */
  if (inet_chksum_pseudo(p, (struct ip_addr *)&(iphdr->src),
  810c7f:	0f b7 56 08          	movzwl 0x8(%esi),%edx
  810c83:	89 54 24 10          	mov    %edx,0x10(%esp)
  810c87:	c7 44 24 0c 06 00 00 	movl   $0x6,0xc(%esp)
  810c8e:	00 
  810c8f:	8d 50 10             	lea    0x10(%eax),%edx
  810c92:	89 54 24 08          	mov    %edx,0x8(%esp)
  810c96:	83 c0 0c             	add    $0xc,%eax
  810c99:	89 44 24 04          	mov    %eax,0x4(%esp)
  810c9d:	89 34 24             	mov    %esi,(%esp)
  810ca0:	e8 4b 9d ff ff       	call   80a9f0 <inet_chksum_pseudo>
  810ca5:	66 85 c0             	test   %ax,%ax
  810ca8:	74 0d                	je     810cb7 <tcp_input+0x100>
    tcp_debug_print(tcphdr);
#endif /* TCP_DEBUG */
    TCP_STATS_INC(tcp.chkerr);
    TCP_STATS_INC(tcp.drop);
    snmp_inc_tcpinerrs();
    pbuf_free(p);
  810caa:	89 34 24             	mov    %esi,(%esp)
  810cad:	e8 4b 72 ff ff       	call   807efd <pbuf_free>
    return;
  810cb2:	e9 0d 0d 00 00       	jmp    8119c4 <tcp_input+0xe0d>
  }
#endif

  /* Move the payload pointer in the pbuf so that it points to the
     TCP data instead of the TCP header. */
  hdrlen = TCPH_HDRLEN(tcphdr);
  810cb7:	a1 70 f5 b3 00       	mov    0xb3f570,%eax
  810cbc:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  810cc0:	89 04 24             	mov    %eax,(%esp)
  810cc3:	e8 38 a0 ff ff       	call   80ad00 <ntohs>
  if(pbuf_header(p, -(hdrlen * 4))){
  810cc8:	66 c1 e8 0c          	shr    $0xc,%ax
  810ccc:	f7 d8                	neg    %eax
  810cce:	c1 e0 02             	shl    $0x2,%eax
  810cd1:	98                   	cwtl   
  810cd2:	89 44 24 04          	mov    %eax,0x4(%esp)
  810cd6:	89 34 24             	mov    %esi,(%esp)
  810cd9:	e8 b5 6e ff ff       	call   807b93 <pbuf_header>
  810cde:	84 c0                	test   %al,%al
  810ce0:	74 0d                	je     810cef <tcp_input+0x138>
    /* drop short packets */
    LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: short packet\n"));
    TCP_STATS_INC(tcp.lenerr);
    TCP_STATS_INC(tcp.drop);
    snmp_inc_tcpinerrs();
    pbuf_free(p);
  810ce2:	89 34 24             	mov    %esi,(%esp)
  810ce5:	e8 13 72 ff ff       	call   807efd <pbuf_free>
    return;
  810cea:	e9 d5 0c 00 00       	jmp    8119c4 <tcp_input+0xe0d>
  }

  /* Convert fields in TCP header to host byte order. */
  tcphdr->src = ntohs(tcphdr->src);
  810cef:	8b 1d 70 f5 b3 00    	mov    0xb3f570,%ebx
  810cf5:	0f b7 03             	movzwl (%ebx),%eax
  810cf8:	89 04 24             	mov    %eax,(%esp)
  810cfb:	e8 00 a0 ff ff       	call   80ad00 <ntohs>
  810d00:	66 89 03             	mov    %ax,(%ebx)
  tcphdr->dest = ntohs(tcphdr->dest);
  810d03:	8b 1d 70 f5 b3 00    	mov    0xb3f570,%ebx
  810d09:	0f b7 43 02          	movzwl 0x2(%ebx),%eax
  810d0d:	89 04 24             	mov    %eax,(%esp)
  810d10:	e8 eb 9f ff ff       	call   80ad00 <ntohs>
  810d15:	66 89 43 02          	mov    %ax,0x2(%ebx)
  seqno = tcphdr->seqno = ntohl(tcphdr->seqno);
  810d19:	8b 1d 70 f5 b3 00    	mov    0xb3f570,%ebx
  810d1f:	8b 43 04             	mov    0x4(%ebx),%eax
  810d22:	89 04 24             	mov    %eax,(%esp)
  810d25:	e8 0b a2 ff ff       	call   80af35 <ntohl>
  810d2a:	89 43 04             	mov    %eax,0x4(%ebx)
  810d2d:	a3 78 f5 b3 00       	mov    %eax,0xb3f578
  ackno = tcphdr->ackno = ntohl(tcphdr->ackno);
  810d32:	8b 1d 70 f5 b3 00    	mov    0xb3f570,%ebx
  810d38:	8b 43 08             	mov    0x8(%ebx),%eax
  810d3b:	89 04 24             	mov    %eax,(%esp)
  810d3e:	e8 f2 a1 ff ff       	call   80af35 <ntohl>
  810d43:	89 43 08             	mov    %eax,0x8(%ebx)
  810d46:	a3 7c f5 b3 00       	mov    %eax,0xb3f57c
  tcphdr->wnd = ntohs(tcphdr->wnd);
  810d4b:	8b 1d 70 f5 b3 00    	mov    0xb3f570,%ebx
  810d51:	0f b7 43 0e          	movzwl 0xe(%ebx),%eax
  810d55:	89 04 24             	mov    %eax,(%esp)
  810d58:	e8 a3 9f ff ff       	call   80ad00 <ntohs>
  810d5d:	66 89 43 0e          	mov    %ax,0xe(%ebx)

  flags = TCPH_FLAGS(tcphdr) & TCP_FLAGS;
  810d61:	a1 70 f5 b3 00       	mov    0xb3f570,%eax
  810d66:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  810d6a:	89 04 24             	mov    %eax,(%esp)
  810d6d:	e8 8e 9f ff ff       	call   80ad00 <ntohs>
  810d72:	83 e0 3f             	and    $0x3f,%eax
  810d75:	a2 80 f5 b3 00       	mov    %al,0xb3f580
  tcplen = p->tot_len + ((flags & TCP_FIN || flags & TCP_SYN)? 1: 0);
  810d7a:	0f b7 4e 08          	movzwl 0x8(%esi),%ecx
  810d7e:	ba 01 00 00 00       	mov    $0x1,%edx
  810d83:	a8 01                	test   $0x1,%al
  810d85:	75 07                	jne    810d8e <tcp_input+0x1d7>
  810d87:	d1 e8                	shr    %eax
  810d89:	89 c2                	mov    %eax,%edx
  810d8b:	83 e2 01             	and    $0x1,%edx
  810d8e:	8d 14 11             	lea    (%ecx,%edx,1),%edx
  810d91:	66 89 15 82 f5 b3 00 	mov    %dx,0xb3f582
  /* Demultiplex an incoming segment. First, we check if it is destined
     for an active connection. */
  prev = NULL;

  
  for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  810d98:	8b 1d 08 f6 b3 00    	mov    0xb3f608,%ebx
  810d9e:	85 db                	test   %ebx,%ebx
  810da0:	0f 84 32 01 00 00    	je     810ed8 <tcp_input+0x321>
    LWIP_ASSERT("tcp_input: active pcb->state != CLOSED", pcb->state != CLOSED);
  810da6:	8b 43 10             	mov    0x10(%ebx),%eax
  810da9:	85 c0                	test   %eax,%eax
  810dab:	74 15                	je     810dc2 <tcp_input+0x20b>
    LWIP_ASSERT("tcp_input: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT);
  810dad:	83 f8 0a             	cmp    $0xa,%eax
  810db0:	74 31                	je     810de3 <tcp_input+0x22c>
    LWIP_ASSERT("tcp_input: active pcb->state != LISTEN", pcb->state != LISTEN);
  810db2:	83 f8 01             	cmp    $0x1,%eax
  810db5:	75 6f                	jne    810e26 <tcp_input+0x26f>
  810db7:	90                   	nop
  810db8:	eb 50                	jmp    810e0a <tcp_input+0x253>
     for an active connection. */
  prev = NULL;

  
  for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
    LWIP_ASSERT("tcp_input: active pcb->state != CLOSED", pcb->state != CLOSED);
  810dba:	8b 50 10             	mov    0x10(%eax),%edx
  810dbd:	85 d2                	test   %edx,%edx
  810dbf:	90                   	nop
  810dc0:	75 1c                	jne    810dde <tcp_input+0x227>
  810dc2:	c7 44 24 08 54 4e 81 	movl   $0x814e54,0x8(%esp)
  810dc9:	00 
  810dca:	c7 44 24 04 b5 00 00 	movl   $0xb5,0x4(%esp)
  810dd1:	00 
  810dd2:	c7 04 24 78 4f 81 00 	movl   $0x814f78,(%esp)
  810dd9:	e8 be fb fe ff       	call   80099c <_panic>
    LWIP_ASSERT("tcp_input: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT);
  810dde:	83 fa 0a             	cmp    $0xa,%edx
  810de1:	75 1c                	jne    810dff <tcp_input+0x248>
  810de3:	c7 44 24 08 7c 4e 81 	movl   $0x814e7c,0x8(%esp)
  810dea:	00 
  810deb:	c7 44 24 04 b6 00 00 	movl   $0xb6,0x4(%esp)
  810df2:	00 
  810df3:	c7 04 24 78 4f 81 00 	movl   $0x814f78,(%esp)
  810dfa:	e8 9d fb fe ff       	call   80099c <_panic>
    LWIP_ASSERT("tcp_input: active pcb->state != LISTEN", pcb->state != LISTEN);
  810dff:	83 fa 01             	cmp    $0x1,%edx
  810e02:	74 06                	je     810e0a <tcp_input+0x253>
  810e04:	89 da                	mov    %ebx,%edx
  810e06:	89 c3                	mov    %eax,%ebx
  810e08:	eb 35                	jmp    810e3f <tcp_input+0x288>
  810e0a:	c7 44 24 08 a8 4e 81 	movl   $0x814ea8,0x8(%esp)
  810e11:	00 
  810e12:	c7 44 24 04 b7 00 00 	movl   $0xb7,0x4(%esp)
  810e19:	00 
  810e1a:	c7 04 24 78 4f 81 00 	movl   $0x814f78,(%esp)
  810e21:	e8 76 fb fe ff       	call   80099c <_panic>
    if (pcb->remote_port == tcphdr->src &&
  810e26:	8b 3d 70 f5 b3 00    	mov    0xb3f570,%edi
  810e2c:	0f b7 0f             	movzwl (%edi),%ecx
       pcb->local_port == tcphdr->dest &&
       ip_addr_cmp(&(pcb->remote_ip), &(iphdr->src)) &&
  810e2f:	a1 74 f5 b3 00       	mov    0xb3f574,%eax
  810e34:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  810e37:	ba 00 00 00 00       	mov    $0x0,%edx
  810e3c:	89 75 c4             	mov    %esi,-0x3c(%ebp)
  
  for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
    LWIP_ASSERT("tcp_input: active pcb->state != CLOSED", pcb->state != CLOSED);
    LWIP_ASSERT("tcp_input: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT);
    LWIP_ASSERT("tcp_input: active pcb->state != LISTEN", pcb->state != LISTEN);
    if (pcb->remote_port == tcphdr->src &&
  810e3f:	66 39 4b 1e          	cmp    %cx,0x1e(%ebx)
  810e43:	75 7b                	jne    810ec0 <tcp_input+0x309>
       pcb->local_port == tcphdr->dest &&
  810e45:	0f b7 43 1c          	movzwl 0x1c(%ebx),%eax
  810e49:	66 3b 47 02          	cmp    0x2(%edi),%ax
  810e4d:	75 71                	jne    810ec0 <tcp_input+0x309>
       ip_addr_cmp(&(pcb->remote_ip), &(iphdr->src)) &&
  810e4f:	8b 43 04             	mov    0x4(%ebx),%eax
  810e52:	8b 75 d4             	mov    -0x2c(%ebp),%esi
  810e55:	3b 46 0c             	cmp    0xc(%esi),%eax
  810e58:	75 66                	jne    810ec0 <tcp_input+0x309>
       ip_addr_cmp(&(pcb->local_ip), &(iphdr->dest))) {
  810e5a:	8b 03                	mov    (%ebx),%eax
  810e5c:	3b 46 10             	cmp    0x10(%esi),%eax
  810e5f:	75 5f                	jne    810ec0 <tcp_input+0x309>
  810e61:	8b 75 c4             	mov    -0x3c(%ebp),%esi
  810e64:	89 d8                	mov    %ebx,%eax

      /* Move this PCB to the front of the list so that subsequent
         lookups will be faster (we exploit locality in TCP segment
         arrivals). */
      LWIP_ASSERT("tcp_input: pcb->next != pcb (before cache)", pcb->next != pcb);
  810e66:	8b 4b 0c             	mov    0xc(%ebx),%ecx
  810e69:	39 d9                	cmp    %ebx,%ecx
  810e6b:	75 1c                	jne    810e89 <tcp_input+0x2d2>
  810e6d:	c7 44 24 08 d0 4e 81 	movl   $0x814ed0,0x8(%esp)
  810e74:	00 
  810e75:	c7 44 24 04 c0 00 00 	movl   $0xc0,0x4(%esp)
  810e7c:	00 
  810e7d:	c7 04 24 78 4f 81 00 	movl   $0x814f78,(%esp)
  810e84:	e8 13 fb fe ff       	call   80099c <_panic>
      if (prev != NULL) {
  810e89:	85 d2                	test   %edx,%edx
  810e8b:	74 43                	je     810ed0 <tcp_input+0x319>
        prev->next = pcb->next;
  810e8d:	89 4a 0c             	mov    %ecx,0xc(%edx)
        pcb->next = tcp_active_pcbs;
  810e90:	8b 15 08 f6 b3 00    	mov    0xb3f608,%edx
  810e96:	89 53 0c             	mov    %edx,0xc(%ebx)
        tcp_active_pcbs = pcb;
  810e99:	89 1d 08 f6 b3 00    	mov    %ebx,0xb3f608
      }
      LWIP_ASSERT("tcp_input: pcb->next != pcb (after cache)", pcb->next != pcb);
  810e9f:	39 5b 0c             	cmp    %ebx,0xc(%ebx)
  810ea2:	75 2c                	jne    810ed0 <tcp_input+0x319>
  810ea4:	c7 44 24 08 fc 4e 81 	movl   $0x814efc,0x8(%esp)
  810eab:	00 
  810eac:	c7 44 24 04 c6 00 00 	movl   $0xc6,0x4(%esp)
  810eb3:	00 
  810eb4:	c7 04 24 78 4f 81 00 	movl   $0x814f78,(%esp)
  810ebb:	e8 dc fa fe ff       	call   80099c <_panic>
  /* Demultiplex an incoming segment. First, we check if it is destined
     for an active connection. */
  prev = NULL;

  
  for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  810ec0:	8b 43 0c             	mov    0xc(%ebx),%eax
  810ec3:	85 c0                	test   %eax,%eax
  810ec5:	0f 85 ef fe ff ff    	jne    810dba <tcp_input+0x203>
  810ecb:	8b 75 c4             	mov    -0x3c(%ebp),%esi
  810ece:	eb 08                	jmp    810ed8 <tcp_input+0x321>
      break;
    }
    prev = pcb;
  }

  if (pcb == NULL) {
  810ed0:	85 c0                	test   %eax,%eax
  810ed2:	0f 85 be 02 00 00    	jne    811196 <tcp_input+0x5df>
    /* If it did not go to an active connection, we check the connections
       in the TIME-WAIT state. */
    for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
  810ed8:	8b 1d 1c f6 b3 00    	mov    0xb3f61c,%ebx
  810ede:	85 db                	test   %ebx,%ebx
  810ee0:	0f 84 ad 00 00 00    	je     810f93 <tcp_input+0x3dc>
      LWIP_ASSERT("tcp_input: TIME-WAIT pcb->state == TIME-WAIT", pcb->state == TIME_WAIT);
  810ee6:	83 7b 10 0a          	cmpl   $0xa,0x10(%ebx)
  810eea:	74 2a                	je     810f16 <tcp_input+0x35f>
  810eec:	eb 0c                	jmp    810efa <tcp_input+0x343>
  810eee:	83 7b 10 0a          	cmpl   $0xa,0x10(%ebx)
  810ef2:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  810ef8:	74 2b                	je     810f25 <tcp_input+0x36e>
  810efa:	c7 44 24 08 28 4f 81 	movl   $0x814f28,0x8(%esp)
  810f01:	00 
  810f02:	c7 44 24 04 d0 00 00 	movl   $0xd0,0x4(%esp)
  810f09:	00 
  810f0a:	c7 04 24 78 4f 81 00 	movl   $0x814f78,(%esp)
  810f11:	e8 86 fa fe ff       	call   80099c <_panic>
      if (pcb->remote_port == tcphdr->src &&
  810f16:	8b 0d 70 f5 b3 00    	mov    0xb3f570,%ecx
  810f1c:	0f b7 01             	movzwl (%ecx),%eax
         pcb->local_port == tcphdr->dest &&
         ip_addr_cmp(&(pcb->remote_ip), &(iphdr->src)) &&
  810f1f:	8b 3d 74 f5 b3 00    	mov    0xb3f574,%edi
  if (pcb == NULL) {
    /* If it did not go to an active connection, we check the connections
       in the TIME-WAIT state. */
    for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
      LWIP_ASSERT("tcp_input: TIME-WAIT pcb->state == TIME-WAIT", pcb->state == TIME_WAIT);
      if (pcb->remote_port == tcphdr->src &&
  810f25:	66 39 43 1e          	cmp    %ax,0x1e(%ebx)
  810f29:	75 5d                	jne    810f88 <tcp_input+0x3d1>
         pcb->local_port == tcphdr->dest &&
  810f2b:	0f b7 53 1c          	movzwl 0x1c(%ebx),%edx
  810f2f:	66 3b 51 02          	cmp    0x2(%ecx),%dx
  810f33:	75 53                	jne    810f88 <tcp_input+0x3d1>
         ip_addr_cmp(&(pcb->remote_ip), &(iphdr->src)) &&
  810f35:	8b 53 04             	mov    0x4(%ebx),%edx
  810f38:	3b 57 0c             	cmp    0xc(%edi),%edx
  810f3b:	75 4b                	jne    810f88 <tcp_input+0x3d1>
         ip_addr_cmp(&(pcb->local_ip), &(iphdr->dest))) {
  810f3d:	8b 13                	mov    (%ebx),%edx
  810f3f:	3b 57 10             	cmp    0x10(%edi),%edx
  810f42:	75 44                	jne    810f88 <tcp_input+0x3d1>
 *       involved is passed as a parameter to this function
 */
static err_t
tcp_timewait_input(struct tcp_pcb *pcb)
{
  if (TCP_SEQ_GT(seqno + tcplen, pcb->rcv_nxt)) {
  810f44:	0f b7 05 82 f5 b3 00 	movzwl 0xb3f582,%eax
  810f4b:	03 05 78 f5 b3 00    	add    0xb3f578,%eax
  810f51:	89 c2                	mov    %eax,%edx
  810f53:	2b 53 24             	sub    0x24(%ebx),%edx
  810f56:	85 d2                	test   %edx,%edx
  810f58:	7e 03                	jle    810f5d <tcp_input+0x3a6>
    pcb->rcv_nxt = seqno + tcplen;
  810f5a:	89 43 24             	mov    %eax,0x24(%ebx)
  }
  if (tcplen > 0) {
  810f5d:	66 83 3d 82 f5 b3 00 	cmpw   $0x0,0xb3f582
  810f64:	00 
  810f65:	74 0c                	je     810f73 <tcp_input+0x3bc>
    tcp_ack_now(pcb);
  810f67:	80 4b 20 02          	orb    $0x2,0x20(%ebx)
  810f6b:	89 1c 24             	mov    %ebx,(%esp)
  810f6e:	e8 08 a4 ff ff       	call   80b37b <tcp_output>
  }
  return tcp_output(pcb);
  810f73:	89 1c 24             	mov    %ebx,(%esp)
  810f76:	e8 00 a4 ff ff       	call   80b37b <tcp_output>
        /* We don't really care enough to move this PCB to the front
           of the list since we are not very likely to receive that
           many segments for connections in TIME-WAIT. */
        LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: packed for TIME_WAITing connection.\n"));
        tcp_timewait_input(pcb);
        pbuf_free(p);
  810f7b:	89 34 24             	mov    %esi,(%esp)
  810f7e:	e8 7a 6f ff ff       	call   807efd <pbuf_free>
        return;
  810f83:	e9 3c 0a 00 00       	jmp    8119c4 <tcp_input+0xe0d>
  }

  if (pcb == NULL) {
    /* If it did not go to an active connection, we check the connections
       in the TIME-WAIT state. */
    for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
  810f88:	8b 5b 0c             	mov    0xc(%ebx),%ebx
  810f8b:	85 db                	test   %ebx,%ebx
  810f8d:	0f 85 5b ff ff ff    	jne    810eee <tcp_input+0x337>
    }

  /* Finally, if we still did not get a match, we check all PCBs that
     are LISTENing for incoming connections. */
    prev = NULL;
    for(lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
  810f93:	8b 3d 10 f6 b3 00    	mov    0xb3f610,%edi
  810f99:	85 ff                	test   %edi,%edi
  810f9b:	0f 84 ed 01 00 00    	je     81118e <tcp_input+0x5d7>
      if ((ip_addr_isany(&(lpcb->local_ip)) ||
        ip_addr_cmp(&(lpcb->local_ip), &(iphdr->dest))) &&
  810fa1:	a1 74 f5 b3 00       	mov    0xb3f574,%eax
        lpcb->local_port == tcphdr->dest) {
  810fa6:	8b 0d 70 f5 b3 00    	mov    0xb3f570,%ecx
  810fac:	ba 00 00 00 00       	mov    $0x0,%edx
  810fb1:	89 5d d4             	mov    %ebx,-0x2c(%ebp)
  810fb4:	89 c3                	mov    %eax,%ebx

  /* Finally, if we still did not get a match, we check all PCBs that
     are LISTENing for incoming connections. */
    prev = NULL;
    for(lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
      if ((ip_addr_isany(&(lpcb->local_ip)) ||
  810fb6:	85 ff                	test   %edi,%edi
  810fb8:	74 0f                	je     810fc9 <tcp_input+0x412>
  810fba:	8b 07                	mov    (%edi),%eax
  810fbc:	85 c0                	test   %eax,%eax
  810fbe:	74 09                	je     810fc9 <tcp_input+0x412>
        ip_addr_cmp(&(lpcb->local_ip), &(iphdr->dest))) &&
  810fc0:	3b 43 10             	cmp    0x10(%ebx),%eax
  810fc3:	0f 85 b1 01 00 00    	jne    81117a <tcp_input+0x5c3>
        lpcb->local_port == tcphdr->dest) {
  810fc9:	0f b7 47 1c          	movzwl 0x1c(%edi),%eax
  810fcd:	66 3b 41 02          	cmp    0x2(%ecx),%ax
  810fd1:	0f 85 a3 01 00 00    	jne    81117a <tcp_input+0x5c3>
        /* Move this PCB to the front of the list so that subsequent
           lookups will be faster (we exploit locality in TCP segment
           arrivals). */
        if (prev != NULL) {
  810fd7:	85 d2                	test   %edx,%edx
  810fd9:	74 14                	je     810fef <tcp_input+0x438>
          ((struct tcp_pcb_listen *)prev)->next = lpcb->next;
  810fdb:	8b 47 0c             	mov    0xc(%edi),%eax
  810fde:	89 42 0c             	mov    %eax,0xc(%edx)
                /* our successor is the remainder of the listening list */
          lpcb->next = tcp_listen_pcbs.listen_pcbs;
  810fe1:	a1 10 f6 b3 00       	mov    0xb3f610,%eax
  810fe6:	89 47 0c             	mov    %eax,0xc(%edi)
                /* put this listening pcb at the head of the listening list */
          tcp_listen_pcbs.listen_pcbs = lpcb;
  810fe9:	89 3d 10 f6 b3 00    	mov    %edi,0xb3f610
  struct tcp_pcb *npcb;
  u32_t optdata;

  /* In the LISTEN state, we check for incoming SYN segments,
     creates a new PCB, and responds with a SYN|ACK. */
  if (flags & TCP_ACK) {
  810fef:	0f b6 05 80 f5 b3 00 	movzbl 0xb3f580,%eax
  810ff6:	a8 10                	test   $0x10,%al
  810ff8:	74 4e                	je     811048 <tcp_input+0x491>
    /* For incoming segments with the ACK flag set, respond with a
       RST. */
    LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_listen_input: ACK in LISTEN, sending reset\n"));
    tcp_rst(ackno + 1, seqno + tcplen,
      &(iphdr->dest), &(iphdr->src),
      tcphdr->dest, tcphdr->src);
  810ffa:	8b 15 70 f5 b3 00    	mov    0xb3f570,%edx
  if (flags & TCP_ACK) {
    /* For incoming segments with the ACK flag set, respond with a
       RST. */
    LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_listen_input: ACK in LISTEN, sending reset\n"));
    tcp_rst(ackno + 1, seqno + tcplen,
      &(iphdr->dest), &(iphdr->src),
  811000:	a1 74 f5 b3 00       	mov    0xb3f574,%eax
     creates a new PCB, and responds with a SYN|ACK. */
  if (flags & TCP_ACK) {
    /* For incoming segments with the ACK flag set, respond with a
       RST. */
    LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_listen_input: ACK in LISTEN, sending reset\n"));
    tcp_rst(ackno + 1, seqno + tcplen,
  811005:	0f b7 0a             	movzwl (%edx),%ecx
  811008:	89 4c 24 14          	mov    %ecx,0x14(%esp)
  81100c:	0f b7 52 02          	movzwl 0x2(%edx),%edx
  811010:	89 54 24 10          	mov    %edx,0x10(%esp)
  811014:	8d 50 0c             	lea    0xc(%eax),%edx
  811017:	89 54 24 0c          	mov    %edx,0xc(%esp)
  81101b:	83 c0 10             	add    $0x10,%eax
  81101e:	89 44 24 08          	mov    %eax,0x8(%esp)
  811022:	0f b7 05 82 f5 b3 00 	movzwl 0xb3f582,%eax
  811029:	03 05 78 f5 b3 00    	add    0xb3f578,%eax
  81102f:	89 44 24 04          	mov    %eax,0x4(%esp)
  811033:	a1 7c f5 b3 00       	mov    0xb3f57c,%eax
  811038:	83 c0 01             	add    $0x1,%eax
  81103b:	89 04 24             	mov    %eax,(%esp)
  81103e:	e8 d9 a1 ff ff       	call   80b21c <tcp_rst>
  811043:	e9 25 01 00 00       	jmp    81116d <tcp_input+0x5b6>
      &(iphdr->dest), &(iphdr->src),
      tcphdr->dest, tcphdr->src);
  } else if (flags & TCP_SYN) {
  811048:	a8 02                	test   $0x2,%al
  81104a:	0f 84 1d 01 00 00    	je     81116d <tcp_input+0x5b6>
#if TCP_LISTEN_BACKLOG
    if (pcb->accepts_pending >= pcb->backlog) {
      return ERR_ABRT;
    }
#endif /* TCP_LISTEN_BACKLOG */
    npcb = tcp_alloc(pcb->prio);
  811050:	0f b6 47 14          	movzbl 0x14(%edi),%eax
  811054:	89 04 24             	mov    %eax,(%esp)
  811057:	e8 d2 80 ff ff       	call   80912e <tcp_alloc>
  81105c:	89 c3                	mov    %eax,%ebx
    /* If a new PCB could not be created (probably due to lack of memory),
       we don't do anything, but rely on the sender will retransmit the
       SYN at a time when we have more memory available. */
    if (npcb == NULL) {
  81105e:	85 c0                	test   %eax,%eax
  811060:	0f 84 07 01 00 00    	je     81116d <tcp_input+0x5b6>
    }
#if TCP_LISTEN_BACKLOG
    pcb->accepts_pending++;
#endif /* TCP_LISTEN_BACKLOG */
    /* Set up the new PCB. */
    ip_addr_set(&(npcb->local_ip), &(iphdr->dest));
  811066:	8b 15 74 f5 b3 00    	mov    0xb3f574,%edx
  81106c:	b8 00 00 00 00       	mov    $0x0,%eax
  811071:	83 fa f0             	cmp    $0xfffffff0,%edx
  811074:	74 03                	je     811079 <tcp_input+0x4c2>
  811076:	8b 42 10             	mov    0x10(%edx),%eax
  811079:	89 03                	mov    %eax,(%ebx)
    npcb->local_port = pcb->local_port;
  81107b:	0f b7 47 1c          	movzwl 0x1c(%edi),%eax
  81107f:	66 89 43 1c          	mov    %ax,0x1c(%ebx)
    ip_addr_set(&(npcb->remote_ip), &(iphdr->src));
  811083:	8b 15 74 f5 b3 00    	mov    0xb3f574,%edx
  811089:	b8 00 00 00 00       	mov    $0x0,%eax
  81108e:	83 fa f4             	cmp    $0xfffffff4,%edx
  811091:	74 03                	je     811096 <tcp_input+0x4df>
  811093:	8b 42 0c             	mov    0xc(%edx),%eax
  811096:	89 43 04             	mov    %eax,0x4(%ebx)
    npcb->remote_port = tcphdr->src;
  811099:	a1 70 f5 b3 00       	mov    0xb3f570,%eax
  81109e:	0f b7 00             	movzwl (%eax),%eax
  8110a1:	66 89 43 1e          	mov    %ax,0x1e(%ebx)
    npcb->state = SYN_RCVD;
  8110a5:	c7 43 10 03 00 00 00 	movl   $0x3,0x10(%ebx)
    npcb->rcv_nxt = seqno + 1;
  8110ac:	a1 78 f5 b3 00       	mov    0xb3f578,%eax
  8110b1:	83 c0 01             	add    $0x1,%eax
  8110b4:	89 43 24             	mov    %eax,0x24(%ebx)
    npcb->snd_wnd = tcphdr->wnd;
  8110b7:	a1 70 f5 b3 00       	mov    0xb3f570,%eax
  8110bc:	0f b7 40 0e          	movzwl 0xe(%eax),%eax
  8110c0:	66 89 43 5c          	mov    %ax,0x5c(%ebx)
    npcb->ssthresh = npcb->snd_wnd;
  8110c4:	66 89 43 50          	mov    %ax,0x50(%ebx)
    npcb->snd_wl1 = seqno - 1;/* initialise to seqno-1 to force window update */
  8110c8:	a1 78 f5 b3 00       	mov    0xb3f578,%eax
  8110cd:	83 e8 01             	sub    $0x1,%eax
  8110d0:	89 43 60             	mov    %eax,0x60(%ebx)
    npcb->callback_arg = pcb->callback_arg;
  8110d3:	8b 47 18             	mov    0x18(%edi),%eax
  8110d6:	89 43 18             	mov    %eax,0x18(%ebx)
#if LWIP_CALLBACK_API
    npcb->accept = pcb->accept;
  8110d9:	8b 47 20             	mov    0x20(%edi),%eax
  8110dc:	89 83 90 00 00 00    	mov    %eax,0x90(%ebx)
#endif /* LWIP_CALLBACK_API */
    /* inherit socket options */
    npcb->so_options = pcb->so_options & (SOF_DEBUG|SOF_DONTROUTE|SOF_KEEPALIVE|SOF_OOBINLINE|SOF_LINGER);
  8110e2:	0f b7 47 08          	movzwl 0x8(%edi),%eax
  8110e6:	66 25 99 01          	and    $0x199,%ax
  8110ea:	66 89 43 08          	mov    %ax,0x8(%ebx)
    /* Register the new PCB so that we can begin receiving segments
       for it. */
    TCP_REG(&tcp_active_pcbs, npcb);
  8110ee:	a1 08 f6 b3 00       	mov    0xb3f608,%eax
  8110f3:	89 43 0c             	mov    %eax,0xc(%ebx)
  8110f6:	89 1d 08 f6 b3 00    	mov    %ebx,0xb3f608
  8110fc:	e8 9c 3e ff ff       	call   804f9d <tcp_timer_needed>

    /* Parse any options in the SYN. */
    tcp_parseopt(npcb);
  811101:	89 d8                	mov    %ebx,%eax
  811103:	e8 88 ed ff ff       	call   80fe90 <tcp_parseopt>
#if TCP_CALCULATE_EFF_SEND_MSS
    npcb->mss = tcp_eff_send_mss(npcb->mss, &(npcb->remote_ip));
  811108:	8d 43 04             	lea    0x4(%ebx),%eax
  81110b:	89 44 24 04          	mov    %eax,0x4(%esp)
  81110f:	0f b7 43 34          	movzwl 0x34(%ebx),%eax
  811113:	89 04 24             	mov    %eax,(%esp)
  811116:	e8 c8 77 ff ff       	call   8088e3 <tcp_eff_send_mss>
  81111b:	66 89 43 34          	mov    %ax,0x34(%ebx)
#endif /* TCP_CALCULATE_EFF_SEND_MSS */

    snmp_inc_tcppassiveopens();

    /* Build an MSS option. */
    optdata = TCP_BUILD_MSS_OPTION();
  81111f:	c7 04 24 b4 05 04 02 	movl   $0x20405b4,(%esp)
  811126:	e8 e9 9b ff ff       	call   80ad14 <htonl>
  81112b:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    /* Send a SYN|ACK together with the MSS option. */
    tcp_enqueue(npcb, NULL, 0, TCP_SYN | TCP_ACK, 0, (u8_t *)&optdata, 4);
  81112e:	c7 44 24 18 04 00 00 	movl   $0x4,0x18(%esp)
  811135:	00 
  811136:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  811139:	89 44 24 14          	mov    %eax,0x14(%esp)
  81113d:	c7 44 24 10 00 00 00 	movl   $0x0,0x10(%esp)
  811144:	00 
  811145:	c7 44 24 0c 12 00 00 	movl   $0x12,0xc(%esp)
  81114c:	00 
  81114d:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  811154:	00 
  811155:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  81115c:	00 
  81115d:	89 1c 24             	mov    %ebx,(%esp)
  811160:	e8 63 a7 ff ff       	call   80b8c8 <tcp_enqueue>
    return tcp_output(npcb);
  811165:	89 1c 24             	mov    %ebx,(%esp)
  811168:	e8 0e a2 ff ff       	call   80b37b <tcp_output>
          tcp_listen_pcbs.listen_pcbs = lpcb;
        }
      
        LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: packed for LISTENing connection.\n"));
        tcp_listen_input(lpcb);
        pbuf_free(p);
  81116d:	89 34 24             	mov    %esi,(%esp)
  811170:	e8 88 6d ff ff       	call   807efd <pbuf_free>
        return;
  811175:	e9 4a 08 00 00       	jmp    8119c4 <tcp_input+0xe0d>
    }

  /* Finally, if we still did not get a match, we check all PCBs that
     are LISTENing for incoming connections. */
    prev = NULL;
    for(lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
  81117a:	8b 47 0c             	mov    0xc(%edi),%eax
  81117d:	85 c0                	test   %eax,%eax
  81117f:	90                   	nop
  811180:	74 09                	je     81118b <tcp_input+0x5d4>
        LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: packed for LISTENing connection.\n"));
        tcp_listen_input(lpcb);
        pbuf_free(p);
        return;
      }
      prev = (struct tcp_pcb *)lpcb;
  811182:	89 fa                	mov    %edi,%edx
  811184:	89 c7                	mov    %eax,%edi
  811186:	e9 2b fe ff ff       	jmp    810fb6 <tcp_input+0x3ff>
  81118b:	8b 5d d4             	mov    -0x2c(%ebp),%ebx
  tcp_debug_print_flags(TCPH_FLAGS(tcphdr));
  LWIP_DEBUGF(TCP_INPUT_DEBUG, ("-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n"));
#endif /* TCP_INPUT_DEBUG */


  if (pcb != NULL) {
  81118e:	85 db                	test   %ebx,%ebx
  811190:	0f 84 9b 07 00 00    	je     811931 <tcp_input+0xd7a>
    tcp_debug_print_state(pcb->state);
#endif /* TCP_DEBUG */
#endif /* TCP_INPUT_DEBUG */

    /* Set up a tcp_seg structure. */
    inseg.next = NULL;
  811196:	c7 05 5c f5 b3 00 00 	movl   $0x0,0xb3f55c
  81119d:	00 00 00 
    inseg.len = p->tot_len;
  8111a0:	0f b7 46 08          	movzwl 0x8(%esi),%eax
  8111a4:	66 a3 68 f5 b3 00    	mov    %ax,0xb3f568
    inseg.dataptr = p->payload;
  8111aa:	8b 46 04             	mov    0x4(%esi),%eax
  8111ad:	a3 64 f5 b3 00       	mov    %eax,0xb3f564
    inseg.p = p;
  8111b2:	89 35 60 f5 b3 00    	mov    %esi,0xb3f560
    inseg.tcphdr = tcphdr;
  8111b8:	a1 70 f5 b3 00       	mov    0xb3f570,%eax
  8111bd:	a3 6c f5 b3 00       	mov    %eax,0xb3f56c

    recv_data = NULL;
  8111c2:	c7 05 88 f5 b3 00 00 	movl   $0x0,0xb3f588
  8111c9:	00 00 00 
    recv_flags = 0;
  8111cc:	c6 05 84 f5 b3 00 00 	movb   $0x0,0xb3f584

    /* If there is data which was previously "refused" by upper layer */
    if (pcb->refused_data != NULL) {
  8111d3:	8b 83 80 00 00 00    	mov    0x80(%ebx),%eax
  8111d9:	85 c0                	test   %eax,%eax
  8111db:	74 49                	je     811226 <tcp_input+0x66f>
      /* Notify again application with data previously received. */
      LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: notify kept packet\n"));
      TCP_EVENT_RECV(pcb, pcb->refused_data, ERR_OK, err);
  8111dd:	8b 93 88 00 00 00    	mov    0x88(%ebx),%edx
  8111e3:	85 d2                	test   %edx,%edx
  8111e5:	74 1e                	je     811205 <tcp_input+0x64e>
  8111e7:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  8111ee:	00 
  8111ef:	89 44 24 08          	mov    %eax,0x8(%esp)
  8111f3:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  8111f7:	8b 43 18             	mov    0x18(%ebx),%eax
  8111fa:	89 04 24             	mov    %eax,(%esp)
  8111fd:	ff d2                	call   *%edx
      if (err == ERR_OK) {
  8111ff:	84 c0                	test   %al,%al
  811201:	74 0a                	je     81120d <tcp_input+0x656>
  811203:	eb 14                	jmp    811219 <tcp_input+0x662>

    /* If there is data which was previously "refused" by upper layer */
    if (pcb->refused_data != NULL) {
      /* Notify again application with data previously received. */
      LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: notify kept packet\n"));
      TCP_EVENT_RECV(pcb, pcb->refused_data, ERR_OK, err);
  811205:	89 04 24             	mov    %eax,(%esp)
  811208:	e8 f0 6c ff ff       	call   807efd <pbuf_free>
      if (err == ERR_OK) {
        pcb->refused_data = NULL;
  81120d:	c7 83 80 00 00 00 00 	movl   $0x0,0x80(%ebx)
  811214:	00 00 00 
  811217:	eb 0d                	jmp    811226 <tcp_input+0x66f>
      } else {
        /* drop incoming packets, because pcb is "full" */
        LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: drop incoming packets, because pcb is \"full\"\n"));
        TCP_STATS_INC(tcp.drop);
        snmp_inc_tcpinerrs();
        pbuf_free(p);
  811219:	89 34 24             	mov    %esi,(%esp)
  81121c:	e8 dc 6c ff ff       	call   807efd <pbuf_free>
        return;
  811221:	e9 9e 07 00 00       	jmp    8119c4 <tcp_input+0xe0d>
      }
    }

    tcp_input_pcb = pcb;
  811226:	89 1d 24 f6 b3 00    	mov    %ebx,0xb3f624
  u8_t accepted_inseq;

  err = ERR_OK;

  /* Process incoming RST segments. */
  if (flags & TCP_RST) {
  81122c:	f6 05 80 f5 b3 00 04 	testb  $0x4,0xb3f580
  811233:	74 68                	je     81129d <tcp_input+0x6e6>
    /* First, determine if the reset is acceptable. */
    if (pcb->state == SYN_SENT) {
  811235:	8b 43 10             	mov    0x10(%ebx),%eax
  811238:	83 f8 02             	cmp    $0x2,%eax
  81123b:	75 0e                	jne    81124b <tcp_input+0x694>
  81123d:	8b 53 54             	mov    0x54(%ebx),%edx
  811240:	3b 15 7c f5 b3 00    	cmp    0xb3f57c,%edx
  811246:	0f 94 c2             	sete   %dl
  811249:	eb 1a                	jmp    811265 <tcp_input+0x6ae>
      if (ackno == pcb->snd_nxt) {
        acceptable = 1;
      }
    } else {
      if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, 
  81124b:	8b 15 78 f5 b3 00    	mov    0xb3f578,%edx
  811251:	2b 53 24             	sub    0x24(%ebx),%edx
  811254:	0f 88 51 07 00 00    	js     8119ab <tcp_input+0xdf4>
  81125a:	0f b7 4b 28          	movzwl 0x28(%ebx),%ecx
  81125e:	29 ca                	sub    %ecx,%edx
  811260:	85 d2                	test   %edx,%edx
  811262:	0f 9e c2             	setle  %dl
                          pcb->rcv_nxt+pcb->rcv_wnd)) {
        acceptable = 1;
      }
    }

    if (acceptable) {
  811265:	84 d2                	test   %dl,%dl
  811267:	0f 84 3e 07 00 00    	je     8119ab <tcp_input+0xdf4>
      LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_process: Connection RESET\n"));
      LWIP_ASSERT("tcp_input: pcb->state != CLOSED", pcb->state != CLOSED);
  81126d:	85 c0                	test   %eax,%eax
  81126f:	75 1c                	jne    81128d <tcp_input+0x6d6>
  811271:	c7 44 24 08 58 4f 81 	movl   $0x814f58,0x8(%esp)
  811278:	00 
  811279:	c7 44 24 04 09 02 00 	movl   $0x209,0x4(%esp)
  811280:	00 
  811281:	c7 04 24 78 4f 81 00 	movl   $0x814f78,(%esp)
  811288:	e8 0f f7 fe ff       	call   80099c <_panic>
      recv_flags = TF_RESET;
  81128d:	c6 05 84 f5 b3 00 08 	movb   $0x8,0xb3f584
      pcb->flags &= ~TF_ACK_DELAY;
  811294:	80 63 20 fe          	andb   $0xfe,0x20(%ebx)
  811298:	e9 0e 07 00 00       	jmp    8119ab <tcp_input+0xdf4>
      return ERR_OK;
    }
  }

  /* Update the PCB (in)activity timer. */
  pcb->tmr = tcp_ticks;
  81129d:	a1 0c f6 b3 00       	mov    0xb3f60c,%eax
  8112a2:	89 43 2c             	mov    %eax,0x2c(%ebx)
  pcb->keep_cnt_sent = 0;
  8112a5:	c6 83 a5 00 00 00 00 	movb   $0x0,0xa5(%ebx)

  /* Do different things depending on the TCP state. */
  switch (pcb->state) {
  8112ac:	83 7b 10 09          	cmpl   $0x9,0x10(%ebx)
  8112b0:	0f 87 07 05 00 00    	ja     8117bd <tcp_input+0xc06>
  8112b6:	8b 43 10             	mov    0x10(%ebx),%eax
  8112b9:	ff 24 85 fc 4f 81 00 	jmp    *0x814ffc(,%eax,4)
  case SYN_SENT:
    LWIP_DEBUGF(TCP_INPUT_DEBUG, ("SYN-SENT: ackno %"U32_F" pcb->snd_nxt %"U32_F" unacked %"U32_F"\n", ackno,
     pcb->snd_nxt, ntohl(pcb->unacked->tcphdr->seqno)));
    /* received SYN ACK with expected sequence number? */
    if ((flags & TCP_ACK) && (flags & TCP_SYN)
  8112c0:	0f b6 05 80 f5 b3 00 	movzbl 0xb3f580,%eax
  8112c7:	83 e0 12             	and    $0x12,%eax
  8112ca:	83 f8 12             	cmp    $0x12,%eax
  8112cd:	0f 85 0c 01 00 00    	jne    8113df <tcp_input+0x828>
        && ackno == ntohl(pcb->unacked->tcphdr->seqno) + 1) {
  8112d3:	8b 43 78             	mov    0x78(%ebx),%eax
  8112d6:	8b 40 10             	mov    0x10(%eax),%eax
  8112d9:	8b 40 04             	mov    0x4(%eax),%eax
  8112dc:	89 04 24             	mov    %eax,(%esp)
  8112df:	e8 51 9c ff ff       	call   80af35 <ntohl>
  switch (pcb->state) {
  case SYN_SENT:
    LWIP_DEBUGF(TCP_INPUT_DEBUG, ("SYN-SENT: ackno %"U32_F" pcb->snd_nxt %"U32_F" unacked %"U32_F"\n", ackno,
     pcb->snd_nxt, ntohl(pcb->unacked->tcphdr->seqno)));
    /* received SYN ACK with expected sequence number? */
    if ((flags & TCP_ACK) && (flags & TCP_SYN)
  8112e4:	83 c0 01             	add    $0x1,%eax
  8112e7:	3b 05 7c f5 b3 00    	cmp    0xb3f57c,%eax
  8112ed:	0f 85 ec 00 00 00    	jne    8113df <tcp_input+0x828>
        && ackno == ntohl(pcb->unacked->tcphdr->seqno) + 1) {
      pcb->snd_buf++;
  8112f3:	66 83 43 6e 01       	addw   $0x1,0x6e(%ebx)
      pcb->rcv_nxt = seqno + 1;
  8112f8:	a1 78 f5 b3 00       	mov    0xb3f578,%eax
  8112fd:	83 c0 01             	add    $0x1,%eax
  811300:	89 43 24             	mov    %eax,0x24(%ebx)
      pcb->lastack = ackno;
  811303:	a1 7c f5 b3 00       	mov    0xb3f57c,%eax
  811308:	89 43 48             	mov    %eax,0x48(%ebx)
      pcb->snd_wnd = tcphdr->wnd;
  81130b:	a1 70 f5 b3 00       	mov    0xb3f570,%eax
  811310:	0f b7 40 0e          	movzwl 0xe(%eax),%eax
  811314:	66 89 43 5c          	mov    %ax,0x5c(%ebx)
      pcb->snd_wl1 = seqno - 1; /* initialise to seqno - 1 to force window update */
  811318:	a1 78 f5 b3 00       	mov    0xb3f578,%eax
  81131d:	83 e8 01             	sub    $0x1,%eax
  811320:	89 43 60             	mov    %eax,0x60(%ebx)
      pcb->state = ESTABLISHED;
  811323:	c7 43 10 04 00 00 00 	movl   $0x4,0x10(%ebx)

      /* Parse any options in the SYNACK before using pcb->mss since that
       * can be changed by the received options! */
      tcp_parseopt(pcb);
  81132a:	89 d8                	mov    %ebx,%eax
  81132c:	e8 5f eb ff ff       	call   80fe90 <tcp_parseopt>
#if TCP_CALCULATE_EFF_SEND_MSS
      pcb->mss = tcp_eff_send_mss(pcb->mss, &(pcb->remote_ip));
  811331:	8d 43 04             	lea    0x4(%ebx),%eax
  811334:	89 44 24 04          	mov    %eax,0x4(%esp)
  811338:	0f b7 43 34          	movzwl 0x34(%ebx),%eax
  81133c:	89 04 24             	mov    %eax,(%esp)
  81133f:	e8 9f 75 ff ff       	call   8088e3 <tcp_eff_send_mss>
  811344:	66 89 43 34          	mov    %ax,0x34(%ebx)
#endif /* TCP_CALCULATE_EFF_SEND_MSS */

      /* Set ssthresh again after changing pcb->mss (already set in tcp_connect
       * but for the default value of pcb->mss) */
      pcb->ssthresh = pcb->mss * 10;
  811348:	6b d0 0a             	imul   $0xa,%eax,%edx
  81134b:	66 89 53 50          	mov    %dx,0x50(%ebx)

      pcb->cwnd = ((pcb->cwnd == 1) ? (pcb->mss * 2) : pcb->mss);
  81134f:	8d 14 00             	lea    (%eax,%eax,1),%edx
  811352:	66 83 7b 4e 01       	cmpw   $0x1,0x4e(%ebx)
  811357:	0f 44 c2             	cmove  %edx,%eax
  81135a:	66 89 43 4e          	mov    %ax,0x4e(%ebx)
      LWIP_ASSERT("pcb->snd_queuelen > 0", (pcb->snd_queuelen > 0));
  81135e:	0f b7 43 70          	movzwl 0x70(%ebx),%eax
  811362:	66 85 c0             	test   %ax,%ax
  811365:	75 1c                	jne    811383 <tcp_input+0x7cc>
  811367:	c7 44 24 08 d1 4f 81 	movl   $0x814fd1,0x8(%esp)
  81136e:	00 
  81136f:	c7 44 24 04 35 02 00 	movl   $0x235,0x4(%esp)
  811376:	00 
  811377:	c7 04 24 78 4f 81 00 	movl   $0x814f78,(%esp)
  81137e:	e8 19 f6 fe ff       	call   80099c <_panic>
      --pcb->snd_queuelen;
  811383:	83 e8 01             	sub    $0x1,%eax
  811386:	66 89 43 70          	mov    %ax,0x70(%ebx)
      LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_process: SYN-SENT --queuelen %"U16_F"\n", (u16_t)pcb->snd_queuelen));
      rseg = pcb->unacked;
  81138a:	8b 43 78             	mov    0x78(%ebx),%eax
      pcb->unacked = rseg->next;
  81138d:	8b 10                	mov    (%eax),%edx
  81138f:	89 53 78             	mov    %edx,0x78(%ebx)

      /* If there's nothing left to acknowledge, stop the retransmit
         timer, otherwise reset it to start again */
      if(pcb->unacked == NULL)
  811392:	85 d2                	test   %edx,%edx
  811394:	75 08                	jne    81139e <tcp_input+0x7e7>
        pcb->rtime = -1;
  811396:	66 c7 43 32 ff ff    	movw   $0xffff,0x32(%ebx)
  81139c:	eb 0a                	jmp    8113a8 <tcp_input+0x7f1>
      else {
        pcb->rtime = 0;
  81139e:	66 c7 43 32 00 00    	movw   $0x0,0x32(%ebx)
        pcb->nrtx = 0;
  8113a4:	c6 43 46 00          	movb   $0x0,0x46(%ebx)
      }

      tcp_seg_free(rseg);
  8113a8:	89 04 24             	mov    %eax,(%esp)
  8113ab:	e8 c1 76 ff ff       	call   808a71 <tcp_seg_free>

      /* Call the user specified function to call when sucessfully
       * connected. */
      TCP_EVENT_CONNECTED(pcb, ERR_OK, err);
  8113b0:	8b 83 8c 00 00 00    	mov    0x8c(%ebx),%eax
  8113b6:	85 c0                	test   %eax,%eax
  8113b8:	74 14                	je     8113ce <tcp_input+0x817>
  8113ba:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  8113c1:	00 
  8113c2:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  8113c6:	8b 53 18             	mov    0x18(%ebx),%edx
  8113c9:	89 14 24             	mov    %edx,(%esp)
  8113cc:	ff d0                	call   *%eax
      tcp_ack_now(pcb);
  8113ce:	80 4b 20 02          	orb    $0x2,0x20(%ebx)
  8113d2:	89 1c 24             	mov    %ebx,(%esp)
  8113d5:	e8 a1 9f ff ff       	call   80b37b <tcp_output>
  8113da:	e9 cc 05 00 00       	jmp    8119ab <tcp_input+0xdf4>
    }
    /* received ACK? possibly a half-open connection */
    else if (flags & TCP_ACK) {
  8113df:	f6 05 80 f5 b3 00 10 	testb  $0x10,0xb3f580
  8113e6:	0f 84 bf 05 00 00    	je     8119ab <tcp_input+0xdf4>
      /* send a RST to bring the other side in a non-synchronized state. */
      tcp_rst(ackno, seqno + tcplen, &(iphdr->dest), &(iphdr->src),
        tcphdr->dest, tcphdr->src);
  8113ec:	8b 15 70 f5 b3 00    	mov    0xb3f570,%edx
      tcp_ack_now(pcb);
    }
    /* received ACK? possibly a half-open connection */
    else if (flags & TCP_ACK) {
      /* send a RST to bring the other side in a non-synchronized state. */
      tcp_rst(ackno, seqno + tcplen, &(iphdr->dest), &(iphdr->src),
  8113f2:	a1 74 f5 b3 00       	mov    0xb3f574,%eax
  8113f7:	0f b7 0a             	movzwl (%edx),%ecx
  8113fa:	89 4c 24 14          	mov    %ecx,0x14(%esp)
  8113fe:	0f b7 52 02          	movzwl 0x2(%edx),%edx
  811402:	89 54 24 10          	mov    %edx,0x10(%esp)
  811406:	8d 50 0c             	lea    0xc(%eax),%edx
  811409:	89 54 24 0c          	mov    %edx,0xc(%esp)
  81140d:	83 c0 10             	add    $0x10,%eax
  811410:	89 44 24 08          	mov    %eax,0x8(%esp)
  811414:	0f b7 05 82 f5 b3 00 	movzwl 0xb3f582,%eax
  81141b:	03 05 78 f5 b3 00    	add    0xb3f578,%eax
  811421:	89 44 24 04          	mov    %eax,0x4(%esp)
  811425:	a1 7c f5 b3 00       	mov    0xb3f57c,%eax
  81142a:	89 04 24             	mov    %eax,(%esp)
  81142d:	e8 ea 9d ff ff       	call   80b21c <tcp_rst>
  811432:	e9 74 05 00 00       	jmp    8119ab <tcp_input+0xdf4>
        tcphdr->dest, tcphdr->src);
    }
    break;
  case SYN_RCVD:
    if (flags & TCP_ACK &&
  811437:	0f b6 05 80 f5 b3 00 	movzbl 0xb3f580,%eax
  81143e:	83 e0 14             	and    $0x14,%eax
  811441:	83 f8 10             	cmp    $0x10,%eax
  811444:	0f 85 61 05 00 00    	jne    8119ab <tcp_input+0xdf4>
       !(flags & TCP_RST)) {
      /* expected ACK number? */
      if (TCP_SEQ_BETWEEN(ackno, pcb->lastack+1, pcb->snd_nxt)) {
  81144a:	a1 7c f5 b3 00       	mov    0xb3f57c,%eax
  81144f:	8b 53 48             	mov    0x48(%ebx),%edx
  811452:	f7 d2                	not    %edx
  811454:	01 c2                	add    %eax,%edx
  811456:	0f 88 b7 00 00 00    	js     811513 <tcp_input+0x95c>
  81145c:	89 c2                	mov    %eax,%edx
  81145e:	2b 53 54             	sub    0x54(%ebx),%edx
  811461:	85 d2                	test   %edx,%edx
  811463:	0f 8f aa 00 00 00    	jg     811513 <tcp_input+0x95c>
        u16_t old_cwnd;
        pcb->state = ESTABLISHED;
  811469:	c7 43 10 04 00 00 00 	movl   $0x4,0x10(%ebx)
        LWIP_DEBUGF(TCP_DEBUG, ("TCP connection established %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
#if LWIP_CALLBACK_API
        LWIP_ASSERT("pcb->accept != NULL", pcb->accept != NULL);
  811470:	8b 83 90 00 00 00    	mov    0x90(%ebx),%eax
  811476:	85 c0                	test   %eax,%eax
  811478:	75 1c                	jne    811496 <tcp_input+0x8df>
  81147a:	c7 44 24 08 e7 4f 81 	movl   $0x814fe7,0x8(%esp)
  811481:	00 
  811482:	c7 44 24 04 5b 02 00 	movl   $0x25b,0x4(%esp)
  811489:	00 
  81148a:	c7 04 24 78 4f 81 00 	movl   $0x814f78,(%esp)
  811491:	e8 06 f5 fe ff       	call   80099c <_panic>
#endif
        /* Call the accept function. */
        TCP_EVENT_ACCEPT(pcb, ERR_OK, err);
  811496:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  81149d:	00 
  81149e:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  8114a2:	8b 53 18             	mov    0x18(%ebx),%edx
  8114a5:	89 14 24             	mov    %edx,(%esp)
  8114a8:	ff d0                	call   *%eax
        if (err != ERR_OK) {
  8114aa:	84 c0                	test   %al,%al
  8114ac:	74 17                	je     8114c5 <tcp_input+0x90e>
          /* If the accept function returns with an error, we abort
           * the connection. */
          tcp_abort(pcb);
  8114ae:	89 1c 24             	mov    %ebx,(%esp)
  8114b1:	e8 68 7b ff ff       	call   80901e <tcp_abort>
      }
    }

    tcp_input_pcb = pcb;
    err = tcp_process(pcb);
    tcp_input_pcb = NULL;
  8114b6:	c7 05 24 f6 b3 00 00 	movl   $0x0,0xb3f624
  8114bd:	00 00 00 
  8114c0:	e9 48 04 00 00       	jmp    81190d <tcp_input+0xd56>
          /* If the accept function returns with an error, we abort
           * the connection. */
          tcp_abort(pcb);
          return ERR_ABRT;
        }
        old_cwnd = pcb->cwnd;
  8114c5:	0f b7 73 4e          	movzwl 0x4e(%ebx),%esi
        /* If there was any data contained within this ACK,
         * we'd better pass it on to the application as well. */
        accepted_inseq = tcp_receive(pcb);
  8114c9:	89 d8                	mov    %ebx,%eax
  8114cb:	e8 70 ea ff ff       	call   80ff40 <tcp_receive>

        pcb->cwnd = ((old_cwnd == 1) ? (pcb->mss * 2) : pcb->mss);
  8114d0:	66 83 fe 01          	cmp    $0x1,%si
  8114d4:	75 08                	jne    8114de <tcp_input+0x927>
  8114d6:	0f b7 53 34          	movzwl 0x34(%ebx),%edx
  8114da:	01 d2                	add    %edx,%edx
  8114dc:	eb 04                	jmp    8114e2 <tcp_input+0x92b>
  8114de:	0f b7 53 34          	movzwl 0x34(%ebx),%edx
  8114e2:	66 89 53 4e          	mov    %dx,0x4e(%ebx)

        if ((flags & TCP_FIN) && accepted_inseq) {
  8114e6:	f6 05 80 f5 b3 00 01 	testb  $0x1,0xb3f580
  8114ed:	0f 84 b8 04 00 00    	je     8119ab <tcp_input+0xdf4>
  8114f3:	84 c0                	test   %al,%al
  8114f5:	0f 84 b0 04 00 00    	je     8119ab <tcp_input+0xdf4>
          tcp_ack_now(pcb);
  8114fb:	80 4b 20 02          	orb    $0x2,0x20(%ebx)
  8114ff:	89 1c 24             	mov    %ebx,(%esp)
  811502:	e8 74 9e ff ff       	call   80b37b <tcp_output>
          pcb->state = CLOSE_WAIT;
  811507:	c7 43 10 07 00 00 00 	movl   $0x7,0x10(%ebx)
  81150e:	e9 98 04 00 00       	jmp    8119ab <tcp_input+0xdf4>
      }
      /* incorrect ACK number */
      else {
        /* send RST */
        tcp_rst(ackno, seqno + tcplen, &(iphdr->dest), &(iphdr->src),
                tcphdr->dest, tcphdr->src);
  811513:	8b 0d 70 f5 b3 00    	mov    0xb3f570,%ecx
        }
      }
      /* incorrect ACK number */
      else {
        /* send RST */
        tcp_rst(ackno, seqno + tcplen, &(iphdr->dest), &(iphdr->src),
  811519:	8b 15 74 f5 b3 00    	mov    0xb3f574,%edx
  81151f:	0f b7 31             	movzwl (%ecx),%esi
  811522:	89 74 24 14          	mov    %esi,0x14(%esp)
  811526:	0f b7 49 02          	movzwl 0x2(%ecx),%ecx
  81152a:	89 4c 24 10          	mov    %ecx,0x10(%esp)
  81152e:	8d 4a 0c             	lea    0xc(%edx),%ecx
  811531:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
  811535:	83 c2 10             	add    $0x10,%edx
  811538:	89 54 24 08          	mov    %edx,0x8(%esp)
  81153c:	0f b7 15 82 f5 b3 00 	movzwl 0xb3f582,%edx
  811543:	03 15 78 f5 b3 00    	add    0xb3f578,%edx
  811549:	89 54 24 04          	mov    %edx,0x4(%esp)
  81154d:	89 04 24             	mov    %eax,(%esp)
  811550:	e8 c7 9c ff ff       	call   80b21c <tcp_rst>
  811555:	e9 51 04 00 00       	jmp    8119ab <tcp_input+0xdf4>
    }
    break;
  case CLOSE_WAIT:
    /* FALLTHROUGH */
  case ESTABLISHED:
    accepted_inseq = tcp_receive(pcb);
  81155a:	89 d8                	mov    %ebx,%eax
  81155c:	e8 df e9 ff ff       	call   80ff40 <tcp_receive>
    if ((flags & TCP_FIN) && accepted_inseq) { /* passive close */
  811561:	f6 05 80 f5 b3 00 01 	testb  $0x1,0xb3f580
  811568:	0f 84 3d 04 00 00    	je     8119ab <tcp_input+0xdf4>
  81156e:	84 c0                	test   %al,%al
  811570:	0f 84 35 04 00 00    	je     8119ab <tcp_input+0xdf4>
      tcp_ack_now(pcb);
  811576:	80 4b 20 02          	orb    $0x2,0x20(%ebx)
  81157a:	89 1c 24             	mov    %ebx,(%esp)
  81157d:	e8 f9 9d ff ff       	call   80b37b <tcp_output>
      pcb->state = CLOSE_WAIT;
  811582:	c7 43 10 07 00 00 00 	movl   $0x7,0x10(%ebx)
  811589:	e9 1d 04 00 00       	jmp    8119ab <tcp_input+0xdf4>
    }
    break;
  case FIN_WAIT_1:
    tcp_receive(pcb);
  81158e:	89 d8                	mov    %ebx,%eax
  811590:	e8 ab e9 ff ff       	call   80ff40 <tcp_receive>
    if (flags & TCP_FIN) {
  811595:	0f b6 05 80 f5 b3 00 	movzbl 0xb3f580,%eax
  81159c:	a8 01                	test   $0x1,%al
  81159e:	0f 84 a1 00 00 00    	je     811645 <tcp_input+0xa8e>
      if (flags & TCP_ACK && ackno == pcb->snd_nxt) {
  8115a4:	a8 10                	test   $0x10,%al
  8115a6:	0f 84 81 00 00 00    	je     81162d <tcp_input+0xa76>
  8115ac:	8b 43 54             	mov    0x54(%ebx),%eax
  8115af:	3b 05 7c f5 b3 00    	cmp    0xb3f57c,%eax
  8115b5:	75 76                	jne    81162d <tcp_input+0xa76>
        LWIP_DEBUGF(TCP_DEBUG,
          ("TCP connection closed %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
        tcp_ack_now(pcb);
  8115b7:	80 4b 20 02          	orb    $0x2,0x20(%ebx)
  8115bb:	89 1c 24             	mov    %ebx,(%esp)
  8115be:	e8 b8 9d ff ff       	call   80b37b <tcp_output>
        tcp_pcb_purge(pcb);
  8115c3:	89 1c 24             	mov    %ebx,(%esp)
  8115c6:	e8 1c 75 ff ff       	call   808ae7 <tcp_pcb_purge>
        TCP_RMV(&tcp_active_pcbs, pcb);
  8115cb:	a1 08 f6 b3 00       	mov    0xb3f608,%eax
  8115d0:	39 c3                	cmp    %eax,%ebx
  8115d2:	75 0a                	jne    8115de <tcp_input+0xa27>
  8115d4:	8b 43 0c             	mov    0xc(%ebx),%eax
  8115d7:	a3 08 f6 b3 00       	mov    %eax,0xb3f608
  8115dc:	eb 29                	jmp    811607 <tcp_input+0xa50>
  8115de:	a3 14 f6 b3 00       	mov    %eax,0xb3f614
  8115e3:	eb 19                	jmp    8115fe <tcp_input+0xa47>
  8115e5:	8b 50 0c             	mov    0xc(%eax),%edx
  8115e8:	85 d2                	test   %edx,%edx
  8115ea:	74 0c                	je     8115f8 <tcp_input+0xa41>
  8115ec:	39 d3                	cmp    %edx,%ebx
  8115ee:	75 08                	jne    8115f8 <tcp_input+0xa41>
  8115f0:	8b 53 0c             	mov    0xc(%ebx),%edx
  8115f3:	89 50 0c             	mov    %edx,0xc(%eax)
  8115f6:	eb 0f                	jmp    811607 <tcp_input+0xa50>
  8115f8:	89 15 14 f6 b3 00    	mov    %edx,0xb3f614
  8115fe:	a1 14 f6 b3 00       	mov    0xb3f614,%eax
  811603:	85 c0                	test   %eax,%eax
  811605:	75 de                	jne    8115e5 <tcp_input+0xa2e>
  811607:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
        pcb->state = TIME_WAIT;
  81160e:	c7 43 10 0a 00 00 00 	movl   $0xa,0x10(%ebx)
        TCP_REG(&tcp_tw_pcbs, pcb);
  811615:	a1 1c f6 b3 00       	mov    0xb3f61c,%eax
  81161a:	89 43 0c             	mov    %eax,0xc(%ebx)
  81161d:	89 1d 1c f6 b3 00    	mov    %ebx,0xb3f61c
  811623:	e8 75 39 ff ff       	call   804f9d <tcp_timer_needed>
  811628:	e9 7e 03 00 00       	jmp    8119ab <tcp_input+0xdf4>
      } else {
        tcp_ack_now(pcb);
  81162d:	80 4b 20 02          	orb    $0x2,0x20(%ebx)
  811631:	89 1c 24             	mov    %ebx,(%esp)
  811634:	e8 42 9d ff ff       	call   80b37b <tcp_output>
        pcb->state = CLOSING;
  811639:	c7 43 10 08 00 00 00 	movl   $0x8,0x10(%ebx)
  811640:	e9 66 03 00 00       	jmp    8119ab <tcp_input+0xdf4>
      }
    } else if (flags & TCP_ACK && ackno == pcb->snd_nxt) {
  811645:	a8 10                	test   $0x10,%al
  811647:	0f 84 5e 03 00 00    	je     8119ab <tcp_input+0xdf4>
  81164d:	8b 43 54             	mov    0x54(%ebx),%eax
  811650:	3b 05 7c f5 b3 00    	cmp    0xb3f57c,%eax
  811656:	0f 85 4f 03 00 00    	jne    8119ab <tcp_input+0xdf4>
      pcb->state = FIN_WAIT_2;
  81165c:	c7 43 10 06 00 00 00 	movl   $0x6,0x10(%ebx)
  811663:	e9 43 03 00 00       	jmp    8119ab <tcp_input+0xdf4>
    }
    break;
  case FIN_WAIT_2:
    tcp_receive(pcb);
  811668:	89 d8                	mov    %ebx,%eax
  81166a:	e8 d1 e8 ff ff       	call   80ff40 <tcp_receive>
    if (flags & TCP_FIN) {
  81166f:	f6 05 80 f5 b3 00 01 	testb  $0x1,0xb3f580
  811676:	0f 84 2f 03 00 00    	je     8119ab <tcp_input+0xdf4>
      LWIP_DEBUGF(TCP_DEBUG, ("TCP connection closed %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
      tcp_ack_now(pcb);
  81167c:	80 4b 20 02          	orb    $0x2,0x20(%ebx)
  811680:	89 1c 24             	mov    %ebx,(%esp)
  811683:	e8 f3 9c ff ff       	call   80b37b <tcp_output>
      tcp_pcb_purge(pcb);
  811688:	89 1c 24             	mov    %ebx,(%esp)
  81168b:	e8 57 74 ff ff       	call   808ae7 <tcp_pcb_purge>
      TCP_RMV(&tcp_active_pcbs, pcb);
  811690:	8b 15 08 f6 b3 00    	mov    0xb3f608,%edx
  811696:	39 d3                	cmp    %edx,%ebx
  811698:	75 0a                	jne    8116a4 <tcp_input+0xaed>
  81169a:	8b 43 0c             	mov    0xc(%ebx),%eax
  81169d:	a3 08 f6 b3 00       	mov    %eax,0xb3f608
  8116a2:	eb 2a                	jmp    8116ce <tcp_input+0xb17>
  8116a4:	89 15 14 f6 b3 00    	mov    %edx,0xb3f614
  8116aa:	85 d2                	test   %edx,%edx
  8116ac:	74 20                	je     8116ce <tcp_input+0xb17>
  8116ae:	8b 42 0c             	mov    0xc(%edx),%eax
  8116b1:	85 c0                	test   %eax,%eax
  8116b3:	0f 84 dd 02 00 00    	je     811996 <tcp_input+0xddf>
  8116b9:	39 c3                	cmp    %eax,%ebx
  8116bb:	75 08                	jne    8116c5 <tcp_input+0xb0e>
  8116bd:	8b 43 0c             	mov    0xc(%ebx),%eax
  8116c0:	89 42 0c             	mov    %eax,0xc(%edx)
  8116c3:	eb 09                	jmp    8116ce <tcp_input+0xb17>
  8116c5:	a3 14 f6 b3 00       	mov    %eax,0xb3f614
  8116ca:	89 c2                	mov    %eax,%edx
  8116cc:	eb e0                	jmp    8116ae <tcp_input+0xaf7>
  8116ce:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
      pcb->state = TIME_WAIT;
  8116d5:	c7 43 10 0a 00 00 00 	movl   $0xa,0x10(%ebx)
      TCP_REG(&tcp_tw_pcbs, pcb);
  8116dc:	a1 1c f6 b3 00       	mov    0xb3f61c,%eax
  8116e1:	89 43 0c             	mov    %eax,0xc(%ebx)
  8116e4:	89 1d 1c f6 b3 00    	mov    %ebx,0xb3f61c
  8116ea:	e8 ae 38 ff ff       	call   804f9d <tcp_timer_needed>
  8116ef:	e9 b7 02 00 00       	jmp    8119ab <tcp_input+0xdf4>
    }
    break;
  case CLOSING:
    tcp_receive(pcb);
  8116f4:	89 d8                	mov    %ebx,%eax
  8116f6:	e8 45 e8 ff ff       	call   80ff40 <tcp_receive>
    if (flags & TCP_ACK && ackno == pcb->snd_nxt) {
  8116fb:	f6 05 80 f5 b3 00 10 	testb  $0x10,0xb3f580
  811702:	0f 84 a3 02 00 00    	je     8119ab <tcp_input+0xdf4>
  811708:	8b 43 54             	mov    0x54(%ebx),%eax
  81170b:	3b 05 7c f5 b3 00    	cmp    0xb3f57c,%eax
  811711:	0f 85 94 02 00 00    	jne    8119ab <tcp_input+0xdf4>
      LWIP_DEBUGF(TCP_DEBUG, ("TCP connection closed %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
      tcp_ack_now(pcb);
  811717:	80 4b 20 02          	orb    $0x2,0x20(%ebx)
  81171b:	89 1c 24             	mov    %ebx,(%esp)
  81171e:	e8 58 9c ff ff       	call   80b37b <tcp_output>
      tcp_pcb_purge(pcb);
  811723:	89 1c 24             	mov    %ebx,(%esp)
  811726:	e8 bc 73 ff ff       	call   808ae7 <tcp_pcb_purge>
      TCP_RMV(&tcp_active_pcbs, pcb);
  81172b:	a1 08 f6 b3 00       	mov    0xb3f608,%eax
  811730:	39 c3                	cmp    %eax,%ebx
  811732:	75 0a                	jne    81173e <tcp_input+0xb87>
  811734:	8b 43 0c             	mov    0xc(%ebx),%eax
  811737:	a3 08 f6 b3 00       	mov    %eax,0xb3f608
  81173c:	eb 2a                	jmp    811768 <tcp_input+0xbb1>
  81173e:	a3 14 f6 b3 00       	mov    %eax,0xb3f614
  811743:	85 c0                	test   %eax,%eax
  811745:	74 21                	je     811768 <tcp_input+0xbb1>
  811747:	8b 50 0c             	mov    0xc(%eax),%edx
  81174a:	85 d2                	test   %edx,%edx
  81174c:	0f 84 4e 02 00 00    	je     8119a0 <tcp_input+0xde9>
  811752:	39 d3                	cmp    %edx,%ebx
  811754:	75 08                	jne    81175e <tcp_input+0xba7>
  811756:	8b 53 0c             	mov    0xc(%ebx),%edx
  811759:	89 50 0c             	mov    %edx,0xc(%eax)
  81175c:	eb 0a                	jmp    811768 <tcp_input+0xbb1>
  81175e:	89 15 14 f6 b3 00    	mov    %edx,0xb3f614
  811764:	89 d0                	mov    %edx,%eax
  811766:	eb df                	jmp    811747 <tcp_input+0xb90>
  811768:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
      pcb->state = TIME_WAIT;
  81176f:	c7 43 10 0a 00 00 00 	movl   $0xa,0x10(%ebx)
      TCP_REG(&tcp_tw_pcbs, pcb);
  811776:	a1 1c f6 b3 00       	mov    0xb3f61c,%eax
  81177b:	89 43 0c             	mov    %eax,0xc(%ebx)
  81177e:	89 1d 1c f6 b3 00    	mov    %ebx,0xb3f61c
  811784:	e8 14 38 ff ff       	call   804f9d <tcp_timer_needed>
  811789:	e9 1d 02 00 00       	jmp    8119ab <tcp_input+0xdf4>
    }
    break;
  case LAST_ACK:
    tcp_receive(pcb);
  81178e:	89 d8                	mov    %ebx,%eax
  811790:	e8 ab e7 ff ff       	call   80ff40 <tcp_receive>
    if (flags & TCP_ACK && ackno == pcb->snd_nxt) {
  811795:	f6 05 80 f5 b3 00 10 	testb  $0x10,0xb3f580
  81179c:	0f 84 09 02 00 00    	je     8119ab <tcp_input+0xdf4>
  8117a2:	8b 43 54             	mov    0x54(%ebx),%eax
  8117a5:	3b 05 7c f5 b3 00    	cmp    0xb3f57c,%eax
  8117ab:	0f 85 fa 01 00 00    	jne    8119ab <tcp_input+0xdf4>
      LWIP_DEBUGF(TCP_DEBUG, ("TCP connection closed %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
      /* bugfix #21699: don't set pcb->state to CLOSED here or we risk leaking segments */
      recv_flags = TF_CLOSED;
  8117b1:	c6 05 84 f5 b3 00 10 	movb   $0x10,0xb3f584
  8117b8:	e9 ee 01 00 00       	jmp    8119ab <tcp_input+0xdf4>
      }
    }

    tcp_input_pcb = pcb;
    err = tcp_process(pcb);
    tcp_input_pcb = NULL;
  8117bd:	c7 05 24 f6 b3 00 00 	movl   $0x0,0xb3f624
  8117c4:	00 00 00 
    /* A return value of ERR_ABRT means that tcp_abort() was called
       and that the pcb has been freed. If so, we don't do anything. */
    if (err != ERR_ABRT) {
      if (recv_flags & TF_RESET) {
  8117c7:	0f b6 05 84 f5 b3 00 	movzbl 0xb3f584,%eax
  8117ce:	a8 08                	test   $0x8,%al
  8117d0:	74 3f                	je     811811 <tcp_input+0xc5a>
        /* TF_RESET means that the connection was reset by the other
           end. We then call the error callback to inform the
           application that the connection is dead before we
           deallocate the PCB. */
        TCP_EVENT_ERR(pcb->errf, pcb->callback_arg, ERR_RST);
  8117d2:	8b 83 98 00 00 00    	mov    0x98(%ebx),%eax
  8117d8:	85 c0                	test   %eax,%eax
  8117da:	74 10                	je     8117ec <tcp_input+0xc35>
  8117dc:	c7 44 24 04 fa ff ff 	movl   $0xfffffffa,0x4(%esp)
  8117e3:	ff 
  8117e4:	8b 53 18             	mov    0x18(%ebx),%edx
  8117e7:	89 14 24             	mov    %edx,(%esp)
  8117ea:	ff d0                	call   *%eax
        tcp_pcb_remove(&tcp_active_pcbs, pcb);
  8117ec:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  8117f0:	c7 04 24 08 f6 b3 00 	movl   $0xb3f608,(%esp)
  8117f7:	e8 64 73 ff ff       	call   808b60 <tcp_pcb_remove>
        memp_free(MEMP_TCP_PCB, pcb);
  8117fc:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  811800:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  811807:	e8 68 5f ff ff       	call   807774 <memp_free>
  81180c:	e9 fc 00 00 00       	jmp    81190d <tcp_input+0xd56>
      } else if (recv_flags & TF_CLOSED) {
  811811:	a8 10                	test   $0x10,%al
  811813:	74 25                	je     81183a <tcp_input+0xc83>
        /* The connection has been closed and we will deallocate the
           PCB. */
        tcp_pcb_remove(&tcp_active_pcbs, pcb);
  811815:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  811819:	c7 04 24 08 f6 b3 00 	movl   $0xb3f608,(%esp)
  811820:	e8 3b 73 ff ff       	call   808b60 <tcp_pcb_remove>
        memp_free(MEMP_TCP_PCB, pcb);
  811825:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  811829:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  811830:	e8 3f 5f ff ff       	call   807774 <memp_free>
  811835:	e9 d3 00 00 00       	jmp    81190d <tcp_input+0xd56>
      } else {
        err = ERR_OK;
        /* If the application has registered a "sent" function to be
           called when new send buffer space is available, we call it
           now. */
        if (pcb->acked > 0) {
  81183a:	0f b7 43 6c          	movzwl 0x6c(%ebx),%eax
  81183e:	66 85 c0             	test   %ax,%ax
  811841:	74 1f                	je     811862 <tcp_input+0xcab>
          TCP_EVENT_SENT(pcb, pcb->acked, err);
  811843:	8b 93 84 00 00 00    	mov    0x84(%ebx),%edx
  811849:	85 d2                	test   %edx,%edx
  81184b:	74 15                	je     811862 <tcp_input+0xcab>
  81184d:	0f b7 c0             	movzwl %ax,%eax
  811850:	89 44 24 08          	mov    %eax,0x8(%esp)
  811854:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  811858:	8b 43 18             	mov    0x18(%ebx),%eax
  81185b:	89 04 24             	mov    %eax,(%esp)
  81185e:	ff d2                	call   *%edx
  811860:	eb 05                	jmp    811867 <tcp_input+0xcb0>
  811862:	b8 00 00 00 00       	mov    $0x0,%eax
        }
      
        if (recv_data != NULL) {
  811867:	8b 15 88 f5 b3 00    	mov    0xb3f588,%edx
  81186d:	85 d2                	test   %edx,%edx
  81186f:	74 61                	je     8118d2 <tcp_input+0xd1b>
          if(flags & TCP_PSH) {
  811871:	f6 05 80 f5 b3 00 08 	testb  $0x8,0xb3f580
  811878:	74 04                	je     81187e <tcp_input+0xcc7>
            recv_data->flags |= PBUF_FLAG_PUSH;
  81187a:	80 4a 0d 01          	orb    $0x1,0xd(%edx)
          }

          /* Notify application that data has been received. */
          TCP_EVENT_RECV(pcb, recv_data, ERR_OK, err);
  81187e:	8b 83 88 00 00 00    	mov    0x88(%ebx),%eax
  811884:	85 c0                	test   %eax,%eax
  811886:	74 24                	je     8118ac <tcp_input+0xcf5>
  811888:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  81188f:	00 
  811890:	8b 15 88 f5 b3 00    	mov    0xb3f588,%edx
  811896:	89 54 24 08          	mov    %edx,0x8(%esp)
  81189a:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  81189e:	8b 53 18             	mov    0x18(%ebx),%edx
  8118a1:	89 14 24             	mov    %edx,(%esp)
  8118a4:	ff d0                	call   *%eax

          /* If the upper layer can't receive this data, store it */
          if (err != ERR_OK) {
  8118a6:	84 c0                	test   %al,%al
  8118a8:	75 1c                	jne    8118c6 <tcp_input+0xd0f>
  8118aa:	eb 26                	jmp    8118d2 <tcp_input+0xd1b>
          if(flags & TCP_PSH) {
            recv_data->flags |= PBUF_FLAG_PUSH;
          }

          /* Notify application that data has been received. */
          TCP_EVENT_RECV(pcb, recv_data, ERR_OK, err);
  8118ac:	a1 88 f5 b3 00       	mov    0xb3f588,%eax
  8118b1:	85 c0                	test   %eax,%eax
  8118b3:	0f 84 01 01 00 00    	je     8119ba <tcp_input+0xe03>
  8118b9:	89 04 24             	mov    %eax,(%esp)
  8118bc:	e8 3c 66 ff ff       	call   807efd <pbuf_free>
  8118c1:	e9 f4 00 00 00       	jmp    8119ba <tcp_input+0xe03>

          /* If the upper layer can't receive this data, store it */
          if (err != ERR_OK) {
            pcb->refused_data = recv_data;
  8118c6:	8b 15 88 f5 b3 00    	mov    0xb3f588,%edx
  8118cc:	89 93 80 00 00 00    	mov    %edx,0x80(%ebx)
          }
        }

        /* If a FIN segment was received, we call the callback
           function with a NULL buffer to indicate EOF. */
        if (recv_flags & TF_GOT_FIN) {
  8118d2:	f6 05 84 f5 b3 00 20 	testb  $0x20,0xb3f584
  8118d9:	74 26                	je     811901 <tcp_input+0xd4a>
          TCP_EVENT_RECV(pcb, NULL, ERR_OK, err);
  8118db:	8b 83 88 00 00 00    	mov    0x88(%ebx),%eax
  8118e1:	85 c0                	test   %eax,%eax
  8118e3:	74 20                	je     811905 <tcp_input+0xd4e>
  8118e5:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  8118ec:	00 
  8118ed:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  8118f4:	00 
  8118f5:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  8118f9:	8b 53 18             	mov    0x18(%ebx),%edx
  8118fc:	89 14 24             	mov    %edx,(%esp)
  8118ff:	ff d0                	call   *%eax
        }

        /* If there were no errors, we try to send something out. */
        if (err == ERR_OK) {
  811901:	84 c0                	test   %al,%al
  811903:	75 08                	jne    81190d <tcp_input+0xd56>
          tcp_output(pcb);
  811905:	89 1c 24             	mov    %ebx,(%esp)
  811908:	e8 6e 9a ff ff       	call   80b37b <tcp_output>
      }
    }


    /* give up our reference to inseg.p */
    if (inseg.p != NULL)
  81190d:	a1 60 f5 b3 00       	mov    0xb3f560,%eax
  811912:	85 c0                	test   %eax,%eax
  811914:	0f 84 aa 00 00 00    	je     8119c4 <tcp_input+0xe0d>
    {
      pbuf_free(inseg.p);
  81191a:	89 04 24             	mov    %eax,(%esp)
  81191d:	e8 db 65 ff ff       	call   807efd <pbuf_free>
      inseg.p = NULL;
  811922:	c7 05 60 f5 b3 00 00 	movl   $0x0,0xb3f560
  811929:	00 00 00 
  81192c:	e9 93 00 00 00       	jmp    8119c4 <tcp_input+0xe0d>
  } else {

    /* If no matching PCB was found, send a TCP RST (reset) to the
       sender. */
    LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_input: no PCB match found, resetting.\n"));
    if (!(TCPH_FLAGS(tcphdr) & TCP_RST)) {
  811931:	a1 70 f5 b3 00       	mov    0xb3f570,%eax
  811936:	0f b7 40 0c          	movzwl 0xc(%eax),%eax
  81193a:	89 04 24             	mov    %eax,(%esp)
  81193d:	e8 be 93 ff ff       	call   80ad00 <ntohs>
  811942:	a8 04                	test   $0x4,%al
  811944:	75 46                	jne    81198c <tcp_input+0xdd5>
      TCP_STATS_INC(tcp.proterr);
      TCP_STATS_INC(tcp.drop);
      tcp_rst(ackno, seqno + tcplen,
        &(iphdr->dest), &(iphdr->src),
        tcphdr->dest, tcphdr->src);
  811946:	8b 15 70 f5 b3 00    	mov    0xb3f570,%edx
    LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_input: no PCB match found, resetting.\n"));
    if (!(TCPH_FLAGS(tcphdr) & TCP_RST)) {
      TCP_STATS_INC(tcp.proterr);
      TCP_STATS_INC(tcp.drop);
      tcp_rst(ackno, seqno + tcplen,
        &(iphdr->dest), &(iphdr->src),
  81194c:	a1 74 f5 b3 00       	mov    0xb3f574,%eax
       sender. */
    LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_input: no PCB match found, resetting.\n"));
    if (!(TCPH_FLAGS(tcphdr) & TCP_RST)) {
      TCP_STATS_INC(tcp.proterr);
      TCP_STATS_INC(tcp.drop);
      tcp_rst(ackno, seqno + tcplen,
  811951:	0f b7 0a             	movzwl (%edx),%ecx
  811954:	89 4c 24 14          	mov    %ecx,0x14(%esp)
  811958:	0f b7 52 02          	movzwl 0x2(%edx),%edx
  81195c:	89 54 24 10          	mov    %edx,0x10(%esp)
  811960:	8d 50 0c             	lea    0xc(%eax),%edx
  811963:	89 54 24 0c          	mov    %edx,0xc(%esp)
  811967:	83 c0 10             	add    $0x10,%eax
  81196a:	89 44 24 08          	mov    %eax,0x8(%esp)
  81196e:	0f b7 05 82 f5 b3 00 	movzwl 0xb3f582,%eax
  811975:	03 05 78 f5 b3 00    	add    0xb3f578,%eax
  81197b:	89 44 24 04          	mov    %eax,0x4(%esp)
  81197f:	a1 7c f5 b3 00       	mov    0xb3f57c,%eax
  811984:	89 04 24             	mov    %eax,(%esp)
  811987:	e8 90 98 ff ff       	call   80b21c <tcp_rst>
        &(iphdr->dest), &(iphdr->src),
        tcphdr->dest, tcphdr->src);
    }
    pbuf_free(p);
  81198c:	89 34 24             	mov    %esi,(%esp)
  81198f:	e8 69 65 ff ff       	call   807efd <pbuf_free>
  811994:	eb 2e                	jmp    8119c4 <tcp_input+0xe0d>
    tcp_receive(pcb);
    if (flags & TCP_FIN) {
      LWIP_DEBUGF(TCP_DEBUG, ("TCP connection closed %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
      tcp_ack_now(pcb);
      tcp_pcb_purge(pcb);
      TCP_RMV(&tcp_active_pcbs, pcb);
  811996:	a3 14 f6 b3 00       	mov    %eax,0xb3f614
  81199b:	e9 2e fd ff ff       	jmp    8116ce <tcp_input+0xb17>
    tcp_receive(pcb);
    if (flags & TCP_ACK && ackno == pcb->snd_nxt) {
      LWIP_DEBUGF(TCP_DEBUG, ("TCP connection closed %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
      tcp_ack_now(pcb);
      tcp_pcb_purge(pcb);
      TCP_RMV(&tcp_active_pcbs, pcb);
  8119a0:	89 15 14 f6 b3 00    	mov    %edx,0xb3f614
  8119a6:	e9 bd fd ff ff       	jmp    811768 <tcp_input+0xbb1>
      }
    }

    tcp_input_pcb = pcb;
    err = tcp_process(pcb);
    tcp_input_pcb = NULL;
  8119ab:	c7 05 24 f6 b3 00 00 	movl   $0x0,0xb3f624
  8119b2:	00 00 00 
  8119b5:	e9 0d fe ff ff       	jmp    8117c7 <tcp_input+0xc10>
  8119ba:	b8 00 00 00 00       	mov    $0x0,%eax
  8119bf:	e9 0e ff ff ff       	jmp    8118d2 <tcp_input+0xd1b>
    pbuf_free(p);
  }

  LWIP_ASSERT("tcp_input: tcp_pcbs_sane()", tcp_pcbs_sane());
  PERF_STOP("tcp_input");
}
  8119c4:	83 c4 5c             	add    $0x5c,%esp
  8119c7:	5b                   	pop    %ebx
  8119c8:	5e                   	pop    %esi
  8119c9:	5f                   	pop    %edi
  8119ca:	5d                   	pop    %ebp
  8119cb:	c3                   	ret    
  8119cc:	00 00                	add    %al,(%eax)
	...

008119d0 <raw_bind>:
 *
 * @see raw_disconnect()
 */
err_t
raw_bind(struct raw_pcb *pcb, struct ip_addr *ipaddr)
{
  8119d0:	55                   	push   %ebp
  8119d1:	89 e5                	mov    %esp,%ebp
  8119d3:	8b 55 0c             	mov    0xc(%ebp),%edx
  ip_addr_set(&pcb->local_ip, ipaddr);
  8119d6:	b8 00 00 00 00       	mov    $0x0,%eax
  8119db:	85 d2                	test   %edx,%edx
  8119dd:	74 02                	je     8119e1 <raw_bind+0x11>
  8119df:	8b 02                	mov    (%edx),%eax
  8119e1:	8b 55 08             	mov    0x8(%ebp),%edx
  8119e4:	89 02                	mov    %eax,(%edx)
  return ERR_OK;
}
  8119e6:	b8 00 00 00 00       	mov    $0x0,%eax
  8119eb:	5d                   	pop    %ebp
  8119ec:	c3                   	ret    

008119ed <raw_connect>:
 *
 * @see raw_disconnect() and raw_sendto()
 */
err_t
raw_connect(struct raw_pcb *pcb, struct ip_addr *ipaddr)
{
  8119ed:	55                   	push   %ebp
  8119ee:	89 e5                	mov    %esp,%ebp
  8119f0:	8b 55 0c             	mov    0xc(%ebp),%edx
  ip_addr_set(&pcb->remote_ip, ipaddr);
  8119f3:	b8 00 00 00 00       	mov    $0x0,%eax
  8119f8:	85 d2                	test   %edx,%edx
  8119fa:	74 02                	je     8119fe <raw_connect+0x11>
  8119fc:	8b 02                	mov    (%edx),%eax
  8119fe:	8b 55 08             	mov    0x8(%ebp),%edx
  811a01:	89 42 04             	mov    %eax,0x4(%edx)
  return ERR_OK;
}
  811a04:	b8 00 00 00 00       	mov    $0x0,%eax
  811a09:	5d                   	pop    %ebp
  811a0a:	c3                   	ret    

00811a0b <raw_recv>:
void
raw_recv(struct raw_pcb *pcb,
         u8_t (* recv)(void *arg, struct raw_pcb *upcb, struct pbuf *p,
                      struct ip_addr *addr),
         void *recv_arg)
{
  811a0b:	55                   	push   %ebp
  811a0c:	89 e5                	mov    %esp,%ebp
  811a0e:	8b 45 08             	mov    0x8(%ebp),%eax
  /* remember recv() callback and user data */
  pcb->recv = recv;
  811a11:	8b 55 0c             	mov    0xc(%ebp),%edx
  811a14:	89 50 14             	mov    %edx,0x14(%eax)
  pcb->recv_arg = recv_arg;
  811a17:	8b 55 10             	mov    0x10(%ebp),%edx
  811a1a:	89 50 18             	mov    %edx,0x18(%eax)
}
  811a1d:	5d                   	pop    %ebp
  811a1e:	c3                   	ret    

00811a1f <raw_new>:
 * @param proto the protocol number of the IPs payload (e.g. IP_PROTO_ICMP)
 *
 * @see raw_remove()
 */
struct raw_pcb *
raw_new(u8_t proto) {
  811a1f:	55                   	push   %ebp
  811a20:	89 e5                	mov    %esp,%ebp
  811a22:	83 ec 18             	sub    $0x18,%esp
  811a25:	89 5d f8             	mov    %ebx,-0x8(%ebp)
  811a28:	89 75 fc             	mov    %esi,-0x4(%ebp)
  811a2b:	0f b6 75 08          	movzbl 0x8(%ebp),%esi
  struct raw_pcb *pcb;

  LWIP_DEBUGF(RAW_DEBUG | LWIP_DBG_TRACE | 3, ("raw_new\n"));

  pcb = memp_malloc(MEMP_RAW_PCB);
  811a2f:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  811a36:	e8 7d 5d ff ff       	call   8077b8 <memp_malloc>
  811a3b:	89 c3                	mov    %eax,%ebx
  /* could allocate RAW PCB? */
  if (pcb != NULL) {
  811a3d:	85 c0                	test   %eax,%eax
  811a3f:	74 2f                	je     811a70 <raw_new+0x51>
    /* initialize PCB to all zeroes */
    memset(pcb, 0, sizeof(struct raw_pcb));
  811a41:	c7 44 24 08 1c 00 00 	movl   $0x1c,0x8(%esp)
  811a48:	00 
  811a49:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  811a50:	00 
  811a51:	89 04 24             	mov    %eax,(%esp)
  811a54:	e8 2d f8 fe ff       	call   801286 <memset>
    pcb->protocol = proto;
  811a59:	89 f0                	mov    %esi,%eax
  811a5b:	88 43 10             	mov    %al,0x10(%ebx)
    pcb->ttl = RAW_TTL;
  811a5e:	c6 43 0b ff          	movb   $0xff,0xb(%ebx)
    pcb->next = raw_pcbs;
  811a62:	a1 8c f5 b3 00       	mov    0xb3f58c,%eax
  811a67:	89 43 0c             	mov    %eax,0xc(%ebx)
    raw_pcbs = pcb;
  811a6a:	89 1d 8c f5 b3 00    	mov    %ebx,0xb3f58c
  }
  return pcb;
}
  811a70:	89 d8                	mov    %ebx,%eax
  811a72:	8b 5d f8             	mov    -0x8(%ebp),%ebx
  811a75:	8b 75 fc             	mov    -0x4(%ebp),%esi
  811a78:	89 ec                	mov    %ebp,%esp
  811a7a:	5d                   	pop    %ebp
  811a7b:	c3                   	ret    

00811a7c <raw_remove>:
 *
 * @see raw_new()
 */
void
raw_remove(struct raw_pcb *pcb)
{
  811a7c:	55                   	push   %ebp
  811a7d:	89 e5                	mov    %esp,%ebp
  811a7f:	83 ec 18             	sub    $0x18,%esp
  811a82:	8b 4d 08             	mov    0x8(%ebp),%ecx
  struct raw_pcb *pcb2;
  /* pcb to be removed is first in list? */
  if (raw_pcbs == pcb) {
  811a85:	8b 15 8c f5 b3 00    	mov    0xb3f58c,%edx
  811a8b:	39 ca                	cmp    %ecx,%edx
  811a8d:	74 06                	je     811a95 <raw_remove+0x19>
    /* make list start at 2nd pcb */
    raw_pcbs = raw_pcbs->next;
    /* pcb not 1st in list */
  } else {
    for(pcb2 = raw_pcbs; pcb2 != NULL; pcb2 = pcb2->next) {
  811a8f:	85 d2                	test   %edx,%edx
  811a91:	75 0e                	jne    811aa1 <raw_remove+0x25>
  811a93:	eb 21                	jmp    811ab6 <raw_remove+0x3a>
{
  struct raw_pcb *pcb2;
  /* pcb to be removed is first in list? */
  if (raw_pcbs == pcb) {
    /* make list start at 2nd pcb */
    raw_pcbs = raw_pcbs->next;
  811a95:	8b 42 0c             	mov    0xc(%edx),%eax
  811a98:	a3 8c f5 b3 00       	mov    %eax,0xb3f58c
  811a9d:	eb 17                	jmp    811ab6 <raw_remove+0x3a>
  811a9f:	89 c2                	mov    %eax,%edx
    /* pcb not 1st in list */
  } else {
    for(pcb2 = raw_pcbs; pcb2 != NULL; pcb2 = pcb2->next) {
      /* find pcb in raw_pcbs list */
      if (pcb2->next != NULL && pcb2->next == pcb) {
  811aa1:	8b 42 0c             	mov    0xc(%edx),%eax
  811aa4:	85 c0                	test   %eax,%eax
  811aa6:	74 0e                	je     811ab6 <raw_remove+0x3a>
  811aa8:	39 c1                	cmp    %eax,%ecx
  811aaa:	75 f3                	jne    811a9f <raw_remove+0x23>
        /* remove pcb from list */
        pcb2->next = pcb->next;
  811aac:	8b 41 0c             	mov    0xc(%ecx),%eax
  811aaf:	89 42 0c             	mov    %eax,0xc(%edx)
  if (raw_pcbs == pcb) {
    /* make list start at 2nd pcb */
    raw_pcbs = raw_pcbs->next;
    /* pcb not 1st in list */
  } else {
    for(pcb2 = raw_pcbs; pcb2 != NULL; pcb2 = pcb2->next) {
  811ab2:	85 c0                	test   %eax,%eax
  811ab4:	75 e9                	jne    811a9f <raw_remove+0x23>
        /* remove pcb from list */
        pcb2->next = pcb->next;
      }
    }
  }
  memp_free(MEMP_RAW_PCB, pcb);
  811ab6:	89 4c 24 04          	mov    %ecx,0x4(%esp)
  811aba:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  811ac1:	e8 ae 5c ff ff       	call   807774 <memp_free>
}
  811ac6:	c9                   	leave  
  811ac7:	c3                   	ret    

00811ac8 <raw_sendto>:
 * @param ipaddr the destination address of the IP packet
 *
 */
err_t
raw_sendto(struct raw_pcb *pcb, struct pbuf *p, struct ip_addr *ipaddr)
{
  811ac8:	55                   	push   %ebp
  811ac9:	89 e5                	mov    %esp,%ebp
  811acb:	57                   	push   %edi
  811acc:	56                   	push   %esi
  811acd:	53                   	push   %ebx
  811ace:	83 ec 3c             	sub    $0x3c,%esp
  811ad1:	8b 5d 08             	mov    0x8(%ebp),%ebx
  811ad4:	8b 7d 0c             	mov    0xc(%ebp),%edi
  struct pbuf *q; /* q will be sent down the stack */
  
  LWIP_DEBUGF(RAW_DEBUG | LWIP_DBG_TRACE | 3, ("raw_sendto\n"));
  
  /* not enough space to add an IP header to first pbuf in given p chain? */
  if (pbuf_header(p, IP_HLEN)) {
  811ad7:	c7 44 24 04 14 00 00 	movl   $0x14,0x4(%esp)
  811ade:	00 
  811adf:	89 3c 24             	mov    %edi,(%esp)
  811ae2:	e8 ac 60 ff ff       	call   807b93 <pbuf_header>
  811ae7:	84 c0                	test   %al,%al
  811ae9:	74 38                	je     811b23 <raw_sendto+0x5b>
    /* allocate header in new pbuf */
    q = pbuf_alloc(PBUF_IP, 0, PBUF_RAM);
  811aeb:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  811af2:	00 
  811af3:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  811afa:	00 
  811afb:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  811b02:	e8 b2 66 ff ff       	call   8081b9 <pbuf_alloc>
  811b07:	89 c6                	mov    %eax,%esi
    /* new header pbuf could not be allocated? */
    if (q == NULL) {
  811b09:	c6 45 e7 ff          	movb   $0xff,-0x19(%ebp)
  811b0d:	85 c0                	test   %eax,%eax
  811b0f:	0f 84 b1 00 00 00    	je     811bc6 <raw_sendto+0xfe>
      LWIP_DEBUGF(RAW_DEBUG | LWIP_DBG_TRACE | 2, ("raw_sendto: could not allocate header\n"));
      return ERR_MEM;
    }
    /* chain header q in front of given pbuf p */
    pbuf_chain(q, p);
  811b15:	89 7c 24 04          	mov    %edi,0x4(%esp)
  811b19:	89 04 24             	mov    %eax,(%esp)
  811b1c:	e8 4b 60 ff ff       	call   807b6c <pbuf_chain>
  811b21:	eb 32                	jmp    811b55 <raw_sendto+0x8d>
    /* { first pbuf q points to header pbuf } */
    LWIP_DEBUGF(RAW_DEBUG, ("raw_sendto: added header pbuf %p before given pbuf %p\n", (void *)q, (void *)p));
  }  else {
    /* first pbuf q equals given pbuf */
    q = p;
    if(pbuf_header(q, -IP_HLEN)) {
  811b23:	c7 44 24 04 ec ff ff 	movl   $0xffffffec,0x4(%esp)
  811b2a:	ff 
  811b2b:	89 3c 24             	mov    %edi,(%esp)
  811b2e:	e8 60 60 ff ff       	call   807b93 <pbuf_header>
  811b33:	84 c0                	test   %al,%al
  811b35:	74 1c                	je     811b53 <raw_sendto+0x8b>
      LWIP_ASSERT("Can't restore header we just removed!", 0);
  811b37:	c7 44 24 08 24 50 81 	movl   $0x815024,0x8(%esp)
  811b3e:	00 
  811b3f:	c7 44 24 04 e3 00 00 	movl   $0xe3,0x4(%esp)
  811b46:	00 
  811b47:	c7 04 24 4a 50 81 00 	movl   $0x81504a,(%esp)
  811b4e:	e8 49 ee fe ff       	call   80099c <_panic>
  811b53:	89 fe                	mov    %edi,%esi
      return ERR_MEM;
    }
  }
  
  if ((netif = ip_route(ipaddr)) == NULL) {
  811b55:	8b 45 10             	mov    0x10(%ebp),%eax
  811b58:	89 04 24             	mov    %eax,(%esp)
  811b5b:	e8 81 7f ff ff       	call   809ae1 <ip_route>
  811b60:	85 c0                	test   %eax,%eax
  811b62:	75 16                	jne    811b7a <raw_sendto+0xb2>
    LWIP_DEBUGF(RAW_DEBUG | 1, ("raw_sendto: No route to 0x%"X32_F"\n", ipaddr->addr));
    /* free any temporary header pbuf allocated by pbuf_header() */
    if (q != p) {
  811b64:	c6 45 e7 fc          	movb   $0xfc,-0x19(%ebp)
  811b68:	39 fe                	cmp    %edi,%esi
  811b6a:	74 5a                	je     811bc6 <raw_sendto+0xfe>
      pbuf_free(q);
  811b6c:	89 34 24             	mov    %esi,(%esp)
  811b6f:	e8 89 63 ff ff       	call   807efd <pbuf_free>
  811b74:	c6 45 e7 fc          	movb   $0xfc,-0x19(%ebp)
  811b78:	eb 4c                	jmp    811bc6 <raw_sendto+0xfe>
    }
    return ERR_RTE;
  }

  if (ip_addr_isany(&pcb->local_ip)) {
  811b7a:	89 da                	mov    %ebx,%edx
  811b7c:	85 db                	test   %ebx,%ebx
  811b7e:	74 05                	je     811b85 <raw_sendto+0xbd>
  811b80:	83 3b 00             	cmpl   $0x0,(%ebx)
  811b83:	75 03                	jne    811b88 <raw_sendto+0xc0>
    /* use outgoing network interface IP address as source address */
    src_ip = &(netif->ip_addr);
  811b85:	8d 50 04             	lea    0x4(%eax),%edx
  }

#if LWIP_NETIF_HWADDRHINT
  netif->addr_hint = &(pcb->addr_hint);
#endif /* LWIP_NETIF_HWADDRHINT*/
  err = ip_output_if (q, src_ip, ipaddr, pcb->ttl, pcb->tos, pcb->protocol, netif);
  811b88:	89 44 24 18          	mov    %eax,0x18(%esp)
  811b8c:	0f b6 43 10          	movzbl 0x10(%ebx),%eax
  811b90:	89 44 24 14          	mov    %eax,0x14(%esp)
  811b94:	0f b6 43 0a          	movzbl 0xa(%ebx),%eax
  811b98:	89 44 24 10          	mov    %eax,0x10(%esp)
  811b9c:	0f b6 43 0b          	movzbl 0xb(%ebx),%eax
  811ba0:	89 44 24 0c          	mov    %eax,0xc(%esp)
  811ba4:	8b 45 10             	mov    0x10(%ebp),%eax
  811ba7:	89 44 24 08          	mov    %eax,0x8(%esp)
  811bab:	89 54 24 04          	mov    %edx,0x4(%esp)
  811baf:	89 34 24             	mov    %esi,(%esp)
  811bb2:	e8 79 7d ff ff       	call   809930 <ip_output_if>
  811bb7:	88 45 e7             	mov    %al,-0x19(%ebp)
#if LWIP_NETIF_HWADDRHINT
  netif->addr_hint = NULL;
#endif /* LWIP_NETIF_HWADDRHINT*/

  /* did we chain a header earlier? */
  if (q != p) {
  811bba:	39 fe                	cmp    %edi,%esi
  811bbc:	74 08                	je     811bc6 <raw_sendto+0xfe>
    /* free the header */
    pbuf_free(q);
  811bbe:	89 34 24             	mov    %esi,(%esp)
  811bc1:	e8 37 63 ff ff       	call   807efd <pbuf_free>
  }
  return err;
}
  811bc6:	0f b6 45 e7          	movzbl -0x19(%ebp),%eax
  811bca:	83 c4 3c             	add    $0x3c,%esp
  811bcd:	5b                   	pop    %ebx
  811bce:	5e                   	pop    %esi
  811bcf:	5f                   	pop    %edi
  811bd0:	5d                   	pop    %ebp
  811bd1:	c3                   	ret    

00811bd2 <raw_send>:
 * @param p the IP payload to send
 *
 */
err_t
raw_send(struct raw_pcb *pcb, struct pbuf *p)
{
  811bd2:	55                   	push   %ebp
  811bd3:	89 e5                	mov    %esp,%ebp
  811bd5:	83 ec 18             	sub    $0x18,%esp
  811bd8:	8b 45 08             	mov    0x8(%ebp),%eax
  return raw_sendto(pcb, p, &pcb->remote_ip);
  811bdb:	8d 50 04             	lea    0x4(%eax),%edx
  811bde:	89 54 24 08          	mov    %edx,0x8(%esp)
  811be2:	8b 55 0c             	mov    0xc(%ebp),%edx
  811be5:	89 54 24 04          	mov    %edx,0x4(%esp)
  811be9:	89 04 24             	mov    %eax,(%esp)
  811bec:	e8 d7 fe ff ff       	call   811ac8 <raw_sendto>
}
  811bf1:	c9                   	leave  
  811bf2:	c3                   	ret    

00811bf3 <raw_input>:
 *           caller).
 *
 */
u8_t
raw_input(struct pbuf *p, struct netif *inp)
{
  811bf3:	55                   	push   %ebp
  811bf4:	89 e5                	mov    %esp,%ebp
  811bf6:	57                   	push   %edi
  811bf7:	56                   	push   %esi
  811bf8:	53                   	push   %ebx
  811bf9:	83 ec 2c             	sub    $0x2c,%esp
  s16_t proto;
  u8_t eaten = 0;

  LWIP_UNUSED_ARG(inp);

  iphdr = p->payload;
  811bfc:	8b 45 08             	mov    0x8(%ebp),%eax
  811bff:	8b 70 04             	mov    0x4(%eax),%esi
  proto = IPH_PROTO(iphdr);
  811c02:	0f b7 46 08          	movzwl 0x8(%esi),%eax
  811c06:	89 04 24             	mov    %eax,(%esp)
  811c09:	e8 f2 90 ff ff       	call   80ad00 <ntohs>
  811c0e:	66 25 ff 00          	and    $0xff,%ax

  prev = NULL;
  pcb = raw_pcbs;
  811c12:	8b 1d 8c f5 b3 00    	mov    0xb3f58c,%ebx
  /* loop through all raw pcbs until the packet is eaten by one */
  /* this allows multiple pcbs to match against the packet by design */
  while ((eaten == 0) && (pcb != NULL)) {
  811c18:	85 db                	test   %ebx,%ebx
  811c1a:	74 6c                	je     811c88 <raw_input+0x95>
    if (pcb->protocol == proto) {
      /* receive callback function available? */
      if (pcb->recv != NULL) {
        /* the receive callback function did not eat the packet? */
        if (pcb->recv(pcb->recv_arg, pcb, p, &(iphdr->src)) != 0)
  811c1c:	83 c6 0c             	add    $0xc,%esi
  811c1f:	89 75 e4             	mov    %esi,-0x1c(%ebp)
  811c22:	be 00 00 00 00       	mov    $0x0,%esi
  prev = NULL;
  pcb = raw_pcbs;
  /* loop through all raw pcbs until the packet is eaten by one */
  /* this allows multiple pcbs to match against the packet by design */
  while ((eaten == 0) && (pcb != NULL)) {
    if (pcb->protocol == proto) {
  811c27:	0f bf f8             	movswl %ax,%edi
  811c2a:	0f b6 43 10          	movzbl 0x10(%ebx),%eax
  811c2e:	39 f8                	cmp    %edi,%eax
  811c30:	75 49                	jne    811c7b <raw_input+0x88>
      /* receive callback function available? */
      if (pcb->recv != NULL) {
  811c32:	8b 43 14             	mov    0x14(%ebx),%eax
  811c35:	85 c0                	test   %eax,%eax
  811c37:	74 42                	je     811c7b <raw_input+0x88>
        /* the receive callback function did not eat the packet? */
        if (pcb->recv(pcb->recv_arg, pcb, p, &(iphdr->src)) != 0)
  811c39:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  811c3c:	89 54 24 0c          	mov    %edx,0xc(%esp)
  811c40:	8b 55 08             	mov    0x8(%ebp),%edx
  811c43:	89 54 24 08          	mov    %edx,0x8(%esp)
  811c47:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  811c4b:	8b 53 18             	mov    0x18(%ebx),%edx
  811c4e:	89 14 24             	mov    %edx,(%esp)
  811c51:	ff d0                	call   *%eax
  811c53:	84 c0                	test   %al,%al
  811c55:	74 24                	je     811c7b <raw_input+0x88>
        {
          /* receive function ate the packet */
          p = NULL;
          eaten = 1;
          if (prev != NULL) {
  811c57:	b8 01 00 00 00       	mov    $0x1,%eax
  811c5c:	85 f6                	test   %esi,%esi
  811c5e:	74 2d                	je     811c8d <raw_input+0x9a>
          /* move the pcb to the front of raw_pcbs so that is
             found faster next time */
            prev->next = pcb->next;
  811c60:	8b 43 0c             	mov    0xc(%ebx),%eax
  811c63:	89 46 0c             	mov    %eax,0xc(%esi)
            pcb->next = raw_pcbs;
  811c66:	a1 8c f5 b3 00       	mov    0xb3f58c,%eax
  811c6b:	89 43 0c             	mov    %eax,0xc(%ebx)
            raw_pcbs = pcb;
  811c6e:	89 1d 8c f5 b3 00    	mov    %ebx,0xb3f58c
  811c74:	b8 01 00 00 00       	mov    $0x1,%eax
  811c79:	eb 12                	jmp    811c8d <raw_input+0x9a>
      }
      /* no receive callback function was set for this raw PCB */
      /* drop the packet */
    }
    prev = pcb;
    pcb = pcb->next;
  811c7b:	8b 43 0c             	mov    0xc(%ebx),%eax

  prev = NULL;
  pcb = raw_pcbs;
  /* loop through all raw pcbs until the packet is eaten by one */
  /* this allows multiple pcbs to match against the packet by design */
  while ((eaten == 0) && (pcb != NULL)) {
  811c7e:	85 c0                	test   %eax,%eax
  811c80:	74 06                	je     811c88 <raw_input+0x95>
  811c82:	89 de                	mov    %ebx,%esi
  811c84:	89 c3                	mov    %eax,%ebx
  811c86:	eb a2                	jmp    811c2a <raw_input+0x37>
  811c88:	b8 00 00 00 00       	mov    $0x0,%eax
    }
    prev = pcb;
    pcb = pcb->next;
  }
  return eaten;
}
  811c8d:	83 c4 2c             	add    $0x2c,%esp
  811c90:	5b                   	pop    %ebx
  811c91:	5e                   	pop    %esi
  811c92:	5f                   	pop    %edi
  811c93:	5d                   	pop    %ebp
  811c94:	c3                   	ret    
	...

00811ca0 <icmp_time_exceeded>:
 *          p->payload pointing to the IP header
 * @param t type of the 'time exceeded' packet
 */
void
icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t)
{
  811ca0:	55                   	push   %ebp
  811ca1:	89 e5                	mov    %esp,%ebp
  811ca3:	57                   	push   %edi
  811ca4:	56                   	push   %esi
  811ca5:	53                   	push   %ebx
  811ca6:	83 ec 3c             	sub    $0x3c,%esp
  811ca9:	8b 7d 08             	mov    0x8(%ebp),%edi
  struct pbuf *q;
  struct ip_hdr *iphdr;
  struct icmp_te_hdr *tehdr;

  /* ICMP header + IP header + 8 bytes of data */
  q = pbuf_alloc(PBUF_IP, sizeof(struct icmp_dur_hdr) + IP_HLEN + ICMP_DEST_UNREACH_DATASIZE,
  811cac:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  811cb3:	00 
  811cb4:	c7 44 24 04 24 00 00 	movl   $0x24,0x4(%esp)
  811cbb:	00 
  811cbc:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  811cc3:	e8 f1 64 ff ff       	call   8081b9 <pbuf_alloc>
  811cc8:	89 c3                	mov    %eax,%ebx
                 PBUF_RAM);
  if (q == NULL) {
  811cca:	85 c0                	test   %eax,%eax
  811ccc:	0f 84 d8 00 00 00    	je     811daa <icmp_time_exceeded+0x10a>
    LWIP_DEBUGF(ICMP_DEBUG, ("icmp_time_exceeded: failed to allocate pbuf for ICMP packet.\n"));
    return;
  }
  LWIP_ASSERT("check that first pbuf can hold icmp message",
  811cd2:	66 83 78 0a 23       	cmpw   $0x23,0xa(%eax)
  811cd7:	77 1c                	ja     811cf5 <icmp_time_exceeded+0x55>
  811cd9:	c7 44 24 08 60 50 81 	movl   $0x815060,0x8(%esp)
  811ce0:	00 
  811ce1:	c7 44 24 04 1e 01 00 	movl   $0x11e,0x4(%esp)
  811ce8:	00 
  811ce9:	c7 04 24 54 51 81 00 	movl   $0x815154,(%esp)
  811cf0:	e8 a7 ec fe ff       	call   80099c <_panic>
             (q->len >= (sizeof(struct icmp_dur_hdr) + IP_HLEN + ICMP_DEST_UNREACH_DATASIZE)));

  iphdr = p->payload;
  811cf5:	8b 47 04             	mov    0x4(%edi),%eax
  811cf8:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  ip_addr_debug_print(ICMP_DEBUG, &(iphdr->src));
  LWIP_DEBUGF(ICMP_DEBUG, (" to "));
  ip_addr_debug_print(ICMP_DEBUG, &(iphdr->dest));
  LWIP_DEBUGF(ICMP_DEBUG, ("\n"));

  tehdr = q->payload;
  811cfb:	8b 73 04             	mov    0x4(%ebx),%esi
  ICMPH_TYPE_SET(tehdr, ICMP_TE);
  811cfe:	0f b7 06             	movzwl (%esi),%eax
  811d01:	89 04 24             	mov    %eax,(%esp)
  811d04:	e8 f7 8f ff ff       	call   80ad00 <ntohs>
  811d09:	0f b6 c0             	movzbl %al,%eax
  811d0c:	80 cc 0b             	or     $0xb,%ah
  811d0f:	89 04 24             	mov    %eax,(%esp)
  811d12:	e8 dc 8f ff ff       	call   80acf3 <htons>
  811d17:	66 89 06             	mov    %ax,(%esi)
  ICMPH_CODE_SET(tehdr, t);
  811d1a:	0f b7 c0             	movzwl %ax,%eax
  811d1d:	89 04 24             	mov    %eax,(%esp)
  811d20:	e8 db 8f ff ff       	call   80ad00 <ntohs>
  811d25:	b0 00                	mov    $0x0,%al
  811d27:	66 0b 45 0c          	or     0xc(%ebp),%ax
  811d2b:	0f b7 c0             	movzwl %ax,%eax
  811d2e:	89 04 24             	mov    %eax,(%esp)
  811d31:	e8 bd 8f ff ff       	call   80acf3 <htons>
  811d36:	66 89 06             	mov    %ax,(%esi)

  /* copy fields from original packet */
  SMEMCPY((u8_t *)q->payload + sizeof(struct icmp_dur_hdr), (u8_t *)p->payload,
  811d39:	c7 44 24 08 1c 00 00 	movl   $0x1c,0x8(%esp)
  811d40:	00 
  811d41:	8b 47 04             	mov    0x4(%edi),%eax
  811d44:	89 44 24 04          	mov    %eax,0x4(%esp)
  811d48:	8b 43 04             	mov    0x4(%ebx),%eax
  811d4b:	83 c0 08             	add    $0x8,%eax
  811d4e:	89 04 24             	mov    %eax,(%esp)
  811d51:	e8 0b f6 fe ff       	call   801361 <memcpy>
          IP_HLEN + ICMP_DEST_UNREACH_DATASIZE);

  /* calculate checksum */
  tehdr->chksum = 0;
  811d56:	66 c7 46 02 00 00    	movw   $0x0,0x2(%esi)
  tehdr->chksum = inet_chksum(tehdr, q->len);
  811d5c:	0f b7 43 0a          	movzwl 0xa(%ebx),%eax
  811d60:	89 44 24 04          	mov    %eax,0x4(%esp)
  811d64:	89 34 24             	mov    %esi,(%esp)
  811d67:	e8 6e 8c ff ff       	call   80a9da <inet_chksum>
  811d6c:	66 89 46 02          	mov    %ax,0x2(%esi)
  ICMP_STATS_INC(icmp.xmit);
  /* increase number of messages attempted to send */
  snmp_inc_icmpoutmsgs();
  /* increase number of destination unreachable messages attempted to send */
  snmp_inc_icmpouttimeexcds();
  ip_output(q, NULL, &(iphdr->src), ICMP_TTL, 0, IP_PROTO_ICMP);
  811d70:	c7 44 24 14 01 00 00 	movl   $0x1,0x14(%esp)
  811d77:	00 
  811d78:	c7 44 24 10 00 00 00 	movl   $0x0,0x10(%esp)
  811d7f:	00 
  811d80:	c7 44 24 0c ff 00 00 	movl   $0xff,0xc(%esp)
  811d87:	00 
  811d88:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  811d8b:	83 c0 0c             	add    $0xc,%eax
  811d8e:	89 44 24 08          	mov    %eax,0x8(%esp)
  811d92:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  811d99:	00 
  811d9a:	89 1c 24             	mov    %ebx,(%esp)
  811d9d:	e8 9b 7d ff ff       	call   809b3d <ip_output>
  pbuf_free(q);
  811da2:	89 1c 24             	mov    %ebx,(%esp)
  811da5:	e8 53 61 ff ff       	call   807efd <pbuf_free>
}
  811daa:	83 c4 3c             	add    $0x3c,%esp
  811dad:	5b                   	pop    %ebx
  811dae:	5e                   	pop    %esi
  811daf:	5f                   	pop    %edi
  811db0:	5d                   	pop    %ebp
  811db1:	c3                   	ret    

00811db2 <icmp_dest_unreach>:
 *          p->payload pointing to the IP header
 * @param t type of the 'unreachable' packet
 */
void
icmp_dest_unreach(struct pbuf *p, enum icmp_dur_type t)
{
  811db2:	55                   	push   %ebp
  811db3:	89 e5                	mov    %esp,%ebp
  811db5:	57                   	push   %edi
  811db6:	56                   	push   %esi
  811db7:	53                   	push   %ebx
  811db8:	83 ec 3c             	sub    $0x3c,%esp
  811dbb:	8b 7d 08             	mov    0x8(%ebp),%edi
  struct pbuf *q;
  struct ip_hdr *iphdr;
  struct icmp_dur_hdr *idur;

  /* ICMP header + IP header + 8 bytes of data */
  q = pbuf_alloc(PBUF_IP, sizeof(struct icmp_dur_hdr) + IP_HLEN + ICMP_DEST_UNREACH_DATASIZE,
  811dbe:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  811dc5:	00 
  811dc6:	c7 44 24 04 24 00 00 	movl   $0x24,0x4(%esp)
  811dcd:	00 
  811dce:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  811dd5:	e8 df 63 ff ff       	call   8081b9 <pbuf_alloc>
  811dda:	89 c3                	mov    %eax,%ebx
                 PBUF_RAM);
  if (q == NULL) {
  811ddc:	85 c0                	test   %eax,%eax
  811dde:	0f 84 d8 00 00 00    	je     811ebc <icmp_dest_unreach+0x10a>
    LWIP_DEBUGF(ICMP_DEBUG, ("icmp_dest_unreach: failed to allocate pbuf for ICMP packet.\n"));
    return;
  }
  LWIP_ASSERT("check that first pbuf can hold icmp message",
  811de4:	66 83 78 0a 23       	cmpw   $0x23,0xa(%eax)
  811de9:	77 1c                	ja     811e07 <icmp_dest_unreach+0x55>
  811deb:	c7 44 24 08 60 50 81 	movl   $0x815060,0x8(%esp)
  811df2:	00 
  811df3:	c7 44 24 04 ef 00 00 	movl   $0xef,0x4(%esp)
  811dfa:	00 
  811dfb:	c7 04 24 54 51 81 00 	movl   $0x815154,(%esp)
  811e02:	e8 95 eb fe ff       	call   80099c <_panic>
             (q->len >= (sizeof(struct icmp_dur_hdr) + IP_HLEN + ICMP_DEST_UNREACH_DATASIZE)));

  iphdr = p->payload;
  811e07:	8b 47 04             	mov    0x4(%edi),%eax
  811e0a:	89 45 e4             	mov    %eax,-0x1c(%ebp)

  idur = q->payload;
  811e0d:	8b 73 04             	mov    0x4(%ebx),%esi
  ICMPH_TYPE_SET(idur, ICMP_DUR);
  811e10:	0f b7 06             	movzwl (%esi),%eax
  811e13:	89 04 24             	mov    %eax,(%esp)
  811e16:	e8 e5 8e ff ff       	call   80ad00 <ntohs>
  811e1b:	0f b6 c0             	movzbl %al,%eax
  811e1e:	80 cc 03             	or     $0x3,%ah
  811e21:	89 04 24             	mov    %eax,(%esp)
  811e24:	e8 ca 8e ff ff       	call   80acf3 <htons>
  811e29:	66 89 06             	mov    %ax,(%esi)
  ICMPH_CODE_SET(idur, t);
  811e2c:	0f b7 c0             	movzwl %ax,%eax
  811e2f:	89 04 24             	mov    %eax,(%esp)
  811e32:	e8 c9 8e ff ff       	call   80ad00 <ntohs>
  811e37:	b0 00                	mov    $0x0,%al
  811e39:	66 0b 45 0c          	or     0xc(%ebp),%ax
  811e3d:	0f b7 c0             	movzwl %ax,%eax
  811e40:	89 04 24             	mov    %eax,(%esp)
  811e43:	e8 ab 8e ff ff       	call   80acf3 <htons>
  811e48:	66 89 06             	mov    %ax,(%esi)

  SMEMCPY((u8_t *)q->payload + sizeof(struct icmp_dur_hdr), p->payload,
  811e4b:	c7 44 24 08 1c 00 00 	movl   $0x1c,0x8(%esp)
  811e52:	00 
  811e53:	8b 47 04             	mov    0x4(%edi),%eax
  811e56:	89 44 24 04          	mov    %eax,0x4(%esp)
  811e5a:	8b 43 04             	mov    0x4(%ebx),%eax
  811e5d:	83 c0 08             	add    $0x8,%eax
  811e60:	89 04 24             	mov    %eax,(%esp)
  811e63:	e8 f9 f4 fe ff       	call   801361 <memcpy>
          IP_HLEN + ICMP_DEST_UNREACH_DATASIZE);

  /* calculate checksum */
  idur->chksum = 0;
  811e68:	66 c7 46 02 00 00    	movw   $0x0,0x2(%esi)
  idur->chksum = inet_chksum(idur, q->len);
  811e6e:	0f b7 43 0a          	movzwl 0xa(%ebx),%eax
  811e72:	89 44 24 04          	mov    %eax,0x4(%esp)
  811e76:	89 34 24             	mov    %esi,(%esp)
  811e79:	e8 5c 8b ff ff       	call   80a9da <inet_chksum>
  811e7e:	66 89 46 02          	mov    %ax,0x2(%esi)
  /* increase number of messages attempted to send */
  snmp_inc_icmpoutmsgs();
  /* increase number of destination unreachable messages attempted to send */
  snmp_inc_icmpoutdestunreachs();

  ip_output(q, NULL, &(iphdr->src), ICMP_TTL, 0, IP_PROTO_ICMP);
  811e82:	c7 44 24 14 01 00 00 	movl   $0x1,0x14(%esp)
  811e89:	00 
  811e8a:	c7 44 24 10 00 00 00 	movl   $0x0,0x10(%esp)
  811e91:	00 
  811e92:	c7 44 24 0c ff 00 00 	movl   $0xff,0xc(%esp)
  811e99:	00 
  811e9a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  811e9d:	83 c0 0c             	add    $0xc,%eax
  811ea0:	89 44 24 08          	mov    %eax,0x8(%esp)
  811ea4:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  811eab:	00 
  811eac:	89 1c 24             	mov    %ebx,(%esp)
  811eaf:	e8 89 7c ff ff       	call   809b3d <ip_output>
  pbuf_free(q);
  811eb4:	89 1c 24             	mov    %ebx,(%esp)
  811eb7:	e8 41 60 ff ff       	call   807efd <pbuf_free>
}
  811ebc:	83 c4 3c             	add    $0x3c,%esp
  811ebf:	5b                   	pop    %ebx
  811ec0:	5e                   	pop    %esi
  811ec1:	5f                   	pop    %edi
  811ec2:	5d                   	pop    %ebp
  811ec3:	c3                   	ret    

00811ec4 <icmp_input>:
 * @param p the icmp echo request packet, p->payload pointing to the ip header
 * @param inp the netif on which this packet was received
 */
void
icmp_input(struct pbuf *p, struct netif *inp)
{
  811ec4:	55                   	push   %ebp
  811ec5:	89 e5                	mov    %esp,%ebp
  811ec7:	83 ec 48             	sub    $0x48,%esp
  811eca:	89 5d f4             	mov    %ebx,-0xc(%ebp)
  811ecd:	89 75 f8             	mov    %esi,-0x8(%ebp)
  811ed0:	89 7d fc             	mov    %edi,-0x4(%ebp)
  811ed3:	8b 5d 08             	mov    0x8(%ebp),%ebx

  ICMP_STATS_INC(icmp.recv);
  snmp_inc_icmpinmsgs();


  iphdr = p->payload;
  811ed6:	8b 73 04             	mov    0x4(%ebx),%esi
  hlen = IPH_HL(iphdr) * 4;
  811ed9:	0f b7 06             	movzwl (%esi),%eax
  811edc:	89 04 24             	mov    %eax,(%esp)
  811edf:	e8 1c 8e ff ff       	call   80ad00 <ntohs>
  811ee4:	66 c1 e8 06          	shr    $0x6,%ax
  811ee8:	83 e0 3c             	and    $0x3c,%eax
  811eeb:	66 89 45 e6          	mov    %ax,-0x1a(%ebp)
  if (pbuf_header(p, -hlen) || (p->tot_len < sizeof(u16_t)*2)) {
  811eef:	89 c7                	mov    %eax,%edi
  811ef1:	f7 df                	neg    %edi
  811ef3:	0f bf ff             	movswl %di,%edi
  811ef6:	89 7c 24 04          	mov    %edi,0x4(%esp)
  811efa:	89 1c 24             	mov    %ebx,(%esp)
  811efd:	e8 91 5c ff ff       	call   807b93 <pbuf_header>
  811f02:	84 c0                	test   %al,%al
  811f04:	0f 85 ee 02 00 00    	jne    8121f8 <icmp_input+0x334>
  811f0a:	66 83 7b 08 03       	cmpw   $0x3,0x8(%ebx)
  811f0f:	0f 86 e3 02 00 00    	jbe    8121f8 <icmp_input+0x334>

  type = *((u8_t *)p->payload);
#ifdef LWIP_DEBUG
  code = *(((u8_t *)p->payload)+1);
#endif /* LWIP_DEBUG */
  switch (type) {
  811f15:	8b 43 04             	mov    0x4(%ebx),%eax
  811f18:	80 38 08             	cmpb   $0x8,(%eax)
  811f1b:	0f 85 cd 02 00 00    	jne    8121ee <icmp_input+0x32a>
  case ICMP_ECHO:
    /* broadcast or multicast destination address? */
    if (ip_addr_isbroadcast(&iphdr->dest, inp) || ip_addr_ismulticast(&iphdr->dest)) {
  811f21:	8b 45 0c             	mov    0xc(%ebp),%eax
  811f24:	89 44 24 04          	mov    %eax,0x4(%esp)
  811f28:	8d 46 10             	lea    0x10(%esi),%eax
  811f2b:	89 04 24             	mov    %eax,(%esp)
  811f2e:	e8 b5 79 ff ff       	call   8098e8 <ip_addr_isbroadcast>
  811f33:	84 c0                	test   %al,%al
  811f35:	75 2b                	jne    811f62 <icmp_input+0x9e>
  811f37:	8b 56 10             	mov    0x10(%esi),%edx
  811f3a:	89 55 dc             	mov    %edx,-0x24(%ebp)
  811f3d:	c7 04 24 00 00 00 f0 	movl   $0xf0000000,(%esp)
  811f44:	e8 ec 8f ff ff       	call   80af35 <ntohl>
  811f49:	89 45 e0             	mov    %eax,-0x20(%ebp)
  811f4c:	c7 04 24 00 00 00 e0 	movl   $0xe0000000,(%esp)
  811f53:	e8 dd 8f ff ff       	call   80af35 <ntohl>
  811f58:	8b 55 e0             	mov    -0x20(%ebp),%edx
  811f5b:	23 55 dc             	and    -0x24(%ebp),%edx
  811f5e:	39 c2                	cmp    %eax,%edx
  811f60:	75 0d                	jne    811f6f <icmp_input+0xab>
      LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: Not echoing to multicast or broadcast pings\n"));
      ICMP_STATS_INC(icmp.err);
      pbuf_free(p);
  811f62:	89 1c 24             	mov    %ebx,(%esp)
  811f65:	e8 93 5f ff ff       	call   807efd <pbuf_free>
      return;
  811f6a:	e9 9b 02 00 00       	jmp    81220a <icmp_input+0x346>
    }
    LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ping\n"));
    if (p->tot_len < sizeof(struct icmp_echo_hdr)) {
  811f6f:	66 83 7b 08 07       	cmpw   $0x7,0x8(%ebx)
  811f74:	0f 86 7e 02 00 00    	jbe    8121f8 <icmp_input+0x334>
      LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: bad ICMP echo received\n"));
      goto lenerr;
    }
    if (inet_chksum_pbuf(p) != 0) {
  811f7a:	89 1c 24             	mov    %ebx,(%esp)
  811f7d:	8d 76 00             	lea    0x0(%esi),%esi
  811f80:	e8 d0 89 ff ff       	call   80a955 <inet_chksum_pbuf>
  811f85:	66 85 c0             	test   %ax,%ax
  811f88:	74 0d                	je     811f97 <icmp_input+0xd3>
      LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: checksum failed for received ICMP echo\n"));
      pbuf_free(p);
  811f8a:	89 1c 24             	mov    %ebx,(%esp)
  811f8d:	e8 6b 5f ff ff       	call   807efd <pbuf_free>
      ICMP_STATS_INC(icmp.chkerr);
      snmp_inc_icmpinerrors();
      return;
  811f92:	e9 73 02 00 00       	jmp    81220a <icmp_input+0x346>
    }
    if (pbuf_header(p, (PBUF_IP_HLEN + PBUF_LINK_HLEN))) {
  811f97:	c7 44 24 04 22 00 00 	movl   $0x22,0x4(%esp)
  811f9e:	00 
  811f9f:	89 1c 24             	mov    %ebx,(%esp)
  811fa2:	e8 ec 5b ff ff       	call   807b93 <pbuf_header>
  811fa7:	84 c0                	test   %al,%al
  811fa9:	0f 84 f0 00 00 00    	je     81209f <icmp_input+0x1db>
      /* p is not big enough to contain link headers
       * allocate a new one and copy p into it
       */
      struct pbuf *r;
      /* switch p->payload to ip header */
      if (pbuf_header(p, hlen)) {
  811faf:	0f bf 45 e6          	movswl -0x1a(%ebp),%eax
  811fb3:	89 44 24 04          	mov    %eax,0x4(%esp)
  811fb7:	89 1c 24             	mov    %ebx,(%esp)
  811fba:	e8 d4 5b ff ff       	call   807b93 <pbuf_header>
  811fbf:	84 c0                	test   %al,%al
  811fc1:	74 1c                	je     811fdf <icmp_input+0x11b>
        LWIP_ASSERT("icmp_input: moving p->payload to ip header failed\n", 0);
  811fc3:	c7 44 24 08 8c 50 81 	movl   $0x81508c,0x8(%esp)
  811fca:	00 
  811fcb:	c7 44 24 04 7b 00 00 	movl   $0x7b,0x4(%esp)
  811fd2:	00 
  811fd3:	c7 04 24 54 51 81 00 	movl   $0x815154,(%esp)
  811fda:	e8 bd e9 fe ff       	call   80099c <_panic>
        goto memerr;
      }
      /* allocate new packet buffer with space for link headers */
      r = pbuf_alloc(PBUF_LINK, p->tot_len, PBUF_RAM);
  811fdf:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  811fe6:	00 
  811fe7:	0f b7 43 08          	movzwl 0x8(%ebx),%eax
  811feb:	89 44 24 04          	mov    %eax,0x4(%esp)
  811fef:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  811ff6:	e8 be 61 ff ff       	call   8081b9 <pbuf_alloc>
  811ffb:	89 45 e0             	mov    %eax,-0x20(%ebp)
      if (r == NULL) {
  811ffe:	85 c0                	test   %eax,%eax
  812000:	0f 84 fc 01 00 00    	je     812202 <icmp_input+0x33e>
        LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: allocating new pbuf failed\n"));
        goto memerr;
      }
      LWIP_ASSERT("check that first pbuf can hold struct the ICMP header",
  812006:	0f b7 50 0a          	movzwl 0xa(%eax),%edx
  81200a:	0f bf 45 e6          	movswl -0x1a(%ebp),%eax
  81200e:	83 c0 08             	add    $0x8,%eax
  812011:	39 c2                	cmp    %eax,%edx
  812013:	73 1c                	jae    812031 <icmp_input+0x16d>
  812015:	c7 44 24 08 c0 50 81 	movl   $0x8150c0,0x8(%esp)
  81201c:	00 
  81201d:	c7 44 24 04 85 00 00 	movl   $0x85,0x4(%esp)
  812024:	00 
  812025:	c7 04 24 54 51 81 00 	movl   $0x815154,(%esp)
  81202c:	e8 6b e9 fe ff       	call   80099c <_panic>
                  (r->len >= hlen + sizeof(struct icmp_echo_hdr)));
      /* copy the whole packet including ip header */
      if (pbuf_copy(r, p) != ERR_OK) {
  812031:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  812035:	8b 45 e0             	mov    -0x20(%ebp),%eax
  812038:	89 04 24             	mov    %eax,(%esp)
  81203b:	e8 14 5d ff ff       	call   807d54 <pbuf_copy>
  812040:	84 c0                	test   %al,%al
  812042:	74 1c                	je     812060 <icmp_input+0x19c>
        LWIP_ASSERT("icmp_input: copying to new pbuf failed\n", 0);
  812044:	c7 44 24 08 f8 50 81 	movl   $0x8150f8,0x8(%esp)
  81204b:	00 
  81204c:	c7 44 24 04 88 00 00 	movl   $0x88,0x4(%esp)
  812053:	00 
  812054:	c7 04 24 54 51 81 00 	movl   $0x815154,(%esp)
  81205b:	e8 3c e9 fe ff       	call   80099c <_panic>
        goto memerr;
      }
      iphdr = r->payload;
  812060:	8b 55 e0             	mov    -0x20(%ebp),%edx
  812063:	8b 72 04             	mov    0x4(%edx),%esi
      /* switch r->payload back to icmp header */
      if (pbuf_header(r, -hlen)) {
  812066:	89 7c 24 04          	mov    %edi,0x4(%esp)
  81206a:	89 14 24             	mov    %edx,(%esp)
  81206d:	e8 21 5b ff ff       	call   807b93 <pbuf_header>
  812072:	84 c0                	test   %al,%al
  812074:	74 1c                	je     812092 <icmp_input+0x1ce>
        LWIP_ASSERT("icmp_input: restoring original p->payload failed\n", 0);
  812076:	c7 44 24 08 20 51 81 	movl   $0x815120,0x8(%esp)
  81207d:	00 
  81207e:	c7 44 24 04 8e 00 00 	movl   $0x8e,0x4(%esp)
  812085:	00 
  812086:	c7 04 24 54 51 81 00 	movl   $0x815154,(%esp)
  81208d:	e8 0a e9 fe ff       	call   80099c <_panic>
        goto memerr;
      }
      /* free the original p */
      pbuf_free(p);
  812092:	89 1c 24             	mov    %ebx,(%esp)
  812095:	e8 63 5e ff ff       	call   807efd <pbuf_free>
  81209a:	8b 5d e0             	mov    -0x20(%ebp),%ebx
  81209d:	eb 30                	jmp    8120cf <icmp_input+0x20b>
      /* we now have an identical copy of p that has room for link headers */
      p = r;
    } else {
      /* restore p->payload to point to icmp header */
      if (pbuf_header(p, -(s16_t)(PBUF_IP_HLEN + PBUF_LINK_HLEN))) {
  81209f:	c7 44 24 04 de ff ff 	movl   $0xffffffde,0x4(%esp)
  8120a6:	ff 
  8120a7:	89 1c 24             	mov    %ebx,(%esp)
  8120aa:	e8 e4 5a ff ff       	call   807b93 <pbuf_header>
  8120af:	84 c0                	test   %al,%al
  8120b1:	74 1c                	je     8120cf <icmp_input+0x20b>
        LWIP_ASSERT("icmp_input: restoring original p->payload failed\n", 0);
  8120b3:	c7 44 24 08 20 51 81 	movl   $0x815120,0x8(%esp)
  8120ba:	00 
  8120bb:	c7 44 24 04 98 00 00 	movl   $0x98,0x4(%esp)
  8120c2:	00 
  8120c3:	c7 04 24 54 51 81 00 	movl   $0x815154,(%esp)
  8120ca:	e8 cd e8 fe ff       	call   80099c <_panic>
      }
    }
    /* At this point, all checks are OK. */
    /* We generate an answer by switching the dest and src ip addresses,
     * setting the icmp type to ECHO_RESPONSE and updating the checksum. */
    iecho = p->payload;
  8120cf:	8b 7b 04             	mov    0x4(%ebx),%edi
    tmpaddr.addr = iphdr->src.addr;
  8120d2:	8b 46 0c             	mov    0xc(%esi),%eax
    iphdr->src.addr = iphdr->dest.addr;
  8120d5:	8b 56 10             	mov    0x10(%esi),%edx
  8120d8:	89 56 0c             	mov    %edx,0xc(%esi)
    iphdr->dest.addr = tmpaddr.addr;
  8120db:	89 46 10             	mov    %eax,0x10(%esi)
    ICMPH_TYPE_SET(iecho, ICMP_ER);
  8120de:	0f b7 07             	movzwl (%edi),%eax
  8120e1:	89 04 24             	mov    %eax,(%esp)
  8120e4:	e8 17 8c ff ff       	call   80ad00 <ntohs>
  8120e9:	0f b6 c0             	movzbl %al,%eax
  8120ec:	89 04 24             	mov    %eax,(%esp)
  8120ef:	e8 ff 8b ff ff       	call   80acf3 <htons>
  8120f4:	66 89 07             	mov    %ax,(%edi)
    /* adjust the checksum */
    if (iecho->chksum >= htons(0xffff - (ICMP_ECHO << 8))) {
  8120f7:	0f b7 47 02          	movzwl 0x2(%edi),%eax
  8120fb:	66 89 45 e0          	mov    %ax,-0x20(%ebp)
  8120ff:	c7 04 24 ff f7 00 00 	movl   $0xf7ff,(%esp)
  812106:	e8 e8 8b ff ff       	call   80acf3 <htons>
  81210b:	66 39 45 e0          	cmp    %ax,-0x20(%ebp)
  81210f:	72 22                	jb     812133 <icmp_input+0x26f>
      iecho->chksum += htons(ICMP_ECHO << 8) + 1;
  812111:	0f b7 57 02          	movzwl 0x2(%edi),%edx
  812115:	66 89 55 e0          	mov    %dx,-0x20(%ebp)
  812119:	c7 04 24 00 08 00 00 	movl   $0x800,(%esp)
  812120:	e8 ce 8b ff ff       	call   80acf3 <htons>
  812125:	0f b7 55 e0          	movzwl -0x20(%ebp),%edx
  812129:	8d 44 02 01          	lea    0x1(%edx,%eax,1),%eax
  81212d:	66 89 47 02          	mov    %ax,0x2(%edi)
  812131:	eb 1c                	jmp    81214f <icmp_input+0x28b>
    } else {
      iecho->chksum += htons(ICMP_ECHO << 8);
  812133:	0f b7 47 02          	movzwl 0x2(%edi),%eax
  812137:	66 89 45 e0          	mov    %ax,-0x20(%ebp)
  81213b:	c7 04 24 00 08 00 00 	movl   $0x800,(%esp)
  812142:	e8 ac 8b ff ff       	call   80acf3 <htons>
  812147:	66 03 45 e0          	add    -0x20(%ebp),%ax
  81214b:	66 89 47 02          	mov    %ax,0x2(%edi)
    }

    /* Set the correct TTL and recalculate the header checksum. */
    IPH_TTL_SET(iphdr, ICMP_TTL);
  81214f:	0f b7 46 08          	movzwl 0x8(%esi),%eax
  812153:	89 04 24             	mov    %eax,(%esp)
  812156:	e8 a5 8b ff ff       	call   80ad00 <ntohs>
  81215b:	66 0d 00 ff          	or     $0xff00,%ax
  81215f:	0f b7 c0             	movzwl %ax,%eax
  812162:	89 04 24             	mov    %eax,(%esp)
  812165:	e8 89 8b ff ff       	call   80acf3 <htons>
  81216a:	66 89 46 08          	mov    %ax,0x8(%esi)
    IPH_CHKSUM_SET(iphdr, 0);
  81216e:	66 c7 46 0a 00 00    	movw   $0x0,0xa(%esi)
#if CHECKSUM_GEN_IP
    IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN));
  812174:	c7 44 24 04 14 00 00 	movl   $0x14,0x4(%esp)
  81217b:	00 
  81217c:	89 34 24             	mov    %esi,(%esp)
  81217f:	e8 56 88 ff ff       	call   80a9da <inet_chksum>
  812184:	66 89 46 0a          	mov    %ax,0xa(%esi)
    /* increase number of messages attempted to send */
    snmp_inc_icmpoutmsgs();
    /* increase number of echo replies attempted to send */
    snmp_inc_icmpoutechoreps();

    if(pbuf_header(p, hlen)) {
  812188:	0f bf 45 e6          	movswl -0x1a(%ebp),%eax
  81218c:	89 44 24 04          	mov    %eax,0x4(%esp)
  812190:	89 1c 24             	mov    %ebx,(%esp)
  812193:	e8 fb 59 ff ff       	call   807b93 <pbuf_header>
  812198:	84 c0                	test   %al,%al
  81219a:	74 1c                	je     8121b8 <icmp_input+0x2f4>
      LWIP_ASSERT("Can't move over header in packet", 0);
  81219c:	c7 44 24 08 64 41 81 	movl   $0x814164,0x8(%esp)
  8121a3:	00 
  8121a4:	c7 44 24 04 b9 00 00 	movl   $0xb9,0x4(%esp)
  8121ab:	00 
  8121ac:	c7 04 24 54 51 81 00 	movl   $0x815154,(%esp)
  8121b3:	e8 e4 e7 fe ff       	call   80099c <_panic>
    } else {
      err_t ret;
      ret = ip_output_if(p, &(iphdr->src), IP_HDRINCL,
  8121b8:	8b 55 0c             	mov    0xc(%ebp),%edx
  8121bb:	89 54 24 18          	mov    %edx,0x18(%esp)
  8121bf:	c7 44 24 14 01 00 00 	movl   $0x1,0x14(%esp)
  8121c6:	00 
  8121c7:	c7 44 24 10 00 00 00 	movl   $0x0,0x10(%esp)
  8121ce:	00 
  8121cf:	c7 44 24 0c ff 00 00 	movl   $0xff,0xc(%esp)
  8121d6:	00 
  8121d7:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  8121de:	00 
  8121df:	83 c6 0c             	add    $0xc,%esi
  8121e2:	89 74 24 04          	mov    %esi,0x4(%esp)
  8121e6:	89 1c 24             	mov    %ebx,(%esp)
  8121e9:	e8 42 77 ff ff       	call   809930 <ip_output_if>
    LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP type %"S16_F" code %"S16_F" not supported.\n", 
                (s16_t)type, (s16_t)code));
    ICMP_STATS_INC(icmp.proterr);
    ICMP_STATS_INC(icmp.drop);
  }
  pbuf_free(p);
  8121ee:	89 1c 24             	mov    %ebx,(%esp)
  8121f1:	e8 07 5d ff ff       	call   807efd <pbuf_free>
  return;
  8121f6:	eb 12                	jmp    81220a <icmp_input+0x346>
lenerr:
  pbuf_free(p);
  8121f8:	89 1c 24             	mov    %ebx,(%esp)
  8121fb:	e8 fd 5c ff ff       	call   807efd <pbuf_free>
  ICMP_STATS_INC(icmp.lenerr);
  snmp_inc_icmpinerrors();
  return;
  812200:	eb 08                	jmp    81220a <icmp_input+0x346>
memerr:
  pbuf_free(p);
  812202:	89 1c 24             	mov    %ebx,(%esp)
  812205:	e8 f3 5c ff ff       	call   807efd <pbuf_free>
  ICMP_STATS_INC(icmp.err);
  snmp_inc_icmpinerrors();
  return;
}
  81220a:	8b 5d f4             	mov    -0xc(%ebp),%ebx
  81220d:	8b 75 f8             	mov    -0x8(%ebp),%esi
  812210:	8b 7d fc             	mov    -0x4(%ebp),%edi
  812213:	89 ec                	mov    %ebp,%esp
  812215:	5d                   	pop    %ebp
  812216:	c3                   	ret    
	...

00812220 <__udivdi3>:
  812220:	55                   	push   %ebp
  812221:	89 e5                	mov    %esp,%ebp
  812223:	57                   	push   %edi
  812224:	56                   	push   %esi
  812225:	83 ec 10             	sub    $0x10,%esp
  812228:	8b 45 14             	mov    0x14(%ebp),%eax
  81222b:	8b 55 08             	mov    0x8(%ebp),%edx
  81222e:	8b 75 10             	mov    0x10(%ebp),%esi
  812231:	8b 7d 0c             	mov    0xc(%ebp),%edi
  812234:	85 c0                	test   %eax,%eax
  812236:	89 55 f0             	mov    %edx,-0x10(%ebp)
  812239:	75 35                	jne    812270 <__udivdi3+0x50>
  81223b:	39 fe                	cmp    %edi,%esi
  81223d:	77 61                	ja     8122a0 <__udivdi3+0x80>
  81223f:	85 f6                	test   %esi,%esi
  812241:	75 0b                	jne    81224e <__udivdi3+0x2e>
  812243:	b8 01 00 00 00       	mov    $0x1,%eax
  812248:	31 d2                	xor    %edx,%edx
  81224a:	f7 f6                	div    %esi
  81224c:	89 c6                	mov    %eax,%esi
  81224e:	8b 4d f0             	mov    -0x10(%ebp),%ecx
  812251:	31 d2                	xor    %edx,%edx
  812253:	89 f8                	mov    %edi,%eax
  812255:	f7 f6                	div    %esi
  812257:	89 c7                	mov    %eax,%edi
  812259:	89 c8                	mov    %ecx,%eax
  81225b:	f7 f6                	div    %esi
  81225d:	89 c1                	mov    %eax,%ecx
  81225f:	89 fa                	mov    %edi,%edx
  812261:	89 c8                	mov    %ecx,%eax
  812263:	83 c4 10             	add    $0x10,%esp
  812266:	5e                   	pop    %esi
  812267:	5f                   	pop    %edi
  812268:	5d                   	pop    %ebp
  812269:	c3                   	ret    
  81226a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  812270:	39 f8                	cmp    %edi,%eax
  812272:	77 1c                	ja     812290 <__udivdi3+0x70>
  812274:	0f bd d0             	bsr    %eax,%edx
  812277:	83 f2 1f             	xor    $0x1f,%edx
  81227a:	89 55 f4             	mov    %edx,-0xc(%ebp)
  81227d:	75 39                	jne    8122b8 <__udivdi3+0x98>
  81227f:	3b 75 f0             	cmp    -0x10(%ebp),%esi
  812282:	0f 86 a0 00 00 00    	jbe    812328 <__udivdi3+0x108>
  812288:	39 f8                	cmp    %edi,%eax
  81228a:	0f 82 98 00 00 00    	jb     812328 <__udivdi3+0x108>
  812290:	31 ff                	xor    %edi,%edi
  812292:	31 c9                	xor    %ecx,%ecx
  812294:	89 c8                	mov    %ecx,%eax
  812296:	89 fa                	mov    %edi,%edx
  812298:	83 c4 10             	add    $0x10,%esp
  81229b:	5e                   	pop    %esi
  81229c:	5f                   	pop    %edi
  81229d:	5d                   	pop    %ebp
  81229e:	c3                   	ret    
  81229f:	90                   	nop
  8122a0:	89 d1                	mov    %edx,%ecx
  8122a2:	89 fa                	mov    %edi,%edx
  8122a4:	89 c8                	mov    %ecx,%eax
  8122a6:	31 ff                	xor    %edi,%edi
  8122a8:	f7 f6                	div    %esi
  8122aa:	89 c1                	mov    %eax,%ecx
  8122ac:	89 fa                	mov    %edi,%edx
  8122ae:	89 c8                	mov    %ecx,%eax
  8122b0:	83 c4 10             	add    $0x10,%esp
  8122b3:	5e                   	pop    %esi
  8122b4:	5f                   	pop    %edi
  8122b5:	5d                   	pop    %ebp
  8122b6:	c3                   	ret    
  8122b7:	90                   	nop
  8122b8:	0f b6 4d f4          	movzbl -0xc(%ebp),%ecx
  8122bc:	89 f2                	mov    %esi,%edx
  8122be:	d3 e0                	shl    %cl,%eax
  8122c0:	89 45 ec             	mov    %eax,-0x14(%ebp)
  8122c3:	b8 20 00 00 00       	mov    $0x20,%eax
  8122c8:	2b 45 f4             	sub    -0xc(%ebp),%eax
  8122cb:	89 c1                	mov    %eax,%ecx
  8122cd:	d3 ea                	shr    %cl,%edx
  8122cf:	0f b6 4d f4          	movzbl -0xc(%ebp),%ecx
  8122d3:	0b 55 ec             	or     -0x14(%ebp),%edx
  8122d6:	d3 e6                	shl    %cl,%esi
  8122d8:	89 c1                	mov    %eax,%ecx
  8122da:	89 75 e8             	mov    %esi,-0x18(%ebp)
  8122dd:	89 fe                	mov    %edi,%esi
  8122df:	d3 ee                	shr    %cl,%esi
  8122e1:	0f b6 4d f4          	movzbl -0xc(%ebp),%ecx
  8122e5:	89 55 ec             	mov    %edx,-0x14(%ebp)
  8122e8:	8b 55 f0             	mov    -0x10(%ebp),%edx
  8122eb:	d3 e7                	shl    %cl,%edi
  8122ed:	89 c1                	mov    %eax,%ecx
  8122ef:	d3 ea                	shr    %cl,%edx
  8122f1:	09 d7                	or     %edx,%edi
  8122f3:	89 f2                	mov    %esi,%edx
  8122f5:	89 f8                	mov    %edi,%eax
  8122f7:	f7 75 ec             	divl   -0x14(%ebp)
  8122fa:	89 d6                	mov    %edx,%esi
  8122fc:	89 c7                	mov    %eax,%edi
  8122fe:	f7 65 e8             	mull   -0x18(%ebp)
  812301:	39 d6                	cmp    %edx,%esi
  812303:	89 55 ec             	mov    %edx,-0x14(%ebp)
  812306:	72 30                	jb     812338 <__udivdi3+0x118>
  812308:	8b 55 f0             	mov    -0x10(%ebp),%edx
  81230b:	0f b6 4d f4          	movzbl -0xc(%ebp),%ecx
  81230f:	d3 e2                	shl    %cl,%edx
  812311:	39 c2                	cmp    %eax,%edx
  812313:	73 05                	jae    81231a <__udivdi3+0xfa>
  812315:	3b 75 ec             	cmp    -0x14(%ebp),%esi
  812318:	74 1e                	je     812338 <__udivdi3+0x118>
  81231a:	89 f9                	mov    %edi,%ecx
  81231c:	31 ff                	xor    %edi,%edi
  81231e:	e9 71 ff ff ff       	jmp    812294 <__udivdi3+0x74>
  812323:	90                   	nop
  812324:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  812328:	31 ff                	xor    %edi,%edi
  81232a:	b9 01 00 00 00       	mov    $0x1,%ecx
  81232f:	e9 60 ff ff ff       	jmp    812294 <__udivdi3+0x74>
  812334:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  812338:	8d 4f ff             	lea    -0x1(%edi),%ecx
  81233b:	31 ff                	xor    %edi,%edi
  81233d:	89 c8                	mov    %ecx,%eax
  81233f:	89 fa                	mov    %edi,%edx
  812341:	83 c4 10             	add    $0x10,%esp
  812344:	5e                   	pop    %esi
  812345:	5f                   	pop    %edi
  812346:	5d                   	pop    %ebp
  812347:	c3                   	ret    
	...

00812350 <__umoddi3>:
  812350:	55                   	push   %ebp
  812351:	89 e5                	mov    %esp,%ebp
  812353:	57                   	push   %edi
  812354:	56                   	push   %esi
  812355:	83 ec 20             	sub    $0x20,%esp
  812358:	8b 55 14             	mov    0x14(%ebp),%edx
  81235b:	8b 4d 08             	mov    0x8(%ebp),%ecx
  81235e:	8b 7d 10             	mov    0x10(%ebp),%edi
  812361:	8b 75 0c             	mov    0xc(%ebp),%esi
  812364:	85 d2                	test   %edx,%edx
  812366:	89 c8                	mov    %ecx,%eax
  812368:	89 4d f4             	mov    %ecx,-0xc(%ebp)
  81236b:	75 13                	jne    812380 <__umoddi3+0x30>
  81236d:	39 f7                	cmp    %esi,%edi
  81236f:	76 3f                	jbe    8123b0 <__umoddi3+0x60>
  812371:	89 f2                	mov    %esi,%edx
  812373:	f7 f7                	div    %edi
  812375:	89 d0                	mov    %edx,%eax
  812377:	31 d2                	xor    %edx,%edx
  812379:	83 c4 20             	add    $0x20,%esp
  81237c:	5e                   	pop    %esi
  81237d:	5f                   	pop    %edi
  81237e:	5d                   	pop    %ebp
  81237f:	c3                   	ret    
  812380:	39 f2                	cmp    %esi,%edx
  812382:	77 4c                	ja     8123d0 <__umoddi3+0x80>
  812384:	0f bd ca             	bsr    %edx,%ecx
  812387:	83 f1 1f             	xor    $0x1f,%ecx
  81238a:	89 4d f0             	mov    %ecx,-0x10(%ebp)
  81238d:	75 51                	jne    8123e0 <__umoddi3+0x90>
  81238f:	3b 7d f4             	cmp    -0xc(%ebp),%edi
  812392:	0f 87 e0 00 00 00    	ja     812478 <__umoddi3+0x128>
  812398:	8b 45 f4             	mov    -0xc(%ebp),%eax
  81239b:	29 f8                	sub    %edi,%eax
  81239d:	19 d6                	sbb    %edx,%esi
  81239f:	89 45 f4             	mov    %eax,-0xc(%ebp)
  8123a2:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8123a5:	89 f2                	mov    %esi,%edx
  8123a7:	83 c4 20             	add    $0x20,%esp
  8123aa:	5e                   	pop    %esi
  8123ab:	5f                   	pop    %edi
  8123ac:	5d                   	pop    %ebp
  8123ad:	c3                   	ret    
  8123ae:	66 90                	xchg   %ax,%ax
  8123b0:	85 ff                	test   %edi,%edi
  8123b2:	75 0b                	jne    8123bf <__umoddi3+0x6f>
  8123b4:	b8 01 00 00 00       	mov    $0x1,%eax
  8123b9:	31 d2                	xor    %edx,%edx
  8123bb:	f7 f7                	div    %edi
  8123bd:	89 c7                	mov    %eax,%edi
  8123bf:	89 f0                	mov    %esi,%eax
  8123c1:	31 d2                	xor    %edx,%edx
  8123c3:	f7 f7                	div    %edi
  8123c5:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8123c8:	f7 f7                	div    %edi
  8123ca:	eb a9                	jmp    812375 <__umoddi3+0x25>
  8123cc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  8123d0:	89 c8                	mov    %ecx,%eax
  8123d2:	89 f2                	mov    %esi,%edx
  8123d4:	83 c4 20             	add    $0x20,%esp
  8123d7:	5e                   	pop    %esi
  8123d8:	5f                   	pop    %edi
  8123d9:	5d                   	pop    %ebp
  8123da:	c3                   	ret    
  8123db:	90                   	nop
  8123dc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  8123e0:	0f b6 4d f0          	movzbl -0x10(%ebp),%ecx
  8123e4:	d3 e2                	shl    %cl,%edx
  8123e6:	89 55 f4             	mov    %edx,-0xc(%ebp)
  8123e9:	ba 20 00 00 00       	mov    $0x20,%edx
  8123ee:	2b 55 f0             	sub    -0x10(%ebp),%edx
  8123f1:	89 55 ec             	mov    %edx,-0x14(%ebp)
  8123f4:	0f b6 4d ec          	movzbl -0x14(%ebp),%ecx
  8123f8:	89 fa                	mov    %edi,%edx
  8123fa:	d3 ea                	shr    %cl,%edx
  8123fc:	0f b6 4d f0          	movzbl -0x10(%ebp),%ecx
  812400:	0b 55 f4             	or     -0xc(%ebp),%edx
  812403:	d3 e7                	shl    %cl,%edi
  812405:	0f b6 4d ec          	movzbl -0x14(%ebp),%ecx
  812409:	89 55 f4             	mov    %edx,-0xc(%ebp)
  81240c:	89 f2                	mov    %esi,%edx
  81240e:	89 7d e8             	mov    %edi,-0x18(%ebp)
  812411:	89 c7                	mov    %eax,%edi
  812413:	d3 ea                	shr    %cl,%edx
  812415:	0f b6 4d f0          	movzbl -0x10(%ebp),%ecx
  812419:	89 55 e4             	mov    %edx,-0x1c(%ebp)
  81241c:	89 c2                	mov    %eax,%edx
  81241e:	d3 e6                	shl    %cl,%esi
  812420:	0f b6 4d ec          	movzbl -0x14(%ebp),%ecx
  812424:	d3 ea                	shr    %cl,%edx
  812426:	0f b6 4d f0          	movzbl -0x10(%ebp),%ecx
  81242a:	09 d6                	or     %edx,%esi
  81242c:	89 f0                	mov    %esi,%eax
  81242e:	8b 75 e4             	mov    -0x1c(%ebp),%esi
  812431:	d3 e7                	shl    %cl,%edi
  812433:	89 f2                	mov    %esi,%edx
  812435:	f7 75 f4             	divl   -0xc(%ebp)
  812438:	89 d6                	mov    %edx,%esi
  81243a:	f7 65 e8             	mull   -0x18(%ebp)
  81243d:	39 d6                	cmp    %edx,%esi
  81243f:	72 2b                	jb     81246c <__umoddi3+0x11c>
  812441:	39 c7                	cmp    %eax,%edi
  812443:	72 23                	jb     812468 <__umoddi3+0x118>
  812445:	0f b6 4d f0          	movzbl -0x10(%ebp),%ecx
  812449:	29 c7                	sub    %eax,%edi
  81244b:	19 d6                	sbb    %edx,%esi
  81244d:	89 f0                	mov    %esi,%eax
  81244f:	89 f2                	mov    %esi,%edx
  812451:	d3 ef                	shr    %cl,%edi
  812453:	0f b6 4d ec          	movzbl -0x14(%ebp),%ecx
  812457:	d3 e0                	shl    %cl,%eax
  812459:	0f b6 4d f0          	movzbl -0x10(%ebp),%ecx
  81245d:	09 f8                	or     %edi,%eax
  81245f:	d3 ea                	shr    %cl,%edx
  812461:	83 c4 20             	add    $0x20,%esp
  812464:	5e                   	pop    %esi
  812465:	5f                   	pop    %edi
  812466:	5d                   	pop    %ebp
  812467:	c3                   	ret    
  812468:	39 d6                	cmp    %edx,%esi
  81246a:	75 d9                	jne    812445 <__umoddi3+0xf5>
  81246c:	2b 45 e8             	sub    -0x18(%ebp),%eax
  81246f:	1b 55 f4             	sbb    -0xc(%ebp),%edx
  812472:	eb d1                	jmp    812445 <__umoddi3+0xf5>
  812474:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  812478:	39 f2                	cmp    %esi,%edx
  81247a:	0f 82 18 ff ff ff    	jb     812398 <__umoddi3+0x48>
  812480:	e9 1d ff ff ff       	jmp    8123a2 <__umoddi3+0x52>
